Solved

Batch File to run an exe local on a workstation

Posted on 2011-03-04
8
495 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 10

Accepted Solution

by:
Martin_J_Parker earned 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Both MMF (multi-mode fiber) and SMF (single-mode fiber) are types of optical fiber that can aid in communication applications. These thin strands of silica or glass will allow communication to occur between devices. The transmission of light between…
There's a better way to communicate time sensitive or critical info.
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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