Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell opens wrong file 1

Status
Not open for further replies.

shakespeare5677

Programmer
Jul 18, 2005
284
US
So here's a fun problem - I've got a parent folder with 2 exe's and in it I've got a child folder containing the vb project. When I try to shell an exe in the project folder, it launches a completely different exe in the parent folder. What's even more fun, when I try running "Fake.exe" (which does not exist) from the project folder I STILL get the other exe from the parent folder. Am I crazy?
-Max
 
Is that a retorical question :)

First thing i would do is step through the code - make sure its opening the shell file when expected (and not another line elsewhere).

Then i would presume it was to do with the referencing. Are you fully qualifying the path? I think though the first idea sounds more like it.

Also posting some example code may help.

TC

Dan

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
----------------------------------------
No D, just plank - and its not my fault
 
I stepped through the code and found the source of the problem before posting. There is no code to post, its just one line: Shell app.path & "\ShellMe.exe" Pure and simple, it opens the wrong file.
-Max
 
Are there spaces in the app.path?

debug.print App.Path & "\ShellMe.exe"

Dim strShell As String

strShell = """" & app.path & "\ShellMe.exe"""
Shell strShell



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
I figured it out - the child folder name is actually the name of an exe and another word. Because there is a space in between, the exe of the same name as the child folder is called, I'm assuming because the rest of the string is interpreted as arguments. Thanks, George.
-Max
 
No problem. glad you got it sorted.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top