Remote DOS batch file to be executed locally

Closed
iaw1978 Posts 1 Registration date Thursday October 30, 2008 Status Member Last seen October 31, 2008 - Oct 31, 2008 at 01:19 PM
 aardvark_65 - Nov 5, 2008 at 08:59 AM
Hello,

I've run into a situation where I have a batch file stored on server (on the E:\reports\ of the server), which is shared mapped on each workstation as R:\ ... in this folder I have a batch file I've created which I want to be executed on the workstation which executes it, however when I execute the batch file remotely, it is executed as though it is being executed locally on the server ... for example, batch file is executed:

cd C:\Program Files\SomeDir
report.exe

so when it tries to execute cd C:\Program Files\SomeDir, it does this on the server, rather than on the workstation, then report.exe is unrecognized because this doesn't exist on the server and is supposed to be executed on the workstation ... is there a way to execute these commands on the workstation even though the batch files resides on the server?

Thanks!
Related:

1 response

You need to change the current drive to C: in the batch file, i.e.

C:
cd "\program files\somedir"
report.exe

The command "cd c:\program files\somedir" changes the current directory on c:, but leaves the current drive (r:) unchanged. Hence it is trying to run reports.exe from r:
0