本帖最后由 tmplinshi 于 2011-6-24 20:38 编辑
- @echo off
-
- set "dir_game=D:\网络游戏"
- set "dir_lnk=d:\游戏快捷方式"
- set "file=run_game.exe"
-
- for %%i in (error no_exe no_ico) do set %%i=
- for /f "delims=" %%f in (' dir /a:-d /b /s "%dir_game%\%file%" ') do (
- setlocal
- if not exist "%%~dpf\menu.exe" set /a error = 1, no_exe = 1
- if not exist "%%~dpf\Game.ICO" set /a error = 1, no_ico = 1
- if not defined error (
- for %%d in ("%%f\..") do (
- call :CreateShort "%%f" "%dir_lnk%\%%~nxd" "%%~dpfGame.ICO"
- )
- ) else (
- echo %%~dpf
- if defined no_exe echo 缺少 menu.exe
- if defined no_ico echo 缺少 Game.ICO
- ) >>CreateShort.log
- endlocal
- )
- exit /b
-
- :CreateShort
- mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%~2.lnk""):b.TargetPath=""%~1"":b.WorkingDirectory=""%~dp1"":b.IconLocation=""%~3"":b.Save:close")
复制代码
|