954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Run Batch File using UNC

Hi

I have been looking all day trying to find a way to do this. I need to run a Batch file which is held on a server, the file path begins with a IP Address which DOS doesn't like. So i found the pushd command which assigns a temp drive letter from which you can run the Batch File.

If i was simply running a normal program or file i would use:

Dim proc As Process    
proc = Process.Start("c:\BatchFile.bat")   
proc.WaitForExit()


but my file path is e.g. \\10.10.10.1\Public\Folder\BatchFile.bat

running from a command prompt if i type

pushd \\10.10.10.1\Public\Folder\ (Enter)
BatchFile.bat

the Batch File runs fine, but i need to be able to do this from within VB.NET and the main program still needs to wait for the batch file to run and the cmd prompt to close before continuing.

Any suggestions would be excellent or if i haven't explained this well enough let me know

Thanks

STP_Captain_Slo
Newbie Poster
6 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

Why don't you create a local batch file, containing the pushd command and the batchfile and execute it locally?

adam_k
Practically a Posting Shark
803 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: