Hi, I suspect that Server2 has a problem with wmi. You can catch the error like this:
If strPingStatus = "Success" Then
on error resume next
set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
If Err.Number <> 0 Then...
Hi, this puts the output from a find in to a string, it might get you started:
msgbox getoutput("C:\WINDOWS\SYSTEM32\find.exe /i /n ""Use Path:"" c:\winzip.log")
function getoutput(app)
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
'The "app" is launched
Set oExec =...
Hi
If you would like to open / display a html file stored localy, this might work for you:
dim objExplorer
open_ie
objExplorer.Document.Body.InnerHTML = HTMLTextfile("c:\test\test.htm")...
Ah, ok. This is specific to the way your AD is set up.
Replace yourDCName with the name of your domain.
Replace xxx with net, org, com or wathever you are using.
You migth find further information there...
Hi, please use this with care. It is untested, but should put you in the right direction.
dim AD_RS
dim AD_objConn
open_ad
AD_RS.movefirst
do until AD_RS.eof
hostname = AD_RS("hostname")
onlinestat = getping(hostname)
if onlinestat = 1 then
restart(hostname)
else
end if
rs.movenext...
got it!
this example is straight from:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/folder/copyhere.asp
dim objShell
dim objFolder
set objShell = CreateObject("Shell.Application")
set objFolder =...
Just replace CopyFile with CopyFolder like so:
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFolder "C:\Test" , "C:\Test2" , OverwriteExisting
set objFSO = Nothing
Pls read...
you might want to try it with the FileSystemObject
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\Test\*.*" , "C:\Test2\" , OverwriteExisting
set objFSO = Nothing
Reference to the FileSystemObject...
you are close, try this:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='C:\test'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile in colFiles...
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.