mattfaust 0 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 Share this post Link to post Share on other sites
michaelslamet 33 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) Share this post Link to post Share on other sites