Solved

batch file running remotely

Posted on 2014-04-24
6
551 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
6 Comments
 
LVL 13

Assisted Solution

by:stergium
stergium earned 100 total points
Comment Utility
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 68

Accepted Solution

by:
Qlemo earned 100 total points
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Closing Comment

by:ClaytonGlass
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now