- 帖子
- 137
- 积分
- 184
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2017-12-23
|
2楼
发表于 2019-2-7 12:56
| 只看该作者
试试看
@echo off
If exist %USERPROFILE%\Desktop\a.url (Start %USERPROFILE%\Desktop\a.url & pause >nul) else (echo Finding & Goto find)
:find
:如果要查找所有的a.exe去掉 goto
for %%a in (A B C D E F G H I J K L M N) do (
if exist %%a:\ (
cd /d %%a:\
for /f "delims=" %%b in ('dir /s /a-d /b a.exe') do (
if exist "%%b" (
goto set.
)
)
)
)
)
:set.
echo %%b
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(""%userprofile%\Desktop\a.url""):b.TargetPath=""%%b"":b.WorkingDirectory="""":b.Save:close")
pause >nul |
|