eech
高级用户
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『楼 主』:
如何用批处理来执行另一道删除自身的批处理
http://bbs.crsky.com/read.php?tid=962037&page=1&toread=1
这说的比较清楚.也是我发的.大家帮忙看看
f:\盘下有a.bat(此批处理会删除自身)
如何正确批处理执行F:\A.BAT
我试了f:\a.bat
start f:\a.bat
都会报错.(能达到执行目的)
要求:在此批处理中加上start.用另一批处理来执行这条批处理
请教正确执行方法.(不会有错误提示)
@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
[ Last edited by eech on 2007-1-15 at 10:24 PM ]
|
|