Just add your file to the resources of the project and declare the resource in your variables.
Code:
'''''''''''''''''''''''''''''''''''
'''''''Declare variables ''''''
'''''''''''''''''''''''''''''''''''
Dim newFilePath As String
Dim resource As Array
'''''''''''''''''''''''''''''''''''
'''''''Put data in variables'''''''
'''''''''''''''''''''''''''''''''''
newFilePath = "C:/test/test.ext" 'your file path (string)
resource = My.Resources.something ' resouce=YOUR RESOURCE my.resources.something
'''''''''''''''''''''''''''''''''''
'''''''Write file '''''''
'''''''''''''''''''''''''''''''''''
Using sCreateFile As New IO.FileStream(newFilePath, IO.FileMode.Create)
sCreateFile.Write(resource, 0, resource.Length)
End Using
'''''''''''''''''''''''''''''''''''
'''''''DONE! '''''''
'''''''''''''''''''''''''''''''''''
you can make it write to the temp directory with this code
Code:
Dim temppath
temppath = If(Environ$("tmp") <> "", Environ$("tmp"), Environ$("temp"))
newFilePath = temppath + "/file.ext"
Hope this helps someone