|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Save your reputation with your customers. Learn how you can have embedding success with Advantage Database Server (ADS). |
|
#1
|
|||
|
|||
|
batch or vb script with parameter from command line
I want to create a script that will execute a program that takes parameters.
This script needs to be executed from the win command line passing the parameter that will be used inside ie:> c:\runvb.vbs parameter or c:\runbat.bat parameter then inside, say for example the VB script (runvb.vbs) 'Create the object Set WshShell = WScript.CreateObject("WScript.Shell") 'Execute the Windows command ReturnCode = WshShell.Run("c:\exec.exe -p'parameter' ", 1, True) or however it would be done either using a batch or vbs or some executable Any Ideas??? |
|
#2
|
|||
|
|||
|
Sorry!!
I put this in the wrong forum, could the moderator please move it?? |
|
#3
|
|||
|
|||
|
Dim ArgObj, var1,cmd,var2
Set ArgObj = WScript.Arguments Set WshShell = WScript.CreateObject("WScript.Shell") var1 = ArgObj(0) var2 = ArgObj(1) if var1 = 1 then cmd = "C:\cssmtp.exe -r"& var2 " else cmd = "C:\cssmtp.exe -r"& var2 & " otherstuff" end if ReturnCode = WshShell.Run(cmd, 1, True) got it, if anyone is interested .sorry again |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > batch or vb script with parameter from command line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|