8 Replies - 3172 Views - Last Post: 12 June 2012 - 11:14 AM Rate Topic: -----

#1 eyestrain  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 20-March 12

How to Run An Exe File Which is dependent on its own INI FILE?

Posted 23 May 2012 - 04:28 AM

i have this executable file for example i named it eyestrain.exe
This exe will not run without my eyestrain.ini
if i run this file using the codes


Process.Start("location of my files") or even the shell(file path)
my exe file just open half second and will close again,

i know there is an issue with the ini file but i dont know how to make it run
properly...

anyone can give me an idea how can i do it?
TIA

Is This A Good Question/Topic? 0
  • +

Replies To: How to Run An Exe File Which is dependent on its own INI FILE?

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2256
  • View blog
  • Posts: 9,444
  • Joined: 29-May 08

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 23 May 2012 - 05:03 AM

Why don't you Settings instead? as Setting are part of the Exe.
Was This Post Helpful? 0
  • +
  • -

#3 eyestrain  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 20-March 12

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 23 May 2012 - 05:16 AM

@Adam,
sir I already try to put it as a resourcefile and i call it the way i call my exe on the resources
but the problem is still the same,
when i call the exe it will just run half seconds and will off,

so what i try is i put this exe on C:\my.exe and my.ini
and i try to call it as a usuall calling using shell or process start but still the same
thats why i think there is an issue with the ini,

sir can you explain more about this setting?

Quote

as Setting are part of the Exe.

Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2256
  • View blog
  • Posts: 9,444
  • Joined: 29-May 08

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 23 May 2012 - 05:28 AM

Let me just point you in the direction of the Using Settings Tutorial
Was This Post Helpful? 0
  • +
  • -

#5 eyestrain  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 20-March 12

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 23 May 2012 - 06:08 AM

hi, sir
sorry for being noob but i tried to read it carefully still i cannot see how can i apply that on my problm, sorry for that,

anyway thank you so much for the help,
with your post
i now do understand the importance of settings and that is additional info on my part thank you for that,

ill just try to re-write my code maybe i can figure it out :D
Was This Post Helpful? 0
  • +
  • -

#6 deathxmortis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-April 12

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 24 May 2012 - 09:48 AM

when the programm begins execution, first check if the .ini file exists:

link to doc --> here

Then you can take some actions.
Was This Post Helpful? 0
  • +
  • -

#7 eyestrain  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 20-March 12

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 26 May 2012 - 02:07 AM

your link is incorrect sir, please check it

anyway i wonder why this code is working perfectly

        Process.Start(My.Computer.FileSystem.CurrentDirectory & "\eyestrain.exe")

        


but if im gonna put to other directory the exe will just pop up in second and close again
Was This Post Helpful? 0
  • +
  • -

#8 appzone  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 07-March 12

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 01 June 2012 - 06:53 PM

what do you want to get with that?

you can simple check if the file .ini not exist, close the program

if exist, then run that program
Was This Post Helpful? 0
  • +
  • -

#9 deathxmortis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-April 12

Re: How to Run An Exe File Which is dependent on its own INI FILE?

Posted 12 June 2012 - 11:14 AM

View Posteyestrain, on 26 May 2012 - 02:07 AM, said:

your link is incorrect sir, please check it

anyway i wonder why this code is working perfectly

        Process.Start(My.Computer.FileSystem.CurrentDirectory & "\eyestrain.exe")

        


but if im gonna put to other directory the exe will just pop up in second and close again


Link is ok, but anyway... if you still have the problem, this may help:

Dim curFile As String = "c:\temp\test.txt"
Console.WriteLine(If(File.Exists(curFile), "File exists.", "File does not exist."))


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1