denmyos Posted August 22, 2016 Author Posted August 22, 2016 Succes thank you so much. I ended up using this: @echo off net use \\UNC\f$ /user:UNC\admin P@ssword rd /q /s "c:\games" >>\\UNC\f$\%computername%.txt (for some reason this will not report back to the.txt ) del /q /s "C:\users\CS Dedicated Server CLI.Lnk" >>\\UNC\f$\%computername%.txt del /q /s "C:\users\Counter-Strike WaRzOnE.LNK" >>\\UNC\f$\%computername%.txt del /q /s "C:\users\CS Dedicated Server GUI.LNK" >>\\UNC\f$\%computername%.txt del /q /s "C:\users\Half-Life WaRzOnE.LNK" >>\\UNC\f$\%computername%.txt I have one question though. I need to use this on about 100 computer. Will it be to difficult to have them report back to 1 .txt file, instead of 100 files.?
DJ-1701 Posted August 22, 2016 Posted August 22, 2016 The RD command will only say something if there is a problem. With regard to reporting to 1 file, you could try adding the following command ECHO %ComputerName% >> \\UNC\f$\Report.txt and changing all other references of %computername%.txt to Report.txt). 1
denmyos Posted August 23, 2016 Author Posted August 23, 2016 It seems like it work beautifully. one question though.? The computers in the report.txt are those the computer that the script ran on, or those computer that the script delete the files on.?
DJ-1701 Posted August 23, 2016 Posted August 23, 2016 It will be the computers the script ran on. Information underneath the name should be what files if any were deleted.
denmyos Posted August 25, 2016 Author Posted August 25, 2016 (edited) sorry to bother you again, but it seems that counter strike also is in the start menu. So I added this line. @echo off net use \\bibdeep.nkpub.dk\f$ /user:bibdeep.nkpub.dk\username password echo %ComputerName% >> \\bibdeep.nkpub.dk\f$\Report.txt rd /S /q c:\games >>\\bibdeep.nkpub.dk\f$\%Report%.txt del /q /s "C:\users\CS Dedicated Server CLI.Lnk" >>\\bibdeep.nkpub.dk\f$\%Report%.txt del /q /s "C:\users\Counter-Strike WaRzOnE.LNK" >>\\bibdeep.nkpub.dk\f$\%Report%.txt del /q /s "C:\users\CS Dedicated Server GUI.LNK" >>\\bibdeep.nkpub.dk\f$\%Report%.txt del /q /s "C:\users\Half-Life WaRzOnE.LNK" >>\\bibdeep.nkpub.dk\f$\%Report %.txt del /q /s "C:\Users\Bruger\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Counter-Strike" >>\\bibdeep.nkpub.dk\f$\%Report%.txt set folder="C:\Users\Bruger\Downloads" cd /d %folder% for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) But it delete everything else in the start menu, BUT counter-strike.!? Edited August 26, 2016 by Dos_Box
Davit2005 Posted August 26, 2016 Posted August 26, 2016 We run this at deployment stage in MDT PowerShell.exe Remove-Item c:\Users\Public\Desktop\*.* . And works a treat. PowerShell.exe Remove-Item c:\Users\Public\Desktop\*.*
denmyos Posted August 30, 2016 Author Posted August 30, 2016 We run this at deployment stage in MDT PowerShell.exe Remove-Item c:\Users\Public\Desktop\*.* . And works a treat. I have deepfreeze running on the computers. But I had some issues with deepfreeze, so sometimes it was thawed while it should be frozen. And somebody installed counter-strike in that periode. I just need to delete CS with the batch, so its not a permanent solution. But thanks for the feedback
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now