Path Environment variable

Discussion in 'Windows 7 Help and Support' started by Ahmedn1, Aug 24, 2010.

  1. Ahmedn1

    Ahmedn1 New Member

    Joined:
    Aug 24, 2010
    Messages:
    12
    Likes Received:
    0
    hello
    I have developed an application using C# and I want it to run from start > run when I write the name like when I write 'calc' to run the calculator

    I set the path variable to add the application folder
    when I write the name it gives me 'Application Name stopped working' error
    I thought that there is something wrong with the app but when I navigated through start>>run to the file as 'C:\program files\application\app.exe' it worked perfectly
    but when I write just 'app.exe' it gives me the previous error

    any ideas?
     
  2. zvit

    zvit Honorable Member

    Joined:
    Nov 3, 2009
    Messages:
    2,455
    Likes Received:
    84
    the code is

    1. System.Diagnostics.Process.Start("calc")
    What is your code?
     
  3. Ahmedn1

    Ahmedn1 New Member

    Joined:
    Aug 24, 2010
    Messages:
    12
    Likes Received:
    0
    you missed my point mate
    read the topic again
    :)
     
  4. zvit

    zvit Honorable Member

    Joined:
    Nov 3, 2009
    Messages:
    2,455
    Likes Received:
    84
    I tried it with one of my apps and it works fine. Are you adding % to the variable in the run command?
     
  5. Ahmedn1

    Ahmedn1 New Member

    Joined:
    Aug 24, 2010
    Messages:
    12
    Likes Received:
    0
    when I use this it deosn't recognize the problem

    I tracked the error report
    and found System.dllnotfoundexception

    and the dll in the report is in the application folder and it works because the program runs very normal when I run it from a shortcut
    but from commandline it doesn't recognize this dll

    WHY?
     
  6. zvit

    zvit Honorable Member

    Joined:
    Nov 3, 2009
    Messages:
    2,455
    Likes Received:
    84
    Is your app a web service? If so, you will need to add to your code for it to be able find the bin folder of your app in the Win7 default web server folder . If it is, I will help you with that.
     
  7. Ahmedn1

    Ahmedn1 New Member

    Joined:
    Aug 24, 2010
    Messages:
    12
    Likes Received:
    0
    no it is desktop
     
  8. TorrentG

    TorrentG Banned

    Joined:
    May 31, 2010
    Messages:
    7,814
    Likes Received:
    372
    It's probably looking for the .dll to be in C:\Windows\System32

    As a temporary test, place a copy of the .dll there, then give a try and see how it goes.

    If it works, then you know the exact reason and can take it from there.
     
  9. Ahmedn1

    Ahmedn1 New Member

    Joined:
    Aug 24, 2010
    Messages:
    12
    Likes Received:
    0
    I tried that
     
  10. zvit

    zvit Honorable Member

    Joined:
    Nov 3, 2009
    Messages:
    2,455
    Likes Received:
    84
    Please post the exact path of the executable and the exact command you type into the run command.
    Also, please post the exact names you gave in the environment variables: Variable name & Variable value.
     
  11. Ahmedn1

    Ahmedn1 New Member

    Joined:
    Aug 24, 2010
    Messages:
    12
    Likes Received:
    0
    it worked guys
    like a charm
    I just moved some files from folder inside my app folder and brought them outside
    :)
     
  12. TorrentG

    TorrentG Banned

    Joined:
    May 31, 2010
    Messages:
    7,814
    Likes Received:
    372
    Good job! Glad to hear it. :)
     

Share This Page

Loading...