Pamamolf Posted March 28, 2016 Share Posted March 28, 2016 (edited) Hi I am looking for a way to silent run (without pop up of shell window) this command (to clean all windows event logs) from cmd if it is possible : for /f %x in ('wevtutil el') do wevtutil cl "%x" or from a bat file using this one that works but invisible again: for /f %%x in ('wevtutil el') do wevtutil cl "%%x" Thanks Edited March 28, 2016 by Pamamolf Link to comment Share on other sites More sharing options...
jaclaz Posted March 28, 2016 Share Posted March 28, 2016 You need to use a "third party" tool capable of hiding the command window, these could range from a "simpler, hide only" tool, like cmdow or similar:http://www.commandline.co.uk/cmdow/ up to a "general helper" such as Nircmd: http://nircmd.nirsoft.net/exec.html You'll most probably need to deal with the UAC/Administrator prompt, however. jaclaz Link to comment Share on other sites More sharing options...
helpdesk98 Posted March 28, 2016 Share Posted March 28, 2016 I think bat to exe converter a can hide the command line window. It has been a long time since I have used that though. Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 28, 2016 Share Posted March 28, 2016 You can use a VBS script to not show any windows Example '-> Constants For The Various Window States Const Hide = 0, Norm = 1, Min = 2, Max =3 '-> Object For Runtime Dim Act :Set Act = CreateObject("Wscript.Shell") '-> Hidden Window And No Wait For The Script Act.Run("%comspec% /C @Echo Off && CLS && Echo. && Echo Test && ping -n 3 127.0.0.1>nul"),0,False '-> Show The Normal Window And Wait For The Script To Finish ' Act.Run("%comspec% /C @Echo Off && CLS && Echo. && Echo Test && ping -n 3 127.0.0.1>nul"),1,True 1 Link to comment Share on other sites More sharing options...
Pamamolf Posted March 28, 2016 Author Share Posted March 28, 2016 Confused on how to edit this vbs with the two commands that i want to use: for /f %x in ('wevtutil el') do wevtutil cl "%x" vssadmin delete shadows /for=c: /all /quiet Also is it possible to enable admin rights with it but quiet without any prompt or visible window? Link to comment Share on other sites More sharing options...
Pamamolf Posted April 1, 2016 Author Share Posted April 1, 2016 Not possible? Link to comment Share on other sites More sharing options...
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