OptimumX Delete Profiles - Windows XP machines

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.

Alex.T

Posted 2017-05-26T12:23:42.360

Reputation: 19

Have you tried the start /b option? "/B Start application without creating a new window. " – DavidPostill – 2017-05-26T12:42:18.070

Wow, 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

Answers

0

How do I make it go away?

You can use start with the /b option:

start /b /Wait DeleteProfiles.exe /MIN:14 /Y

/B - Start application without creating a new window. In this case ^C will be ignored - leaving ^Break as the only way to interrupt the application.

Source - start


Further Reading

DavidPostill

Posted 2017-05-26T12:23:42.360

Reputation: 118 938