pttb_-_Pin_To_TaskBar icon indicating copy to clipboard operation
pttb_-_Pin_To_TaskBar copied to clipboard

How to pin .bat or .cmd files

Open crackfed opened this issue 1 year ago • 1 comments

pttb.exe (and syspin.exe) will not pin .bat or .cmd files to the taskbar. But there is a way:

  1. ren FOO.cmd FOO.exe
  2. pttb.exe FOO.exe
  3. certutil -f -encodehex "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\FOO.lnk" FOO.enc 12
  4. ssr.exe -w -q 657865=636d64 006500780065=0063006d0064 FOO.enc
  5. certutil -f -decodehex FOO.enc "%USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\FOO.lnk"
  6. del FOO.enc
  7. ren FOO.exe FOO.cmd
  8. pttb.exe -r

Notes: 1. or may be a .bat (or other?) file. 2. FOO.exe now pinned. 3. FOO.enc is a one line text file. 4. ssr.exe is Simple Search and Replace utility, any similar will do. 657865 is the string for 'exe'; 636d64 is for 'cmd' or use 626174 for 'bat'. Be aware these are lowercase values. 5. Replaces modified .lnk file. 6. No longer needed. 7. Back to original name. 8. May not be needed.

Now clicking the pinned .cmd file will run it. Change properties/icon as needed.

crackfed

crackfed avatar Apr 03 '24 04:04 crackfed

You could also create a shortcut to your .bat file and add cmd /c to the target field of this shortcut: target: cmd /c "path/to/script.bat"

You should then be able to pin that shortcut to the taskbar.

0x546F6D avatar Apr 15 '24 11:04 0x546F6D