[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

batch file running remotely

Posted on 2014-04-24
6
Medium Priority
?
594 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 71

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

656 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