我有一些使用Putty的pscp.exe文件登錄Unix服務器的VBA代碼。我正在使用Windows 7.當用戶名包含@字符時,VBA和Putty的pscp.exe
問題是用戶名包含@字符。如果我使用以下VBA代碼,我無法登錄。
那麼,我該如何替換Username = "[email protected]"
才能登錄?
Dim Host As String
Host = "grid1.example.xxx"
Dim Username As String
Username = "[email protected]"
Dim Password As String
Password = "Password2012"
Dim Command As String
Command = "pscp.exe -sftp -l " & Username & " -pw " & Password
Shell Command, vbNormalFocus
'命令= 「pscp.exe -sftp -l -o用戶=」 &用戶名和 「-pw」 &Password' http://www.computerhope.com/unix/sftp.htm – cyboashu
@cyboashu如果我使用該代碼,我將被要求輸入'[email protected]的密碼:' – xms