Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Batch File to run an exe local on a workstation

Posted on 2011-03-04
8
Medium Priority
?
503 Views
Last Modified: 2012-05-11
I need help creating a bat file that will run an exe file on the end users local machine where the bat file is stored on a network driive. See example below:

Network drive is mapped to "M". bat file resides on mapped drive...  (m:\name.bat)

When the bat file is run, it needs to run an exe on the local users machine (c:\program files\software\program.exe)

I cannot seem to make this work using the START or CMD commands in the bat file.

Please help
0
Comment
Question by:blkstrim
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 3

Expert Comment

by:pasolo
ID: 35038504
It will always run on the local machine.
You need PSEXEC from SysInternals
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35038528
start /wait /b First.exe


so

in your batch files copy and paste:

@ECHO OFF
net use M: \\{mapped drive path}
start /wait /b C:\Progra~1\software\program.exe
@ECHO ON
0
 
LVL 8

Expert Comment

by:dkumar82
ID: 35038542
In batch file Just type below and test

--

cd \

c:

cd %systemdrive%"\Program Files"

program.exe
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 10

Accepted Solution

by:
Martin_J_Parker earned 2000 total points
ID: 35038545
All your batch file should need is the following line:cmd /c "C:\Program Files\software\program.exe"

Note that the command has to be quoted because there is a space in "Program Files"

Make sure that you use notepad or wordpad to create it and not Microsoft Word or it will contain crap characters which Batch won't understand.
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
ID: 35038560
Did you mean that the batch file itself isn't actually being run on the user's machine?
0
 

Author Comment

by:blkstrim
ID: 35038579
the batch file is being run from the network drive within a windows explorer window.
0
 
LVL 3

Expert Comment

by:pasolo
ID: 35038626
Nah, it is not possible to launch a process on a remote machine that way.
You need to launch a service on it which will launch the batch file. Hence you need PsExec, or other remore access software, like AWRC to launch a remote process
0
 

Author Closing Comment

by:blkstrim
ID: 35038663
this was what i needed. worked great
0

Featured Post

Ready for your healthcare security check-up?

In the past few years, healthcare organizations have become a prime target for advanced attacks. Does your organization have what it needs to defend itself? Schedule your healthcare security check-up today and download our free Healthcare Security Resource Kit today!

Question has a verified solution.

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

Ready to get certified? Check out some courses that help you prepare for third-party exams.
When you put your credit card number into a website for an online transaction, surely you know to look for signs of a secure website such as the padlock icon in the web browser or the green address bar.  This is one way to protect yourself from oth…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

885 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