eech
高级用户
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『楼 主』:
批处理在不同路径执行结果不一样
C盘WINDOWS\Temp下有批处理OEM.BAT
内容如下:
@echo off
echo Windows Registry Editor Version 5.00>>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}]>>tmp.reg
echo @="启动项">>tmp.reg
echo "InfoTip"="快捷方式">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\DefaultIcon]>>tmp.reg
echo @="C:\\WINDOWS\\system32\\OEMLINK.ico">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\InProcServer32]>>tmp.reg
echo @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\>>tmp.reg
echo 00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\>>tmp.reg
echo 64,00,6f,00,63,00,76,00,77,00,2e,00,64,00,6c,00,6c,00,00,00>>tmp.reg
echo "ThreadingModel"="Apartment">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\Instance]>>tmp.reg
echo "CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\Instance\InitPropertyBag]>>tmp.reg
echo "CLSID"="{13709620-C279-11CE-A49E-444553540000}">>tmp.reg
echo "method"="ShellExecute">>tmp.reg
echo "Param1"="C:\\WINDOWS\\pchealth\\helpctr\\binaries\\msconfig.exe">>tmp.reg
echo "Command"="Run App">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\shellex]>>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\shellex\ContextMenuHandlers]>>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\shellex\ContextMenuHandlers\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}]>>tmp.reg
echo @="">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\shellex\MayChangeDefaultMenu]>>tmp.reg
echo @="">>tmp.reg
echo [HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}\ShellFolder]>>tmp.reg
echo "Attributes"=dword:00000000>>tmp.reg
start /wait regedit /s tmp.reg
del /q tmp.reg
del %0
在C盘WINDOWS\Temp再建一个批处理内容:C:\WINDOWS\Temp\oem.bat
可以正确执行
如果在命令提示符中执行C:\WINDOWS\Temp\oem.bat则会提示"找不到批处理文件"
哪位大虾指点小弟.如何从命令提示符中执行.("不会提示找不到批处理文件")
[ Last edited by eech on 2007-1-15 at 11:25 PM ]
|
|