中国DOS联盟

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

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

中国DOS联盟论坛
现在时间是 2026-08-05 13:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 关于choice在XP SP2系统里怎么使用 查看 1,169 回复 9
楼 主 关于choice在XP SP2系统里怎么使用 发表于 2006-11-27 05:35 ·  中国 河南 信阳 电信
初级用户
积分 118
发帖 42
注册 2006-09-14 21:58
19年会员
UID 62590
状态 离线
@echo 防右键有自动播放

choice /c:mje md,jixu,end
if errorlevel 3 goto md
if errorlevel 2 goto jixu
if errorlevel 1 goto end

:md
md d:\autorun.inf
attrib D:\autorun.inf +s +r +h
md d:\sxs.exe
attrib d:\sxs.exe +s +r +h
md e:\autorun.inf
attrib e:\autorun.inf +s +r +h
md e:\sxs.exe
attrib e:\sxs.exe +s +r +h
md f:\autorun.inf
attrib f:\autorun.inf +s +r +h
md f:\sxs.exe
attrib f:\sxs.exe +s +r +h
md g:\autorun.inf
attrib g:\autorun.inf +s +r +h
md g:\sxs.exe
attrib g:\sxs.exe +s +r +h
md h:\autorun.inf
attrib h:\autorun.inf +s +r +h
md h:\sxs.exe
attrib h:\sxs.exe +s +r +h

:jixu
call 1.bat

:end
echo baibai~~
exit


choice在sp2不能用么? 还有 如果想定义一个变量 可以自动查出有几个盘 加几个盘的autorun.ini sxs.exe 该怎么办呢

新手 菜鸟 看着教学贴编的 不要扔鸡蛋
2 发表于 2006-11-27 05:42 ·  中国 四川 成都 教育网
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
搜索下 choice 就知道解决方法了。

方法是从 2003 里拷一个

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
3 发表于 2006-11-27 05:48 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
积分 2,725
发帖 1,160
注册 2006-09-23 12:00
19年会员
UID 63486
来自 河北廊坊
状态 离线
1、xp sp2并不自带choice,你可以在论坛搜一下,能找到好多。
2、至于有几个盘,试试fsutil fsinfo drives命令。
3、autorun.ini sxs.exe 直接删除用namejm版主的代码改一下,代码如下:
@echo off
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && del /a /f /s !drive!\_desktop.ini
)
pause


你也可以看到哪个盘里有这些文件。
4、鸡蛋留着自己吃了,挺贵的。
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
4 发表于 2006-11-27 05:51 ·  中国 北京 联通
金牌会员
★★★★
积分 2,902
发帖 1,147
注册 2006-09-21 12:00
19年会员
UID 63324
性别 男
状态 离线
md d:\autorun.inf 楼主这个方法好~:)
有了这个目录以后系统就不再允许在这个目录的上一级目录建立 autorun.inf 的文件了,
间接 “免役” 了这个文件~:)
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
5 发表于 2006-11-27 06:52 ·  中国 四川 成都 教育网
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线

md d:\autorun.inf 楼主这个方法好~:)

学习了

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
6 发表于 2006-11-27 09:40 ·  中国 湖北 武汉 电信
版主
★★★★★
积分 11,386
发帖 4,938
注册 2006-07-23 17:10
20年会员
UID 59080
状态 离线

  恩,不错啊,同一个目录内不允许有名字相同的文件或者文件夹。
7 发表于 2006-11-27 23:45 ·  中国 四川 成都 教育网
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
其实还有一个更好的方法,
1. 禁用 Shell Hardware Detection
2. 修改注册表权限,具体的忘记了

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
8 发表于 2006-11-28 01:36 ·  中国 河南 信阳 潢川县 电信
初级用户
积分 118
发帖 42
注册 2006-09-14 21:58
19年会员
UID 62590
状态 离线
我这有一份关于禁用Shell Hardware Detection 1200种病毒的
不好用 现在软件和游戏应用都越来越多 有时候禁到了别的还是自己麻烦
呵呵

@echo 防右键有自动播放
fsutil fsinfo drives > path.txt
? 是这样吧 怎么把path里边的盘符定义成一个变量呢

choice /c:me md,end
好像不好用 说格式错误。。。

if errorlevel 2 goto md
if errorlevel 1 goto end

:md
md %变量%\autorun.inf
md %变量%\sxs.exe
:end
echo bye bye~
9 发表于 2006-11-28 03:52 ·  中国 河南 信阳 潢川县 电信
初级用户
积分 118
发帖 42
注册 2006-09-14 21:58
19年会员
UID 62590
状态 离线
再顶一下 呵呵 一直在等答案呢
10 发表于 2007-08-02 10:09 ·  中国 江苏 南京 电信
新手上路
积分 2
发帖 1
注册 2007-07-25 16:15
19年会员
UID 94015
性别 男
状态 离线
顶一下
论坛跳转: