Help me to run a file from a button
I want to run a file when i press on button 3
Directory of file:
C:/iPhodroid.exe
Re: Help me to run a file from a button
The easiest eay to do this is
shell("C:/iPhodroid.exe")
Hope this helps
Re: Help me to run a file from a button
Quote:
Originally Posted by
SunshineBH
The easiest eay to do this is
shell(C:/iPhodroid.exe)
Hope this helps
Blasphemy!
He means:
VB.NET Code:
Process.Start("C:\iPhodroid.exe")
Also, make sure you do the correct slashes. You used a forward slash, which isn't used in file paths and would not work.
Re: Help me to run a file from a button
Quote:
Originally Posted by
weirddemon
Blasphemy!
He means:
VB.NET Code:
Process.Start("C:\iPhodroid.exe")
Also, make sure you do the correct slashes. You used a forward slash, which isn't used in file paths and would not work.
Thank you very much it worked for me
also can you help me to copy fiiles from a directory to a directory and hide it and thx u very much
Re: Help me to run a file from a button
Quote:
Originally Posted by
weirddemon
Blasphemy!
Sorry :cry:
Been using that command for years and it has been working fine.
How does this differ from Process.Start? And why is this better?
Re: Help me to run a file from a button
Quote:
Originally Posted by
SunshineBH
Sorry :cry:
Been using that command for years and it has been working fine.
How does this differ from Process.Start? And why is this better?
Shell is an outdated method used from VB6. I think it's only in VB.NET for making it easier to convert VB6 apps to VB.NET.
If you're just using the Process Class for launching one item, and nothing else, then there's no difference, I guess. The OP would just be developing bad habits by using Shell.
But, if you read the documentation, there's so much more that can be accomplished with Process.Start.
Re: Help me to run a file from a button
Quote:
Originally Posted by
salmawy
Thank you very much it worked for me
also can you help me to copy fiiles from a directory to a directory and hide it and thx u very much
I can't give you the answer, but I'll lead you in the right direction.
The System.IO namespace contains the File Class that will let you manipulate files.
Read up on the documentation and you'll get an idea on what you need to do.
But basically, you'll want to loop through each file in the directory and call the appropriate method to copy or move them to another directory.
Also, don't forget to use Google.
Re: Help me to run a file from a button
You can hide the file Attributes.
=VB.net Code:
File.SetAttributes("C:\vb.txt", FileAttributes.Hidden)
Moving a file is easy just Google it.