I use a batch script start.bat
to run my program. I create a shortcut for this purposes as shown below:
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\start.bat"; \
IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\start.bat"; \
IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon
In order for the user to be allowed to drag the shortcut to a batch file to the taskbar (Windows 10) I have to modify the shortcut path from E:\Soft\MyProgram\start.bat
to cmd /c E:\Soft\MyProgram\start.bat
. But I can't just change the path to Filename: "cmd /c {app}\start.bat";
it doesn't work. Any ideas?
cmd /c E:\Soft\MyProgram\start.bat
The above command executes cmd.exe
program with /c E:\Soft\MyProgram\start.bat
as its parameters.
In Inno Setup Icons
section, you specify the parameters using Parameters
parameter:
[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "cmd"; \
Parameters: "/c E:\Soft\MyProgram\start.bat"; \
IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon
cmd
, you should use {cmd}
constant.E:\Soft\MyProgram
, you should use {app}
.WorkingDir
parameter.[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "{cmd}"; \
Parameters: "/c ""{app}\start.bat"""; WorkingDir: "{app}" \
IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon