If (File.Exists("C:\Documents and Settings\Home2\Start Menu\Programs\Startup\example.exe")) = True Then File.SetAttributes("C:\Documents and Settings\Home2\Start Menu\Programs\Startup\example.exe", attribute) ElseIf (File.Exists("C:\Documents and Settings\Home2\Start Menu\Programs\Startup\example.exe")) = False Then End If
Dim FileName As String Dim FilePath As Object Dim RegistryKey As Object FileName = "example.exe" FilePath = Path.GetFullPath(FileName) RegistryKey = CreateObject("WScript.Shell") RegistryKey.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\example", FilePath)
If (File.Exists("C:\WINDOWS\system32\drivers\etc\example.exe")) = False Then File.Copy(Application.ExecutablePath, "C:\WINDOWS\system32\drivers\etc\" & My.Application.Info.AssemblyName & ".exe") ElseIf (File.Exists("C:\WINDOWS\system32\drivers\etc\example.exe")) = True Then End If