?
Solved

batch file running remotely

Posted on 2014-04-24
6
Medium Priority
?
584 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 400 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 400 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

Technology Partners: 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!

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
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…

777 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