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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnLoCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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
HainKurtSr. 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.