Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Batch File to run an exe local on a workstation

Posted on 2011-03-04
8
Medium Priority
?
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

Question has a verified solution.

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

There’s a movement in Information Technology (IT), and while it’s hard to define, it is gaining momentum. Some call it “stream-lined IT;” others call it “thin-model IT.”
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
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…

721 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