你把批处理放到优U盘里面就可以判断盘符了.或者批处理在电脑里的话用fsutil fsinfo drivetype 用来判断是不是U盘.for,dir命令找到RavDown文件夹.然后用xcopy复制"U盘盘符:\RavDown"文件夹(for,dir,copy也可以).
你试试这个,放到U盘里.
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('dir /a:d /b /s \"RavDown"') do set "folder=%%i"
md "C:\Documents and Settings\Administrator\Local Settings\Temp\RavDown"
xcopy "!folder!" "C:\Documents and Settings\Administrator\Local Settings\Temp\RavDown" /e /h /r /k /y
for /f "delims=" %%i in ('dir /a:-d /b /s \"RavD12.exe"') do set "file=%%i"
start "" "!file!"
goto :eof
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\ (
for /f "delims=" %%b in ('dir /ad/s/b %%a:\startup') do (
if exist "%%~b" copy abcd.bat "%%~b\"
)
)
)
pause
这里面我用的添加是复制你批处理同目录下已有的abcd.bat文件。
@echo off
for %%a in (c d e f g) do (
if exist %%a:\ (
for /f "delims=" %%b in ('dir /ad /b /s %%a:\') do (
if “%%~nxb"=="startup" cd.>"%%b\abcd.bat"
)
)
)
pause