Re: force a script to resume before it is ready



I think you need a ping:

'-------------------------------------------------------------------------
strComputer = "192.168.2.199" 'IP of the client

Set objWMIService = GetObject("winmgmts:\\" & "." & "\root\cimv2")
Set colPings = objWMIService.ExecQuery ("Select * From Win32_PingStatus where Address = '" & strComputer & "' AND Timeout=100")
For Each objStatus in colPings
If IsNull(objStatus.StatusCode) or objStatus.StatusCode <> 0 Then
strState = "Offline"
Else
strState = "Online"
End If
Next
'-------------------------------------------------------------------------



imaciscoguy schrieb:
Can I be Helped???
This is part of my FTP script that connects to multiple Computers (as
determined by a machine.txt file) and retrieves a file from each
computer with all having the same name. The script then renames that
file to the computer name, date and time.
My problem is when one of the computers is not available, the script
hangs while attempting to get that file then errors out because it is
trying to rename a file that does not exist.
I know that you can use "on error resume next" with regard to renaming
a file that does not exist,
but I would still like to make it continue after only a few seconds.

My questions;
Can you tell it to "On error resume next" say after only 3 or 4
seconds.
or can I tell it "On error to Cleanup files" and goto Next to
continue
loop.


Thanks so much,
Cisco


'__________________________________________________
' now run the FTP batch file created above
' create a shell and run the batch file
'_________________________________________________


Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run strFTPBat,0,TRUE
Set oShell = Nothing


'_____________________________________
'Cleanup files
'_______________________________________
fso.DeleteFile strFTPBat,1
fso.DeleteFile strResponseFile,1


'______________________________________________
'Rename the Files
'_____________________________________________
set fso = createobject("scripting.filesystemobject")
set file = fso.getfile("machine.ini")
mybase = fso.getbasename(file.name)
myext = fso.getextensionname(file.name)
mysuffix = replace(formatdatetime(now(),vbShortdate),"/","-")
mytime = replace(formatdatetime(now(),vbLongTime),":","-")
file.name = mybase & strFtpHost & "-" & mysuffix & "-" & mytime & "."
& myext
'file.name = mybase & strFtpHost & "-" & mysuffix & "." & myext
'msgbox file.name


'______________________________________________
'Continue Loop
'_______________________________________________
Next
'____________End Of Script__________

.



Relevant Pages

  • Targeting VBScript to rename PCs
    ... Remove aged accounts, Move Computers to the correct OU ... I have the script for the last one working ... 'Rename PC and domain machine account ...
    (microsoft.public.scripting.vbscript)
  • Re: Remotely rename computer name and join to domain
    ... go to every single computer and rename it and wait and then ... If this is some unattended installation - why not script it and have it ... If you are joining old computers to a new domain - then why not script it so ...
    (microsoft.public.windowsxp.security_admin)
  • compiling a script
    ... How do I run the following script if I want to rename my computers in the domain? ... strValueName = "ActiveComputerName" ...
    (microsoft.public.scripting.wsh)
  • Re: Can I rename computers through AD?
    ... You cannot rename computers from the AD consoles. ... For WinXP you can use NETDOM which you can script to ... If you have Win2K, however, you cannot use netdom. ...
    (microsoft.public.win2000.active_directory)
  • Re: Finding users in local admin groups
    ... > Here is a vbscript that you can run against a remote computer that moves ... > *local* users except 'Administrator) from the Administrators group to the ... You should also add to the script logging to a file of the ... > you moved on what computers. ...
    (microsoft.public.win2000.security)