Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 244,296 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 861 people online right now. Registration is fast and FREE... Join Now!




adding an exe to my project

 
Reply to this topicStart new topic

adding an exe to my project

TADS
6 Oct, 2008 - 09:33 AM
Post #1

D.I.C Head
**

Joined: 9 Aug, 2008
Posts: 67



Thanked: 1 times
My Contributions
Hi all,

been a while since i been on here only just got pc back running smile.gif all is good now here is my problem

I'm making a car making tool that makes all files for a 3d model car for a racing game i use what i would like it to do is include an .exe in my project and use it when its called for, now the exe was not made by me and at the moment you have to use a .bat to make the intended car files so what i's trying to do is eliminate the need to use these .bat files and also puts the car files in the correct place thats a little about what I'm doing,

how would i get the exe in my project? i have created a folder in Solution and added existing item witch is the said exe... i now need to call on it when the user wants it... i know how to call it from a static location

CODE

If Shell("dir location") Then
            MsgBox("car Made Successfully! ", MsgBoxStyle.Information, "Nheat Mod Making Tools!")
Else
MsgBox("Error in conversion!! ", MsgBoxStyle.Critical, "Nheat Mod Making Tools!")
        End If


but cant seam to figure out how to use the code i have in textbox (like i have in my .bat) and then run the exe... please note i would prefer that the .exe's i include in this app is not saved in a folder (unless i have them installed to hidden location)

i know how to save the text in my textbox to a .bat and then run the .bat but i was hoping to get away from this

i know this is alot to read but if you need more code so show i have been trying i will post up more i only posted up the bit thats in question

thanks if anyone can help

TADS

This post has been edited by TADS: 6 Oct, 2008 - 09:38 AM

User is offlineProfile CardPM
+Quote Post


TADS
RE: Adding An Exe To My Project
6 Oct, 2008 - 01:36 PM
Post #2

D.I.C Head
**

Joined: 9 Aug, 2008
Posts: 67



Thanked: 1 times
My Contributions
i have found a way to do the .bat's but for some reason i have to close the app and reopen to run the .bat not sure why this is the code i have come up with

CODE

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click


        FileOpen(1, "mydir\mybat.bat", OpenMode.Output)
        PrintLine(1, RichTextBox1.Text)
        FileClose(1)
        MsgBox(" Thank You For Using This Tool! ", MsgBoxStyle.Information)
        Me.Update()


        Form2.Show()



        Dim FileToDelete As String

        FileToDelete = "mydir\mybat.bat"

        If System.IO.File.Exists(FileToDelete) = True Then

            System.IO.File.Delete(FileToDelete)
            'in testing mode to make sure file deleted!
            MsgBox("File Deleted")

        End If




    End Sub


and in form2 i have this on onload

CODE

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Shell("MYDIR\mYBAT.bat")

        Me.Update()

        MsgBox("skin has been converted! ", MsgBoxStyle.Information, "tadsnet Nasrcar Heat Tools!")
        Me.Close()

    End Sub


is there anyway i can run the .bat after i created it without closing down my app and reopening it?
i could then make the .exe's store in a hidden folder and just copy the file to a dir in the app folder!

thanks again

TADS

This post has been edited by TADS: 6 Oct, 2008 - 01:38 PM
User is offlineProfile CardPM
+Quote Post

AdamSpeight2008
RE: Adding An Exe To My Project
6 Oct, 2008 - 01:46 PM
Post #3

The Bandido Coder
Group Icon

Joined: 29 May, 2008
Posts: 1,654



Thanked: 99 times
Dream Kudos: 3350
Expert In: vb.net, LINQ

My Contributions
I have to ask why you want to hide it?
User is offlineProfile CardPM
+Quote Post

TADS
RE: Adding An Exe To My Project
6 Oct, 2008 - 01:50 PM
Post #4

D.I.C Head
**

Joined: 9 Aug, 2008
Posts: 67



Thanked: 1 times
My Contributions
out of sight out of mind im trying to limit what you can do with the tools to hopefully stop people cheating on the game so if they cant find the .exe's they cant make there own .bats and crack the cars to cheat that was the only reason but it is not something that HAS to be done!

thanks for reply

TADS

*edit**

i found that if you just replace the contents of the .bat file it runs fine the only time it dont run is if you delete the .bat and make a new one smile.gif

last problem with this app is i want to store the filename of the file that i open in an textbox so when its saved it knows what it is, im tryiong to make it user fredly smile.gif

this is the code i have it displays the whole path not just the name of the file sad.gif

CODE

Public strFileName1 As String

.FileName = strFileName1

strFileName1 = OpenFileDialog1.FileName

TextBox1.Text = strFileName1


this displays full path to the file not just the filename is there something im missing?

TADS

This post has been edited by TADS: 6 Oct, 2008 - 02:54 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 04:43PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month