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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shutdown Script Help - Executing a remote file

Status
Not open for further replies.

drweb

IS-IT--Management
Apr 17, 2002
26
US
All,
I have ran myself into a road block and can't google my way out of this one.
I am creating a very simple shutdown script that I can put into my group policy using MS utility DelProf.exebut cannot seem to think of a method of running this off a server using common variables.

This is my simple code so far:
Option Explicit
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "\\somedc1\netlogon\files\delprof /Q /I /R /C:\\%computername%"

I wan't to deploy this across the enterprise (4 geographic locations) but do not wan't it to alway have to go to \\somedc1 to run the file. Is there some kind of equivalent of %logonserver% variable when nobody is logged on.


Thanks,
Clay
 
All,
I think I figured it out, atleast it tested ok for now.

New Code:
Option Explicit
On Error Resume Next
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.CurrentDirectory =
"\\mydomain.com\SYSVOL\mydomain.com\scripts\Contact Centers\Files\"
objShell.Run("delprof.exe /Q /I /R /C:\\%computername%")


I will be running this very wide scaled and would like any feedback on
any issues I might encounter.


Thanks,
Clay


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top