Post setup command position

rdja29

New Member
Hi!

I am trying to make my version unattended and at the moment everything works fine except when I insert a post installation CMD command to delete a folder, the command in question is the following:

DEL /Q "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools"

DEL /Q "%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools"

They both do the same function of deleting the folder, but my question is whether they go before or after [Placeholder row for potentially deferred updates] or there is something wrong in the command line, but with other folders it does not happen to me and if it works, only with those that depend on the user folder.

Thank you very much in advance :)
 
Post-setup commands are executed by the SYSTEM account, not as you. The reason why most people get this wrong, is the desktop appears immediately after SetupComplete.cmd finishes.

Change this command to a RunOnce task:

reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v RunScript /t REG_SZ /d “DEL /Q "%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools" ” /f
 
Back
Top