'If File.Exists(UpdatePath) = True Then
' 'Dim 시작위치 As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup) & "\" & StartName
' 'File.Delete(시작위치)
' Dim CHK_Process As New Process()
' Dim CHK_CMD As New ProcessStartInfo
' CHK_CMD.UseShellExecute = False
' CHK_CMD.RedirectStandardOutput = True
' CHK_CMD.FileName = "cmd.exe"
' CHK_CMD.Arguments = "/c SCHTASKS /Query"
' CHK_CMD.CreateNoWindow = True
' CHK_Process.StartInfo = CHK_CMD
' CHK_Process.Start()
' '--- 기존스케줄에 등록되어있는지 확인
' Dim CMD_Output As String = ""
' Using CMD_StreamReader As System.IO.StreamReader = CHK_Process.StandardOutput
' CMD_Output = CMD_StreamReader.ReadToEnd()
' End Using
' '-- 스케줄 등록
' If InStr(CMD_Output, UpdateAppName) < 1 Then
' Dim REG_PATH As String = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\SERVICETOP"
' Dim CHK_REG As RegistryKey = Registry.LocalMachine.OpenSubKey(REG_PATH)
' Dim RUN_CMD As New ProcessStartInfo()
' RUN_CMD.Verb = "runas"
' RUN_CMD.FileName = "cmd.exe"
' RUN_CMD.Arguments = "/c SCHTASKS /Create /SC ONLOGON /TN SERVICETOP\"
' RUN_CMD.Arguments += ProgramFolder & " /TR " & Chr(34) & Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
' RUN_CMD.Arguments += "\" & ProgramFolder & "\" & UpdateAppName & ".exe" & Chr(34) & " /RL HIGHEST"
' RUN_CMD.WindowStyle = ProcessWindowStyle.Hidden
' Process.Start(RUN_CMD) '- 스케줄 등록
' End If
'End If
카테고리 없음