Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running NoNAV on a remote machine

Status
Not open for further replies.

Boxalld

Technical User
Apr 20, 2004
42
GB
I am trying to find a way to run NONAV no a remote machine, so far i have managed to put this script together but it seems to run NoNAV on the machine you run the script on no the remote machine listed in a text file.

Const ForReading = 1

set mFso = CreateObject("Scripting.fileSystemObject")
set wshShell = CreateObject("Wscript.Shell")

strComputer = "Computer_List.txt"
Set tsfile = mFso.openTextFile (strComputer, ForReading)

'call Routine to Remove Nav
NoNav

tsfile.close

MsgBox "Nav Removed from all Machines"



'==========================================================
Sub NoNav
'==========================================================

On Error Resume Next

Do
strComputers = tsfile.ReadLine
Computer = strComputers


Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & Computer & "\root\cimv2")
Set objShell = CreateObject("WScript.Shell")
rem objShell.Run("%comspec% /c md \\" & Computer & "\NoNAV")
rem objShell.Run("%comspec% /c copy \\10.140.68.10\NoNav\*.* \\" & computer & "\NoNav")
objShell.Run(" \\" & Computer & "\NoNAV\NoNav.bat "),0,True



Loop While tsfile.AtEndoFStream = False

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top