Solved

batch file running remotely

Posted on 2014-04-24
6
572 Views
Last Modified: 2014-04-24
Hi: I have a batch file on a server that reads:
"c:\mapsuploader\mapsuploader.exe R:\data\deliveries\mapper.csv"
The point being that it points at the local (TO THE SERVER) C Drive.
I want to run this from a PC on the network (by wrapping it into a program such as foxpro); but it appears to be identifying the C drive as that on the pc, not the server.
Does anybody know - without vpn or similar - how a batch file can be executed as though on that machine?
THe alternative would be to schedule the thing to run on the server every 2 mins but that seems a tad excessive.
Thanks!
0
Comment
Question by:ClaytonGlass
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Assisted Solution

by:stergium
stergium earned 100 total points
ID: 40019976
Hello.
You can do that with psexec from sysinternals
http://technet.microsoft.com/el-gr/sysinternals/bb897553.aspx

psexec  \\computer c:\thatbatchfile.bat  
note that the batch file should be in the remote system you are trying to run.

i hope that helps
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 100 total points
ID: 40019992
Also note that the R: drive might be a mapped drive - and as such not available with PsExec. If it is a network share, use the UNC path instead, and make sure the PsExec account has access to the UNC path.

Depending on the batch file you might not need to run it on the server; instead, create a network share for c:\mapsuploader\ (say \\server\mapsuploader), and run the batch file on the PC with
pushd \\server\mapsuploader
mapsuploader \\server\r\data\deliveries\mapper.csv
popd

Open in new window

0
 
LVL 13

Expert Comment

by:stergium
ID: 40020009
shouldnt this

pushd \\server\mapsuploader
mapsuploader \\server\r\data\deliveries\mapper.csv
popd

Open in new window


be like this ?
pushd \\server\mapsuploader
mapsuploader \\server\r$\data\deliveries\mapper.csv
popd

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:ClaytonGlass
ID: 40020012
Thank you very much to you both! Was reading about psexec when qlemo replied so giving points to both. Thanks again.
0
 
LVL 16

Expert Comment

by:gurutc
ID: 40020021
Also, if you have UAC enabled on the remote system, you'll have to elevate psexec.

use the -h option as in:

psexec -h \\remotesystem batchfile.bat

- gurutc
0
 
LVL 16

Expert Comment

by:gurutc
ID: 40020028
And I forgot you also need to include the Accept the Eula command to keep the remote system from not running your command due to the eula popup not being accepted:

psexec -h -accepteula \\remotesystem batchfile.bat

- gurutc
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question