Skip to content

Instantly share code, notes, and snippets.

@kayasax
Created April 29, 2015 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kayasax/8c9c37200632e324723a to your computer and use it in GitHub Desktop.
Save kayasax/8c9c37200632e324723a to your computer and use it in GitHub Desktop.
Lancer des exécutables DOS depuis powershell
# running dos command with lengthy parameters may sometimes be difficult to run from powershell
# one easy step that may correct the problem is to call cmd.exe /c before calling the command :
# this will not work
# & c:\windows\handle.exe /accepteula .d1 > C:\upf\logs\backup\handle.txt
# this is OK
start-process -Wait -NoNewWindow cmd.exe "/c handle.exe .d1 > C:\upf\logs\backup\handle.txt"
# starting at PS V3.0 we can also use the escape operator : --% ( will stop powershell resolving variables except cmd ones like %computername% )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment