How do I change a call from local path to a network share on a batch file?

I have the following batch file. I would like the batch file to change the local source "cd "C:\Program Files\SMS 2003 Toolkit 2" TranGuid.exe /r " 

to be a network share like this one "\\server\share\TranGuid.exe /r " 

How do I do that?

Thanks.
 

cd "C:\Program Files\SMS 2003 Toolkit 2" TranGuid.exe /r 
net stop ccmexec 
net start ccmexec

Open in new window

llaravaAsked:
Who is Participating?
 
JohnLoConnect With a Mentor Commented:
Dos does not support UNC eg \\server so you have to map a network drive to the server path then change it to that.
0
 
llaravaAuthor Commented:
Would VBS support UNC. If it does could somone help out to translate the script to vbs.
0
 
HainKurtSr. System AnalystCommented:
what does this do?

cd "C:\Program Files\SMS 2003 Toolkit 2" TranGuid.exe /r
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
HainKurtSr. System AnalystCommented:
or is it this?
cd "C:\Program Files\SMS 2003 Toolkit 2"
TranGuid.exe /r 
net stop ccmexec 
net start ccmexec

Open in new window

0
 
HainKurtConnect With a Mentor Sr. System AnalystCommented:
maybe this
net use x: /delete
net use x: \\server\share\
x:
TranGuid.exe /r 
net stop ccmexec 
net start ccmexec
net use x: /delete

Open in new window

0
 
llaravaAuthor Commented:

We run a script (vbs) that calls this batch file

If Not (filesys.FileExists("c:\TranGuid\TranGuid.txt")) Then  
WSHShell.Run "TranGuid.bat"  
Set filetxt = filesys.CreateTextFile("c:\TranGuid\TranGuid.txt", True)  
End If  

The batch file basically executes TranGuid.exe /r which is currently placed locally on some computers and the then stops and starts a windows service.  

We would like not to have to have the file deployed locally to the computers and we want to call it from a network share.

If we translate the batch file to a vbs we could use a UNC patch and we could also attached the code to the main VBS script withouth having to do any external calls.


0
 
llaravaAuthor Commented:
All right this worked. Here is the question at this point, is there any way to hide the cmdshell screen (cmd.exe) so the user doesn't see the black window with whatever that is being executed. (Notice that this is going to be part of the logon script)

objShell.Run "\\server\NETLOGON\tranguid.exe", 1, True
objShell.Run "net Stop ccmexec", 1, True
Wscript.Sleep intShortSleep
objShell.Run "net Start ccmexec", 1, True

Set objShell = CreateObject("WScript.Shell") 
Set objFSO = CreateObject("Scripting.FileSystemObject") 
strRegFile = "\\server\NETLOGON\tranguid /r.exe"
Dim intShortSleep

' Values set
intShortSleep = 3000
  
objShell.Run "\\server\NETLOGON\tranguid.exe", 1, True
objShell.Run "net Stop ccmexec", 1, True
Wscript.Sleep intShortSleep
objShell.Run "net Start ccmexec", 1, True

Open in new window

0
 
llaravaAuthor Commented:
I will close it and open a new question.

Thanks everyone.
0
 
HainKurtSr. System AnalystCommented:
run it with 0

objShell.Run "net Stop ccmexec", 0, True

http://msdn.microsoft.com/en-us/library/d5fk67ky(VS.85).aspx
0
 
llaravaAuthor Commented:
It worked. Thanks!
0
All Courses

From novice to tech pro — start learning today.