Solved

Batch File to run an exe local on a workstation

Posted on 2011-03-04
8
492 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
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
different catridges 8 89
Administrator Tools 2 70
Exchange 2013 connect outlook 2013 certificat problem alert 3 53
Event ID: 7016 / Source: Microsoft-Windows-GroupPolicy 7 97
Not many admins are aware that GPOs can be activated and deactivated time-based. Time to change that :)
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

8 Experts available now in Live!

Get 1:1 Help Now