Reputation: 484
I am trying to run a startup task cmd-script on a Windows Azure Role.
This are the two lines of the command file script:
powershell $command = "set-executionpolicy Unrestricted"
powershell $command = ".\setupAgent.ps1" -NonInteractive >; out.txt
Now the problem is, I get an error message from the command shell, that says:
D:\Users\UserAccount>powershell $command = "set-executionpolicy Unrestricted"
'powershell' is not recognized as an internal or external command,
operable program or batch file.
It looks like there are used some kind of different codepages or something linke that, because these special chars are not in my cmd file. The cmd-file was created on Windows 8 via VS 2012 Ultimate.
Do you have an idea, how I can dismiss there special chars at the beginning of the command? If I copy the command from the cmd-file to the console via remote desktop it works fine!
Upvotes: 5
Views: 976
Reputation: 30903
Open your whatever.cmd
file with your VS 2012 Ultimate. Click on File
->Save whatever.cmd as
-> on the dialog there is little arrow next to the [save]
button. It will show up a menu that will have the option Save with Encoding
:
Select it. Now choose "US-ASCII Codepage 20127" from the list of available encodings.
Upvotes: 8