Login | |
|
 |
RE: objShell.Exec minimized - 5/17/2007 9:13:42 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
Would this do it Set objShell = WScript.CreateObject("WScript.Shell") objShell.Run "cmd /c ipconfig /all" , 0, True objShell.Run "cmd /c ipconfig.exe", 0, True
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/18/2007 3:49:54 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
You say it can onyl run in exec, and not with Run. Why? What are you trying to accomplish that requires exec?
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/18/2007 5:36:35 AM
|
|
 |
|
| |
mcds99
Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
|
This can be done but it's outside of the script. Run the script from a .bat or .cmd file like this cscript scriptname.vbs exit Open a command prompt and run the batch file. If you need to run this a lot create a shortcut, in the shortcut properties set the "Run" to minimized.
_____________________________
Sam Keep it Simple Make it Fun KiSMiF
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/21/2007 12:07:34 AM
|
|
 |
|
| |
4scriptmoni
Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
|
i thought there was a way... :( I guess I will try the batch file option. because its quite anyoning when popup 400 times a cmd window. in Run mode I can not redirect correctly the output, so it will not work for me. it has be on Exec mode. thx anyways.
_____________________________
Enterprise Microsoft Scripts Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc... http://www.felipeferreira.net
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/21/2007 4:51:47 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
Have you tried running your script in CSCRIPT mode and then changing this line - Set objExecObject = objShell.Exec("cmd /c quser " & username & " /server:" & servername ) to Set objExecObject = objShell.Exec("quser " & username & " /server:" & servername) You can probably get away without changing that line, but running your script in CSCRIPT mode is the main thing you want to do.
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/21/2007 5:01:05 AM
|
|
 |
|
| |
4scriptmoni
Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
|
i forgot to mention it is in .HTA :( but I may try again the run mode...
_____________________________
Enterprise Microsoft Scripts Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc... http://www.felipeferreira.net
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/21/2007 7:20:08 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
what command are you trying to capture?
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/21/2007 8:49:56 PM
|
|
 |
|
| |
4scriptmoni
Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
|
Set objExecObject = objShell.Exec("quser " & username & " /server:" & servername) i then parse in many ways the output, in order to get: session id, time, date like i said i will try the run mode although to do Set objRuncObject = objShell.Run("quser " & username & " /server:" & servername>&file.txt) will probably not work :( cheers,
_____________________________
Enterprise Microsoft Scripts Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc... http://www.felipeferreira.net
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/22/2007 1:10:48 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
For stuff like that at the commandline, I find that I usually have to run it inside a full command environment: Dim oShell, oFSO Set oShell = CreateObject("Wscript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") oShell.Run "%comspec% /c quser " & username & " /server:" & servername & " > c:\tempfile.txt",0,True WScript.Echo oFSO.OpenTextFile("c:\tempfile.txt").ReadAll EDIT: I just tried the quser command, and was able to get the output with the above code, so this works.
< Message edited by DiGiTAL.SkReAM -- 5/22/2007 1:16:05 AM >
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: objShell.Exec minimized - 5/23/2007 12:25:09 AM
|
|
 |
|
| |
4scriptmoni
Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
|
THANK YOU THANK YOUUUuuuuu
_____________________________
Enterprise Microsoft Scripts Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc... http://www.felipeferreira.net
|
|
| |
|
|
|
|
|