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
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.
It will always run on the local machine.
You need PSEXEC from SysInternals
start /wait /b First.exe


in your batch files copy and paste:

net use M: \\{mapped drive path}
start /wait /b C:\Progra~1\software\program.exe
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!

In batch file Just type below and test


cd \


cd %systemdrive%"\Program Files"

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