473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

VB Script - Unable to launch apps

BezerkRogue
I have created a VB Script to synchronize software versions and then launch an application on the system it is run against. The script runs and generates no errors but will not launch the second application. The application name is dynamic and is selected from table. WScript.Echo verifies that it is calling the correct application and the path statement is correct. Also the application does reside where I am calling it from.

The code calling the second application generates no errors. I am at a loss. Here is the script:

Expand|Select|Wrap|Line Numbers
  1. ' VBScript File for synchronizing error proofing applications and launching the correct EP application on station start up.
  2.  
  3. 'Error handling
  4. On error resume next
  5.  
  6. 'Create variables
  7.  
  8. Dim objShell 'WScript Shell object
  9. Dim strReg1  'StationName
  10. Dim objConn  'Database Connection
  11. Dim strSQL   'SQL Command String
  12. Dim objRec   'Recordset
  13. Dim strConn     'Connection String
  14.  
  15. 'Decalare and open connection string and recordset and set objects
  16. Set objConn = CreateObject("ADODB.Connection")
  17. strConn="Provider=SQLOLEDB; Data Source=SomeServer;" & _
  18.         "Trusted_Connection=Yes;Database=SomeDB;" & _
  19.              "UID=SomeUID; PWD=XXXXXX;"
  20.  
  21. Set objRec = CreateObject("ADODB.Recordset")
  22. Set objRec1 = CreateObject("ADODB.Recordset")
  23. Set objShell = WScript.CreateObject("Wscript.Shell")
  24.  
  25. 'Declare File and Reg variables
  26.  
  27. strReg1 = "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Error Proofing Station\Properties\StationName"
  28.  
  29. 'Declare variable for database records by reading registry values into recordset.
  30. Dim rec1
  31.  
  32. rec1 = objShell.RegRead(strReg1)
  33.  
  34. If rec1 = "" then
  35.     strReg1 = "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Prepick Error Proofing Station\Properties\StationName"
  36.     rec1 = objShell.RegRead(strReg1)
  37. End If
  38.  
  39. 'Declare SQL Statements
  40. strSQL = "Select * from EPApps where StaName ='" & rec1 &"'"
  41. objRec.Open strSQL, strConn
  42.  
  43. 'Launch Synctoy App
  44. Dim WShell
  45. Set WShell = WScript.CreateObject("WScript.Shell")
  46. WShell.Run "C:\SyncToy\SyncToy.exe -R"
  47. Wscript.Sleep 5000
  48. WShell.Run "C:\Program Files\OnlineErrorProofing\" & objRec.fields(2).value
  49.  
Jul 10 '08 #1
1 1633
I figured it out. Switched to the EXEC method and it runs perfectly.
Jul 10 '08 #2

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

Similar topics

3
by: Joe Cybernet | last post by:
people keep interrupting my script by pressing their Stop buttons. how can I prevent?
8
by: Bob Bedford | last post by:
I've a script that must "launch" an other script on some situations. firstscript.php: .... If ($newarticle) //launch secondscript.php .... The "secondscript.php" may take quite long, and is...
0
by: akantrowitz | last post by:
I have a suite of winforms applications. In addition i would like a model where i can easily deploy new apps. I would like to build some type of launch pad application where i can dynamically...
7
by: Christopher C | last post by:
I am using a C# winform to launch some apps for our students. Basically the user hits a button the form hides and the app is launched. When the app exits, the form is unhidden. I have a question on...
2
by: TM | last post by:
When I run an ASP.Net application I am getting the following error: "Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged."...
2
by: kimonp | last post by:
I am running on windows XP with a fresh install of wamp5 (1.7.2) and mediawiki. I am trying to call a perl function from within php using proc_open. The perl script is being executed and...
4
by: \\ | last post by:
Hello, I would like to use php - apache to work as a solution for a kiosk that has to be managed from a remote client. I have obtained the pc shutdown with a system() call, and now I would like...
8
by: r0g | last post by:
Hi There, I'm trying to migrate a locally hosted page from windows to a private Ubuntu development server and one of the key bits of functionality (which used to work fine in Windows) was the...
6
by: tempnode | last post by:
I have a problem that I can't seem to solve: I need to write a C++ app that will run off of a floppy. Basically, I will boot into DOS (from a floppy), and run my executable from the floppy. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.