1
어제도 어떤 이유로 작동했지만 오늘은 작동하지 않습니다. 나는 그것의 코드가 아니라 외부적인 문제라고 생각한다.이것을 줄일 수 있습니까? vb.net에서 프로세스를 만들었습니다. 4 번만 호출해야합니다.
어쨌든
Dim virtualFolder As String = "~/Scripts/"
Dim physicalFolder As String = Server.MapPath(virtualFolder)
Dim unixLogin As String = (USERNAME & "@" & COMPUTERNAME & ":" & UNIXSCRIPTNAME)
' Send file to Unix server via pscp
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo = New ProcessStartInfo("C:\Windows\System32\cmd.exe")
'MsgBox("/C C:\pscp.exe -pw " & PASSWORD & " " & physicalFolder & "\" & UNIXSCRIPTNAME & " " & unixLogin)
Proc.StartInfo.Arguments = "C:\pscp.exe -pw " & PASSWORD & " " & physicalFolder & "\" & UNIXSCRIPTNAME & " " & USERNAME & "@" & COMPUTERNAME & ":" & UNIXSCRIPTNAME
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.UseShellExecute = False
'Proc.StartInfo.CreateNoWindow = True
Proc.Start()
' Allows script to execute sequentially instead of simultaneously
Proc.WaitForExit()
' Make file executable
Proc.StartInfo = New ProcessStartInfo("C:\plink.exe")
'MsgBox("-ssh -pw " & PASSWORD & " " & USERNAME & "@" & COMPUTERNAME & " chmod u+x ./" & UNIXSCRIPTNAME)
Proc.StartInfo.Arguments = "-ssh -pw " & PASSWORD & " " & USERNAME & "@" & COMPUTERNAME & " chmod u+x ./" & UNIXSCRIPTNAME
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.UseShellExecute = False
' Proc.StartInfo.CreateNoWindow = True
Proc.Start()
Proc.WaitForExit()
' Execute File
Proc.StartInfo = New ProcessStartInfo("C:\plink.exe")
Proc.StartInfo.Arguments = "-ssh -pw " & PASSWORD & " " & USERNAME & "@" & COMPUTERNAME & " ./" & UNIXSCRIPTNAME
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.UseShellExecute = False
'Proc.StartInfo.CreateNoWindow = True
Proc.Start()
Proc.WaitForExit()
' Remove File
Proc.StartInfo = New ProcessStartInfo("C:\plink.exe")
Proc.StartInfo.Arguments = "-ssh -pw " & PASSWORD & " " & USERNAME & "@" & COMPUTERNAME & " rm ./" & UNIXSCRIPTNAME
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.UseShellExecute = False
'Proc.StartInfo.CreateNoWindow = True
Proc.Start()
Proc.WaitForExit()
이 단축 될 수 있는가? 나는 ... 유닉스 시스템 2) 만들기에 파일을 전송 1) 실행 3) 삭제 파일 (해당 스크립트) 4) 실행 후
내가 다시 주석하지 않은 죄송합니다. 나는 내일 직장에서 이것을보고 다시보고 할 것이다. – envinyater
@envinyater 문제가없는 경우 알려주십시오. –
매우 성공적이었습니다. 고맙습니다! – envinyater