[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

running .exe in windows scripting host

Posted on 2006-04-25
2
Medium Priority
?
201 Views
Last Modified: 2010-04-07
Hi,

I have this code to run .exe using Windows scripting host. I am getting this error "The system cant find the file specified."
Is the code right?  I am new to WSH.  I have run the same exe before and the path is correct. arg1 is the argument that needs to be passed to test.exe.   Please help. Thank you.

Dim shell
Dim quote
Dim pgm
Dim arg
set shell = WScript.CreateObject("WScript.Shell")
quote = Chr(34)
pgm = "C:\test\bin\Debug\test.exe"
arg = "arg1"
shell.Run quote & pgm & " " & arg


0
Comment
Question by:engg
2 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 2000 total points
ID: 16537188
Try

shell.Run quote & pgm &  quote & " " & arg
0
 

Author Comment

by:engg
ID: 16539516
Thanks EDDYKT for ur prompt reply.  It worked. Sorry for taking time to get back to u!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

834 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