Login | |
|
 |
Calling an executable with parameters - 12/3/2007 4:41:58 AM
|
|
 |
|
| |
pblecha
Posts: 4
Score: 0
Joined: 11/6/2007
Status: offline
|
I'm writing a script that will call an executable and run it with passed in parameters. However, I can't get it to run correctly. Any ideas? Here is the script: dim fcObject, fileCollection, fcListString, fileName, fileExt, bpaOutputName, subVarOutputName set fcObject = createobject("scripting.filesystemobject") set WshShell = wscript.createobject("wscript.shell") set fileCollection = fcObject.Drives("C:").RootFolder.subfolders("templates").files for each file in fileCollection fileName = fcObject.GetBaseName(file) fileExt = fcObject.GetExtensionName(file) bpaOutputName = fileName & "_bpa." & fileExt subVarOutputName = fileName & "_subvar." & fileExt if fileExt = "xml" then msgbox("""C:\Program Files\ConfigMgr 2007 Toolkit\DCM Tools\BPAtoDCM.exe /nologo /scope Microsoft.Sample c:\templates\""" & file.Name & """ c:\templates\""" & bpaOutputName & """) wshshell.run """C:\Program Files\ConfigMgr 2007 Toolkit\DCM Tools\BPAtoDCM.exe /nologo /scope Microsoft.Sample c:\templates\"" & file.Name & "" c:\templates\"" & bpaOutputName", 7, true wshshell.run """C:\Program Files\ConfigMgr 2007 Toolkit\DCM Tools\DCMSubVar.exe """ & bpaOutputName & """ """ & subVarOutputName, 7, true msgbox("Processing complete: " & file.Name) end if next
|
|
| |
|
|
|
 |
RE: Calling an executable with parameters - 12/3/2007 4:49:01 AM
|
|
 |
|
| |
dm_4ever
Posts: 2663
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
If you take the string this outputs msgbox("""C:\Program Files\ConfigMgr 2007 Toolkit\DCM Tools\BPAtoDCM.exe /nologo /scope Microsoft.Sample c:\templates\""" & file.Name & """ c:\templates\""" & bpaOutputName & """) Does it work? ...and I mean exactly as it appears in that msgbox...not what you know it should be...change it to an input box and set it as the default value so you can easily copy and paste it
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|