Link to home
Start Free TrialLog in
Avatar of jdana
jdanaFlag for United States of America

asked on

DOS Command Switches - Use double quotes in switch arguments?

I've been banging my head against the wall for the last two hours with a bcp call for MSSQL.

bcp MyDB.dbo.MyTable in "C:\..." -S MyServer\MyInstance -T -f "C:\MyBCPFormatFile.xml"

On a whim, I added double quotes to the argument associated with the server switch, and it worked! (Note the quotes around MyServer\MyInstance.)

bcp MyDB.dbo.MyTable in "C:\..." -S "MyServer\MyInstance" -T -f "C:\MyBCPFormatFile.xml"

Is it safe to always wrap the arguments associated with a switch (option) with double-quotes?
SOLUTION
Avatar of Trenton Knew
Trenton Knew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdana

ASKER

Thanks guys, Great feedback.

J