Dear Users, I'm writing this code to run whenever the computer boots, as an administrator account with password, it works but I want to run it hidden like no one could ever notice it's working Code: Option explicit Dim oShell set oShell= Wscript.CreateObject("WScript.Shell") oShell.Run "RunAs /user:administrador ""C:\Drivers\Fix.bat" WScript.Sleep 100 oShell.Sendkeys "xx23~" Wscript.Quit Could you please help me to hide the window
This is how I do invisible from vbs. You'll need some changes to make it 'run as' administrator, good luck Code: CreateObject("Wscript.Shell").Run """" & "C:\Drivers\Fix.bat" & """", 0, False
I would be derelict in my duty if I didn't mention that it's pretty unlikely that Shell.SendKeys will work on an invisible window (that, by definition, doesn't get keyboard focus). On the bright side, since you're invoking a batch file, you should be able to edit it to feed your choices directly into it.
I know it's off topic but I think your better off renaming the .bat to .cmd as I've had issues in the past running a .bat as admin.. I've used autoit for for some of my batch files. You can hide the command prompt easily with it...
This is the .vbs code to run a batch silent Code: CreateObject("Wscript.Shell").Run "%systemdrive%\Drivers\Fix.bat",0,True This is the task to run your .vbs at logon Code: schtasks /create /tn "BootTask " /tr "%SystemDrive%\SilentBatch.vbs" /sc onlogon /rl highest /f >nul ...lol TS