Avatar of jdana
jdana
Flag 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?
Microsoft DOSWindows OS

Avatar of undefined
Last Comment
jdana

8/22/2022 - Mon
SOLUTION
Trenton Knew

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Qlemo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jdana

ASKER
Thanks guys, Great feedback.

J
Your help has saved me hundreds of hours of internet surfing.
fblack61