Sign in to follow this  
Followers 0
mattfaust

quotes in command ?

2 posts in this topic

im trying to run the following command By RunWait and there is quotes in the command I do not know how to process...

please help

this is what I need piped to the command line...

sqlcmd -S KITCHENSQLEXPRESSSQLuser -P SQLpassword -Q "BACKUP DATABASE testDatabase TO DISK='C:tempBackupsql.bak'"

I have this...

$server = "Kitchen\SQLEXPRESS
$user = "SQLuser
$password = "SQLPassword"

_RunWait "sqlcmd -S "&"  -U "&"$user"&" -P "&"$password   "

im getting lost where there is a quote in the original command that needs to be passed to the command line

Share this post


Link to post
Share on other sites



Try this:

$server = "Kitchen\SQLEXPRESS"
$user = "SQLuser"
$password = "SQLPassword"

$command = "sqlcmd -S " & $server & $user & " -P " & $password & ' -Q "BACKUP DATABASE testDatabase TO DISK=' & "'C:\temp\Backupsql.bak'" & '"'

MsgBox(4096,"",$command)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0