Question:
i am tring to convert
abc.exe /u “c:/programs/abc.dll” to powershell script can anybody explain how to do it.
how can i execute the *.exe having switches with parameters??
thanks..
Sunny
Answer:
It should be as straight forward as:
1 2 |
C:\PS> abc.exe /u c:/programs/abc.dll |
However you can run into issues with quoting and other characters that get interpreted by PowerShell. Usually quouting an argument will suffice but if that still doesn’t work you can use Start-Process in PowerShell 2.0 e.g.:
1 2 3 4 |
C:\PS> start-process abc.exe -arg @' ... '@ |
If you have PowerShell Community Extensions installed you can use a utility called echoargs.exe to troubleshoot passing args to exe’s. e.g.:
1 2 3 4 |
C:\PS> echoargs /u c:/programs/abc.dll Arg 0 is Arg 1 is |
Echoargs display the arguments exactly as the EXE sees them.