1
0
Created a GPO to run a batch file on shutdown for domain XP computers - with the purpose of deleting old user profiles.
For this I am using an application called DeleteProfiles from OptimumX.
cd C:\
if exist "Program Files (x86)" GOTO Exit (Checks if XP or not)
if exist DeleteProfiles GOTO COMMAND
:CopyDeleteProfiles
md DeleteProfiles
copy /Y \\SomeShare\SomeFolder\DeleteProfiles\DeleteProfiles.exe
C:\DeleteProfiles\
:COMMAND
pushd C:\DeleteProfiles\
start /Wait DeleteProfiles.exe /MIN:14 /Y
(/Min: # = Delete profiles older than # and /y removes yes or no prompts)
:Exit
End
It works alright, but, a CMD screen appears appears at shutdown, with the output of the program. How do I make it go away?
The real problem here is that users can close the program which causes the script to stop. If I can't make that go away, I would like at least to make the screen not close-able.
Have you tried the
start /b
option? "/B Start application without creating a new window. " – DavidPostill – 2017-05-26T12:42:18.070Wow, thanks! that was it! should have looked up start /? haha – Alex.T – 2017-05-26T13:03:13.797
Great. I shall add an answer, which you will able to accept. – DavidPostill – 2017-05-26T13:05:38.917