Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I run programs serially using vbscript? 3

Status
Not open for further replies.

xitu

Technical User
Oct 1, 2003
55
US
I want to run p1.exe, then p2.exe and p3.exe

The following code execute p1.exe, p2.exe, p3.exe

Set objShell = CreateObject("WScript.Shell")
objShell.Run "C:\p1.exe"
objShell.Run "C:\p2.exe"
objShell.Run "C:\p3.exe"

Can anyone help, please?
Thanks,
 
To make one wait on the last, you need ,1,true as follows
Code:
Set objShell = CreateObject("WScript.Shell")
objShell.Run ("C:\p1.exe",1,true)
objShell.Run ("C:\p2.exe",1,true)
objShell.Run ("C:\p3.exe",1,true)
 
Without paraenthese would be much better.
[tt]
objShell.Run "C:\p1.exe",1,true[/tt]
etc...

- tsuji
 
It worked great. Thanks.

Is there anyway I can configure the ODBC driver by vbscript?
 
i found this.

set wsh = wscript.createObject( "WScript.Shell" )
const ODBC = "HKLM\SOFTWARE\ODBC\ODBC.INI\"


sub createODBC( sName, sServer, sDesc, sDatabase, sUser )
dim ODBCS
ODBCS = ODBC & sName & "\"
wsh.regWrite ODBC, sName
wsh.regWrite ODBC & "ODBC Data Sources\" & sName, "SQL Server"
wsh.regWrite ODBCS & "Driver", "C:\WINNT\System32\sqlsrv32.dll"
wsh.regWrite ODBCS & "Description", sDesc
wsh.regWrite ODBCS & "Server", sServer
wsh.regWrite ODBCS & "Database", sDatabase
wsh.regWrite ODBCS & "LastUser", sUser
wsh.regWrite ODBCS & "UseProcForPrepare", "0"
end sub
 
Thanks. It worked perfect except I could not write the User Name. Does anyone know?

Thanks,

'-----------------------------------------------------
set WshShell = wscript.createObject( "WScript.Shell" )
const ODBC = "HKLM\SOFTWARE\ODBC\ODBC.INI\"

sName = "Name"
sServer = "Server"
sDesc = "Description"
sUser = "UserName"


dim ODBCS
ODBCS = ODBC & sName & "\"
WshShell.regWrite ODBC, sName
WshShell.regWrite ODBC & "ODBC Data Sources\" & sName, "Microsoft ODBC for Oracle"
WshShell.regWrite ODBCS & "Driver", "C:\WINNT\System32\sqlsrv32.dll"
WshShell.regWrite ODBCS & "Description", sDesc
WshShell.regWrite ODBCS & "User Name", sUser ' Does not work
WshShell.regWrite ODBCS & "Server", sServer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top