Results 1 to 8 of 8

Thread: Help me to run a file from a button

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    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

  2. #2
    Lively Member
    Join Date
    Sep 2007
    Location
    Texas
    Posts
    98

    Re: Help me to run a file from a button

    The easiest eay to do this is

    shell("C:/iPhodroid.exe")

    Hope this helps
    Working in VB2005 and SQL2005

  3. #3
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Help me to run a file from a button

    Quote Originally Posted by SunshineBH View Post
    The easiest eay to do this is

    shell(C:/iPhodroid.exe)

    Hope this helps
    Blasphemy!

    He means:

    VB.NET Code:
    1. 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.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Re: Help me to run a file from a button

    Quote Originally Posted by weirddemon View Post
    Blasphemy!

    He means:

    VB.NET Code:
    1. 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

  5. #5
    Lively Member
    Join Date
    Sep 2007
    Location
    Texas
    Posts
    98

    Re: Help me to run a file from a button

    Quote Originally Posted by weirddemon View Post
    Blasphemy!
    Sorry

    Been using that command for years and it has been working fine.

    How does this differ from Process.Start? And why is this better?
    Working in VB2005 and SQL2005

  6. #6
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Help me to run a file from a button

    Quote Originally Posted by SunshineBH View Post
    Sorry

    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.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  7. #7
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Help me to run a file from a button

    Quote Originally Posted by salmawy View Post
    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.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  8. #8
    Frenzied Member Pc_Not_Mac's Avatar
    Join Date
    Oct 2009
    Location
    localhost
    Posts
    1,206

    Re: Help me to run a file from a button

    hide it
    You can hide the file Attributes.
    =VB.net Code:
    1. File.SetAttributes("C:\vb.txt", FileAttributes.Hidden)
    Moving a file is easy just Google it.
    My Codebank:
    Windows Vista & 7 Glass Effect & Limit the amount of times your application could be opened.
    Pause Your Code & Check the OS name

    The question of whether computers can think is like the question of whether submarines can swim.

    Currently learning: Java

    Coding can be a learning experience or

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width