2014-10-11 8 views
4

에서 zip 파일을 만들기 내가 암호다음은 SQL 서버

DECLARE @source VARCHAR(1000), 
     @destination VARCHAR(1000), 
     @Command VARCHAR(1000) 

SET @source = 'E:\Temp\testRar.txt' 
SET @destination = 'E:\Temp\testRar.rar' 

SET @Command = '"C:\Program Files\WinRAR\Rar.exe" a -ep1 -pasd^ad ' [email protected]+' '[email protected] 

EXEC MASTER..xp_cmdshell @Command 

.rar 파일을 만드는 데 사용하는 코드는하지만 asdad 비밀번호하지 asd^ad, ^ 기호는 무시됩니다를 설정합니다. 왜?

답변

2

^문자는 명령 셸에서 이스케이프 문자입니다. 그것을 두 배로 시험해보십시오.

SET @Command = '"C:\Program Files\WinRAR\Rar.exe" a -ep1 -pasd^^ad ' [email protected]+' '[email protected] 
+0

나는 같은 결과를 얻습니다. – tungula

+0

@ 곰팡이를 두 번 시도해 봤습니까 ^? – Donal

+0

'' "C : \ Program Files \ WinRAR \ Rar.exe"-ep1 -pasd "^"ad "'? – BartekR