Har löst det... Kanske inte det enklaste men men.
Citat:
Dim väg As String = "C:\WINDOWS\system\home.vbs"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objFileSystem, objOutputFile
objFileSystem = CreateObject("Scripting.fileSystemObject")
objOutputFile = objFileSystem.CreateTextFile(väg, True)
objOutputFile.WriteLine("Dim Shell")
objOutputFile.WriteLine("Set Shell = WScript.CreateObject(""WScript.Shell"")")
objOutputFile.WriteLine("Set oIE = CreateObject(""InternetExplorer.Application"")")
objOutputFile.WriteLine("")
objOutputFile.WriteLine("Shell.RegWrite ""HKCU\Software\Microsoft\Internet Explorer\Main\Start Page"", """ & homepage.Text & """")
objOutputFile.WriteLine("")
objOutputFile.WriteLine("oIE.navigate Shell.RegRead(""HKCU\Software\Microsoft\Internet Explorer\Main\Start Page"")")
objOutputFile.WriteLine("oIE.visible=1")
objOutputFile.close()
Dim WSHShell
WSHShell = CreateObject("WScript.shell")
WSHShell.Run(väg)
End Sub
|