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 :
Writing in batch in text file ShowWriting in batch in text file To write in a file text, you just have to use a redirect: echo text > output_file.txt To write in an existing file: echo " Write at the end of the file ">> output_file.txt
What is a batch file? ShowWhat is a batch file? Creating a batch file Prerequisites Create file Windows comes with a version of DOS, which allows you,exploiting the features and the sequence of commands in a script. Batch file, is a simple text file (ascii)...
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...
Download Easy File Locker ShowTo keep your privacy and secure up your data on your machine, the best way is to hide them altogether. Easy File Locker is primarily a tool to block access, modification, reading, deleting, moving or copying your files or folders. But to make...
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...
Backup ShowBackup Setting up a redundant architecture ensures that system data will be available but does not protect the data against user-introduced errors or against natural disasters such as fires, floods or even earthquakes. Therefore it is necessary to...
File sharing in Windows XP ShowAdvantages File sharing involves making the content of one or more directories available through the network. All Windows systems have standard devices making it easy to share the content of a directory. However, file sharing may lead to security...

1

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

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