Search code examples
powershellcmdcommand-prompt

Convert cmd to powershell query


Please help:

CMD command:

C:/abc.exe” “MyPC” /RFS “script.rfs

Please help me in converting this to powershell.

I tried to read the documentation but couldn’t find anything useful. Any sort of help will be highly appreciated. Thanks in advance.


Solution

  • Try using the call statement (alias &).

    & "C:\abc.exe" "MyPC" /RFS "script.rfs"
    

    I'm not sure about the double quotes, especially around abc.exe. It depends on what role those double quotes are playing in CMD. One of the features of the ampersand construct is that it prevents the usual parsing of parameters to the initial command.