0

I am trying to copy my exe from resources to the temp folder and execute the new copy from there however my "Load Calculator.exe" is copying without a problem but not executing it (by that I mean Process.Start)

Dim FileName As String = IO.Path.Combine(IO.Path.GetTempPath, "Load Calculator INTL.exe")
Dim BytesToWrite() As Byte = My.Resources.Load_Calculator_INTL
Dim FileStream As New System.IO.FileStream(FileName, System.IO.FileMode.OpenOrCreate)
Dim BinaryWriter As New System.IO.BinaryWriter(FileStream)
BinaryWriter.Write(BytesToWrite)
BinaryWriter.Close()
FileStream.Close()
Process.Start(FileName)

'keepInvisible = False
'Me.Visible = True
Me.Close()
Blackwood
  • 4,504
  • 16
  • 32
  • 41
TM80
  • 123
  • 2
  • 2
  • 12
  • _What error do you get?_ – Visual Vincent Jun 23 '16 at 14:34
  • Nothing the odd thing though is it is copying to the temp folder just not running te process from the temp folder? – TM80 Jun 23 '16 at 14:50
  • Is it not running the process at all? Or is it running the process, but not from the temp folder? – DrDonut Jun 23 '16 at 15:06
  • its not running the process at all Im not on an english machien (dutch) the variable FileName is returning its answer in english where C:\Users is C:\Gebruikers in dutch, though that said it is coppying to the temp folder – TM80 Jun 23 '16 at 15:19

1 Answers1

0

You could try this:

        Using calc As New Process
            calc.StartInfo.FileName = FileName
            calc.Start()
        End Using

It's another way of opening files, and i use it very frequently.

~ Would have made this a comment, but until i reach 50 Rep, i cannot comment so i hope this helps you with your problems.

user1931470
  • 193
  • 1
  • 6
  • Nope its stricktly doing it with the temp folder even if i manually type the path by hand its not responding hoever if i change the path to the C:\ it works but I need it to run from the temp folder? – TM80 Jun 24 '16 at 07:21