Created
April 29, 2015 10:21
-
-
Save kayasax/8c9c37200632e324723a to your computer and use it in GitHub Desktop.
Lancer des exécutables DOS depuis powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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