mattfaust Posted January 20, 2014 Posted January 20, 2014 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
Solution michaelslamet Posted January 20, 2014 Solution Posted January 20, 2014 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now