中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-10 11:02
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 添加path的程序 查看 913 回复 7
楼 主 添加path的程序 发表于 2008-07-27 15:36 ·  中国 山东 济宁 曲阜市 联通
中级用户
★★★
痴迷DOS者
积分 456
发帖 570
注册 2004-10-09 00:00
21年会员
UID 32281
性别 男
状态 离线
用起来还可以
@echo off
:: 添加PATH - padd.bat (find.exe)
if %1#==# goto end
if %1#==l# goto atlast

:: 插入path首
path|find /i "%1">NUL
if errorlevel 1 path=%1;%path%
goto end

:: 插入path尾
:atlast
path|find /i "%1">NUL
if errorlevel 1 path=%path%;%1

:end
DOS不是万能的,没有DOS是万万不能的
自古系统谁无死?留取胆清照汗青!uploadImages/20035317345478982.png
2 添加append的程序 发表于 2008-07-27 15:47 ·  中国 山东 济宁 曲阜市 联通
中级用户
★★★
痴迷DOS者
积分 456
发帖 570
注册 2004-10-09 00:00
21年会员
UID 32281
性别 男
状态 离线
@echo off
append|find /i "%1">nul
if not errorlevel 1 goto end
append|aplsr %1>nul

需要的文件:http://www.fs2you.com/files/7e654ba6-5bae-11dd-b99f-0014221b798a/
DOS不是万能的,没有DOS是万万不能的
自古系统谁无死?留取胆清照汗青!uploadImages/20035317345478982.png
3 发表于 2008-07-27 16:50 ·  中国 江西 赣州 电信
银牌会员
★★★★
积分 2,025
发帖 1,122
注册 2007-09-05 20:15
18年会员
UID 96653
性别 男
状态 离线
Windows Resource Kit Tools 里有个这样的工具 pathman.exe (6.5K)
USAGE:

/as path]
Adds the semicolon-separated paths to the system path.

/au path]
Adds the semicolon-separated paths to the user path.

/rs path]
Removes the semicolon-separated paths from the system path.

/ru path]
Removes the semicolon-separated paths from the user path.


下载链接: http://clip2net.com/page/m316/259772

[ Last edited by tireless on 2008-7-26 at 08:55 PM ]
4 发表于 2008-07-27 19:57 ·  美国 惠普HP
版主
★★★★★
积分 9,023
发帖 5,017
注册 2007-05-31 19:39
19年会员
UID 89899
性别 男
状态 离线
用批处理不是也可以实现吗?用这个第三方工具干吗?
5 发表于 2008-07-27 23:45 ·  中国 江西 赣州 安远县 电信
银牌会员
★★★★
积分 2,025
发帖 1,122
注册 2007-09-05 20:15
18年会员
UID 96653
性别 男
状态 离线
这个?
wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;c:\test"

执行速度很慢啊
本帖最近评分记录 (共 1 条) 点击查看详情
评分人分数时间
pusofalse +1 2008-07-28 01:40
6 发表于 2008-07-28 01:39 ·  中国 山东 淄博 联通
银牌会员
★★★
积分 1,604
发帖 646
注册 2008-04-13 23:39
18年会员
UID 115804
性别 男
状态 离线
Originally posted by tireless at 2008-7-27 11:45 PM:
这个?
wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;c:\test"

执行速度很慢啊


又学到了新方法~^_^
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
7 发表于 2008-07-28 15:06 ·  中国 广东 广州 电信
中级用户
★★
积分 233
发帖 117
注册 2007-11-28 02:38
18年会员
UID 104005
性别 男
状态 离线
Originally posted by tireless at 2008-7-27 11:45 PM:
这个?
wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;c:\test"

执行速度很慢啊



这样好呀,不用借助第三方工具,谢谢分享
8 发表于 2008-11-13 15:59 ·  中国 北京 鹏博士BGP
初级用户
积分 22
发帖 21
注册 2008-11-13 13:44
17年会员
UID 130844
性别 男
状态 离线
用这个程序难道有什么另外的想法?
论坛跳转: