Hi,

I need help with Resource files....

That i need to do is running file that i have put in the resource files (exe file)
So the idea of this when i click the button the file that i have put run so it cant be happen with shell.

is there's any idea to do that?

Thanks in advance

Recommended Answers

All 4 Replies

See if this helps.

Dim myFileName As String = "C:\test.exe"
        IO.File.WriteAllBytes(myFileName, My.Resources.testApp)
        If IO.File.Exists(myFileName) Then Process.Start(myFileName)
commented: thanks +1

See if this helps.

Dim myFileName As String = "C:\test.exe"
        IO.File.WriteAllBytes(myFileName, My.Resources.testApp)
        If IO.File.Exists(myFileName) Then Process.Start(myFileName)

Thanks so much it helped me so much,

But i wondering if there way to run it without add in C:\ ?

You can save the file to AppData or LocalAppData Folder.
Those folders are there for such reasons and do not need any administrator permissions on non-administrator systems.

Dim myLocalAppDataFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
        Process.Start(myLocalAppDataFolder)

I would create a Folder just for my application in either one of those folders and use it as needed.

You can save the file to AppData or LocalAppData Folder.
Those folders are there for such reasons and do not need any administrator permissions on non-administrator systems.

Dim myLocalAppDataFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
        Process.Start(myLocalAppDataFolder)

I would create a Folder just for my application in either one of those folders and use it as needed.

Thank you so much bro helped me :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.