First, this only works with DesktopX Professional.
1. Use WMI to get the command line parameters.
In the following example, my program is named backup.exe.
What is returned by objItem.CommandLine is the complete
command line, including path to the program.
example of what's returned: "C:\Program Files\Stardock\My Apps\backup.exe" parameters
Note that the path and file name are quoted.
2. Here is the script I use. You'll have to change the program it's looking for.
The variable MyCmd will contain the parameters.
Ex:
strComputer = "."
Set objWMIService = GetObject( _
"winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Process" & _
" WHERE Name = 'backup.exe'",,48)
For Each objItem In colItems
MyCmd = objItem.CommandLine
Next
x = inStr(1,MyCmd,"backup.exe",1)
If x > 0 Then
MyCmd = mid(MyCmd,x + 12)
Do While left(MyCmd,1) = " "
MyCmd = mid(MyCmd,2)
Loop
End If
3. Export your script as a gadget (.EXE)
4. Save it as "Custom Deployment"
5. Then choose the directory it is to be saved to.
6. To use it, create a shortcut to it and modify the properties of the shortcut to include the parameters you want.
That's all there is to it
It's a bit convoluted, but it does work. Unfortunately, you have to compile it to test it. It can't be tested from within DesktopX Pro.