Dim WshShell, ObjFSO Set WshShell = CreateObject("WScript.Shell") set objFSO = CreateObject("Scripting.FileSystemObject") appl="C:\1Cv7\BINOP\1CV7s.exe" users="DomenKompanii\emigachev" Set objWMIService = GetObject _ ("winmgmts:\\.\root\cimv2:Win32_Process") errReturn = objWMIService.Create _ ("cmd.exe /K ""title RUNAS_AUTO & runas.exe /user:" & users & " """ & appl & """""", Null, Null, intProcessID) wscript.Sleep(1000) wshShell.AppActivate "RUNAS_AUTO" function WriteWord() WshShell.SendKeys "P@ssw0rd" end function wscript.Sleep(1000) wshShell.SendKeys "{ENTER}"
Set WshShell = CreateObject("Wscript.Shell") Set WshEnv = WshShell.Environment("PRocess") WshShell.Run "runas.exe /user:DomenKompanii\emigachev C:\WD\1Cv7\BINOP\1CV7s.exe" Wscript.Sleep 800 WshShell.AppActivate WshEnv("SystemRoot") & "\system32\runas.exe" Wscript.Sleep 200 WshShell.SendKeys "P@ssw0rd" Wscript.Sleep 500