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"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.