By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

To run an application using VB script

P: 1
Hi there
I want to run an application (say BegUI). I tried to open the script conf.vbs as below
Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.run("BegUI.exe") Or ObjShell.run("FullPath")
Set ObjShell=Nothing
But it says that file not found in line 2.

I confirmed that is the right path. I tried to run it from Start->Run->Full Path of BegUI.exe. It has been executed well. When I double click the application file, it works fine.
The problem here is it is not executed when I run using above script.

Note: BegUI is an windows application. This application is an User Interface Application.When you double click the exe, It displays just small menu window as you see when u right click any file. So My guess is I'm not recognizing the correct format or file.

Can anybody help me runinng the above script giving me some suggestions?

Thanks
Nov 14 '06 #1
Share this Question
Share on Google+
7 Replies


Expert 5K+
P: 8,434
I'm not personally familiar with VBscript. Can someone tell me - does it run in a "sandbox"? Only, I wonder whether it is restricted in some way from running the program.
Nov 14 '06 #2

P: 69
Try something like :
---------------------------------------------
Dim p_ID

Dim FullPath As String

FullPath="C:\<prog_path>\BegUI.exe"

p_ID = Shell(FullPath,1)

---------------------------------------------

now you can manage BegUI.exe using p_ID (task identifier), like this:

AppActivate p_ID
Application.SendKeys "%{F4}", True ' close BegUI.exe

I think what you tried didn't work 'cause BegUI.exe is not the Win cmd shell ,
use .Run to execute shell commands .


Hi there
I want to run an application (say BegUI). I tried to open the script conf.vbs as below
Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.run("BegUI.exe") Or ObjShell.run("FullPath")
Set ObjShell=Nothing
But it says that file not found in line 2.

I confirmed that is the right path. I tried to run it from Start->Run->Full Path of BegUI.exe. It has been executed well. When I double click the application file, it works fine.
The problem here is it is not executed when I run using above script.

Note: BegUI is an windows application. This application is an User Interface Application.When you double click the exe, It displays just small menu window as you see when u right click any file. So My guess is I'm not recognizing the correct format or file.

Can anybody help me runinng the above script giving me some suggestions?

Thanks
Jan 8 '07 #3

P: 1
Instead of ObjShell.run("BegUI.exe")
try
ObjShell.exec("BegUI.exe")

Shell.Exec command provides additional capability beyond the Shell.Run method. These abilities include:
* Improved environment variable passing
* Ability to access the standard streams of the executable
Aug 6 '07 #4

P: 1
Instead of ObjShell.run("BegUI.exe")
try
ObjShell.exec("BegUI.exe")

Shell.Exec command provides additional capability beyond the Shell.Run method. These abilities include:
* Improved environment variable passing
* Ability to access the standard streams of the executable
I searched high and low to find out how to run Flash Media Encoder from my script.
This solution worked great. Thanks windson!!!
Oct 24 '07 #5

P: 28
Thanks guys, I have been looking all over for this. I used a script with the code below to start winrar.

Set objShell = WScript.CreateObject("WScript.Shell")
ObjShell.exec("F:\Program Files\WinRAR\Winrar.exe")
Set ObjShell=Nothing

Is it possible to add parameters such as the target and source folders for an unzip operation such that I can automate Winrar using the script?
Feb 11 '12 #6

Guido Geurs
Expert 100+
P: 767
You must open a shell and follow the rules for the commandline of the program.
for Winzip it's= program command ZIPfile Folder
(command for extract => -e)

Expand|Select|Wrap|Line Numbers
  1. 'Calling unzip function
  2. Set WshShell = WScript.CreateObject("WScript.Shell")
  3. WshShell.Run  """C:\Program Files\WinZip\WZUNZIP.EXE""" & " -e " & """E:\xfer4\DDAP.SPRD.JCH.E.zip""" & " " & """E:\xfer4"""
This will extract all the files from E:\xfer4\DDAP.SPRD.JCH.E.zip to E:\xfer4
Feb 11 '12 #7

P: 28
@Guido Geurs
Tghank you so much Guido. It worked. I really appreciate it
Feb 12 '12 #8

Post your reply

Sign in to post your reply or Sign up for a free account.