hi guys!
have any problem with my vbs. this is the code:
Dim fso, SourceFolder, wshShell
Set fso = CreateObject("Scripting.FileSystemObject")
SourceFolder = "C:\Tools\PsTools"
Set ReadFile = fspenTextFile("C:\Tools\PsTools\elencoserver.txt")
If (fso.fileexists("C:\Tools\PsTools\Check.log")) then
Set LogFile = fspenTextFile("C:\Tools\PsTools\Check.log",8)
Else
Set LogFile = fso.CreateTextFile("C:\Tools\PsTools\Check.log", TRUE)
End If
Set wshShell = WScript.CreateObject ("WScript.Shell")
wshShell.run "CMD /C C:\Tools\PsTools\psexec @eserverlist.txt -c remdir.bat"
Do while Not LeggiFile.AtEndOfStream
CurrentServer = ReadFile.ReadLine
If Err.Number <> 0 then
LogFile.WriteLine (CurrentServer & " Error!")
Err.clear
End if
Loop
Set wshShell = Nothing
Set fso = Nothing
I'd like that it runs, launch remdir.bat (delete some folders), write on check.log results, and if there is an error, it write "Server XXX Error!".
Now it runs, del folders but the check.log is empty...
please can you help me??
sorry for my ugly english..
Tks a lot!!!
have any problem with my vbs. this is the code:
Dim fso, SourceFolder, wshShell
Set fso = CreateObject("Scripting.FileSystemObject")
SourceFolder = "C:\Tools\PsTools"
Set ReadFile = fspenTextFile("C:\Tools\PsTools\elencoserver.txt")
If (fso.fileexists("C:\Tools\PsTools\Check.log")) then
Set LogFile = fspenTextFile("C:\Tools\PsTools\Check.log",8)
Else
Set LogFile = fso.CreateTextFile("C:\Tools\PsTools\Check.log", TRUE)
End If
Set wshShell = WScript.CreateObject ("WScript.Shell")
wshShell.run "CMD /C C:\Tools\PsTools\psexec @eserverlist.txt -c remdir.bat"
Do while Not LeggiFile.AtEndOfStream
CurrentServer = ReadFile.ReadLine
If Err.Number <> 0 then
LogFile.WriteLine (CurrentServer & " Error!")
Err.clear
End if
Loop
Set wshShell = Nothing
Set fso = Nothing
I'd like that it runs, launch remdir.bat (delete some folders), write on check.log results, and if there is an error, it write "Server XXX Error!".
Now it runs, del folders but the check.log is empty...
please can you help me??
sorry for my ugly english..
Tks a lot!!!