School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 357,970 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,553 people online right now.Registration is fast and FREE... Join Now!



adding an exe to my project

52 Weeks of Code Challenge:Android

Week #11 of the 52 Weeks of Code Challenge is Android, you should give it a shot. Click Here!
Page 1 of 1

adding an exe to my project Rate Topic: -----

#1 TADS  Icon User is offline

  • D.I.C Head
  • Icon

Reputation: 3
  • View blog
  • Posts: 86
  • Joined: 09-August 08


Dream Kudos: 0

Posted 06 October 2008 - 09:33 AM

Hi all,

been a while since i been on here only just got pc back running :) 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

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: 06 October 2008 - 09:38 AM

Was This Post Helpful? 0
  • +
  • -


#2 TADS  Icon User is offline

  • D.I.C Head
  • Icon

Reputation: 3
  • View blog
  • Posts: 86
  • Joined: 09-August 08


Dream Kudos: 0

Re: adding an exe to my project

Posted 06 October 2008 - 01:36 PM

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

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

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: 06 October 2008 - 01:38 PM

Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • The Bandido Coder
  • Icon

Reputation: 224
  • View blog
  • Posts: 3,485
  • Joined: 29-May 08


Dream Kudos: 4100

Expert In: vb.net, LINQ

Re: adding an exe to my project

Posted 06 October 2008 - 01:46 PM

I have to ask why you want to hide it?
Was This Post Helpful? 0
  • +
  • -

#4 TADS  Icon User is offline

  • D.I.C Head
  • Icon

Reputation: 3
  • View blog
  • Posts: 86
  • Joined: 09-August 08


Dream Kudos: 0

Re: adding an exe to my project

Posted 06 October 2008 - 01:50 PM

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 :)

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 :)

this is the code i have it displays the whole path not just the name of the file :(

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: 06 October 2008 - 02:54 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

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

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month