0

I am trying to run a powershell script from a batch file but is not working. the bat file looks like:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command “. ‘S:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.psc1'; Connect-ExchangeServer -auto; S:\Scripts\EnableTransportRuleWest.ps1"

the error when I ran the bat file is:

the string starting: at line:1 char:75
* . S:\Program files[snip] is missing the terminator '. at line:1 char:146

I do not see what's missing, any idea?

0

1 Answer 1

2

Did you copy this command line from a blog? You've "smart" quotes in there.

With normal double/single quotes:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'S:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.psc1'; Connect-ExchangeServer -auto; S:\Scripts\EnableTransportRuleWest.ps1"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.