When I run the following command the status always remains 0 and program hangs. This only occurs on Windows XP machines running the REG.EXE program, ok on NT4
set oExec = objshell.exec ("reg query ""Hklm\software\microsoft\windows nt\CurrentVersion""")
do while oExec.status = 0
wscript.sleep...
Do until status = 0 would imply continue before the command has completed
WshRunning ( = 0)
The job is still running.
WshFinished ( = 1)
The job has completed
My script needs to confirm the command has completed before moving on and there lies the problem when using the req.exe command.
I have substitued the command line with
Set oExec = objshell.exec ("calc.exe")
and this works fine, so it seems to be something related to the Reg.exe command line not terminating correctly any ideas as i'm stumped
I've changed it to a simplified version as below, if I remove the do while loop then output is ok. The oExec status always remains 0
Dim x
const ForAppending = 8, forwriting = 2
Set objShell=CreateObject("WScript.Shell")
Set objfso=CreateObject("Scripting.FileSystemObject")
set stdout =...
I'm having trouble capturing stdout from the run command using script below any ideas????
const ForAppending = 8, forwriting = 2
Set objShell=CreateObject("WScript.Shell")
Set objfso=CreateObject("Scripting.FileSystemObject")
set stdout = wscript.stdout
Set X = objshell.run ("%comspec% /c...
I have a script that runs a net use command to remote
workstations Admin$. Once the Net use authentication takes place I need to confirm I have access to files within the
share. If I were using shell script I would run the following command.
If file Exists \\Workstation\admin\*.*
However as...
I'm looking to run a logon script that detects whether the user is connected via RAS before commencing. Is there a VBSCript command that I can run for this.
Note the check will be for windows 9.X and 2000
I have written as script that checks the last accessed date and and size of shares on a server. This works fine on servers with fairly small share'd area's. The problem I have is with large dept shares that maybe 50GB plus. I,m using the Getfolder command as below to accertain the size
Set f =...
The source file is the share info pulled out of the Registry and is in the form shown below. What I am trying to do is to extract the sharename and Share path and then check for the existance of the directory. The complete script is as follows.
Dim MyString, myarray, myarray2, myarray3...
I am new to Vbscript and have come up against a problem using an array to split a string. The error is (subscript out of range). The error occurs after reading the 10th line of text. I have been looking at ways to destroy and recreate the array before looping back but cannot see a way to do this...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.