如何在启动应用程序之前运行Windows shell脚本?

Rob*_*ers 1 scripting shortcuts windows-scripting

有没有办法配置应用程序快捷方式,以便在启动应用程序之前运行Windows shell脚本?就我而言,我想在应用程序运行之前备份一些文件.

谢谢!

Mit*_*tch 7

您可以更改应用程序快捷方式以实际运行shell脚本,只需在脚本末尾添加START命令,以便在完成后运行程序.

IE:将记事本快捷方式从%SYSTEMROOT%\ Windows\Notepad.exe更改为c:\ launchNotepad.bat并将openschnotepad.bat改为类似

COPY importantfile.txt importantfile.txt.bak
START %SYSTEMROOT%\Windows\Notepad.exe importantfile.txt
Run Code Online (Sandbox Code Playgroud)