用bat實現開啟當前指定快捷方式指向的目錄
- 2022-06-17
@echo off
::windows7,開啟1234。lnk
set “com=findstr 。 1234。lnk^|more^|findstr /i ”:\\“”
for /f “skip=1 delims=” %%a in (‘%com%’)do start “” “%%~dpa”
@echo off
set “fn=exe的檔名”
mshta vbscript:execute(“set a=createobject(”“wscript。shell”“):set b=a。createshortcut(”“%~dp0%fn%。lnk”“):b。targetpath=”“%~dp0%fn%。exe”“:b。workingdirectory=”“%~dp0”“:b。save:close”)第二行中等號右邊設定exe檔名,不包含字尾名。