Avatar of bibi92
bibi92Flag for France

asked on 

Remove single quote on variable

Hello

when I try to execute 

setlocal EnableDelayedExpansion
set Sname=SRVTEST\TEST
set inst=%sname:*\=%
echo %instance%
set code=echo "%inst:~0,3%"
echo %code%
set file="%code%_extract.sql"
echo %file%

sqlcmd -E -S SRVTEST\TEST -i \\share.com\adservers\So_SRV\Microsoft\SQL\extract\extract_logins.sql -o \\share.com\adservers\So_SRV\Microsoft\SQL\extract\%file%

Below error is returned 

Sqlcmd: 'ARG_extract.sql"': Unexpected argument. Enter '-?' for help.


How to resolve it ?


Thank you


Regards 

Windows OSWindows Batch

Avatar of undefined
Last Comment
ste5an
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Blurred text
THIS SOLUTION IS 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
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo