Search : in
By :

Remote DOS batch file to be executed locally

Last answer on Nov 5, 2008 1:59:27 pm GMT iaw1978, on Oct 31, 2008 5:19:53 pm GMT 
 Report this message to moderators

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!

Configuration: Windows XP

Best answers for « Remote DOS batch file to be executed locally » in :
Batch file ShowBatch file Settings File Creation DOS is integrated in windows which allow to exploit functionality and command sequence in a script. A batch file is a text file which contains command to be read by DOS. This file can be launched...
[Batch File]Time based actions Show[Batch File]Time based actions Issue Solution Issue Upon creating a batch file you want that certain line of batch file is executed after every second (not all the program only certain line). In VB we can do it using the Timer...
Batch file – Get Filenames & Timestamps ShowBatch file – Get Filenames & Timestamps Issue Solution Note Issue Can anyone help me create a batch file that will display all the files, subfolders and files under subfolders of folder with both date created and date modified then...
MS DOS Files and directories ShowFiles in MS DOS In a computers data is stored in files. When you run a program, MS-DOS processes the data stored in the file and passes it to the system. In MS-DOS a file can be any size, however the file name is more restricted, it can only have...

1

 aardvark_65, on Nov 5, 2008 1:59:27 pm GMT
  • +1

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:

Reply to aardvark_65