Hello All,
this is the code I wrote. Everything works ok, just the last line does not.
I must be able to execute that command, or a similar command (like
c:\test.bat) on the remote computer. I don't understan because the regedit
file works fine. I also need to execute on the remote this command:
r:\ssllss.exe -a r: > %computername%.txt
I really need help.
Private Sub Form_Load()
Set SH = CreateObject("WScript.Shell")
Set filesys = CreateObject("Scripting.FileSystemObject")
resp = InputBox("Please write the IP address. Use dot separation.")
If resp = "" Then Unload Me
drvLtr = resp
SH.Run "net use r: \\" & drvLtr & "\c$ /persistent:YES", 0, True
'PHASE 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
objFSO.DeleteFile ("r:\winnt\system32\dllcache\os2.exe")
objFSO.DeleteFile ("r:\winnt\system32\os2.exe")
objFSO.DeleteFile ("r:\winnt\system32\dllcache\os2srv.exe")
objFSO.DeleteFile ("r:\winnt\system32\os2srv.exe")
objFSO.DeleteFile ("r:\winnt\system32\dllcache\os2ss.exe")
objFSO.DeleteFile ("r:\winnt\system32\os2ss.exe")
objFSO.DeleteFile ("r:\winnt\system32\psxss.exe")
objFSO.DeleteFile ("r:\winnt\system32\posix.exe")
objFSO.DeleteFile ("r:\winnt\system32\psxdll.dll")
objFSO.DeleteFile ("r:\winnt\system32\dllcache\netapi.dll")
objFSO.DeleteFile ("r:\winnt\system32\dllcache\netapi.os2")
objFSO.DeleteFile ("r:\winnt\system32\os2\dll\netapi.dll")
objFSO.DeleteFile ("r:\winnt\system32\os2\dll\doscalls.dll")
objFSO.DeleteFile ("r:\winnt\system32\os2\oso001.009")
'PHASE 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\baseline\baseline20.reg", "r:\baseline20.reg"
objFSO.CopyFile "C:\baseline\2000 Desktop v2.0.inf",
"r:\winnt\security\templates\2000 Desktop v2.0.inf"
objFSO.CopyFile "C:\baseline\RCERTEcustomW2KConsole.msc",
"r:\winnt\security\templates\RCERTEcustomW2KConsole.msc"
'PHASE 3
Set wmiRemote = GetObject("winmgmts://" & drvLtr & "/C$")
Set process = wmiRemote.get("win32_process")
process.Create "regedit.exe /s c:\baseline20.reg"
process.Create "c:\winnt\security\templates\RCERTEcustomW2KConsole.msc"