Batch File to run an exe local on a workstation

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
blkstrimAsked:
Who is Participating?
 
Martin_J_ParkerConnect With a Mentor Commented:
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
 
pasoloCommented:
It will always run on the local machine.
You need PSEXEC from SysInternals
0
 
rawinnlnx9Commented:
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
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
dkumar82Commented:
In batch file Just type below and test

--

cd \

c:

cd %systemdrive%"\Program Files"

program.exe
0
 
Martin_J_ParkerCommented:
Did you mean that the batch file itself isn't actually being run on the user's machine?
0
 
blkstrimAuthor Commented:
the batch file is being run from the network drive within a windows explorer window.
0
 
pasoloCommented:
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
 
blkstrimAuthor Commented:
this was what i needed. worked great
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.