Path Environment variable

#1
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?
 


zvit

Honorable Member
#2
the code is

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


#3
you missed my point mate
read the topic again
:)
 


zvit

Honorable Member
#4
I tried it with one of my apps and it works fine. Are you adding % to the variable in the run command?
 


#5
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?
 


zvit

Honorable Member
#6
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
no it is desktop
 


#8
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
I tried that
 


zvit

Honorable Member
#10
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
it worked guys
like a charm
I just moved some files from folder inside my app folder and brought them outside
:)
 


#12
Good job! Glad to hear it. :)
 


This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.
Top