|
-
Feb 9th, 2011, 02:11 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Getting error trying to open .exe file using Shell
When i try to open a .exe file using Shell i get this error:
http://imagefire.systemous.com/ups/d...08-10%20PM.png
The syntax of shell is:
Shell "MyPrograms\..................\Hello.exe", vbMaximized Focus
Any ideas?
-
Feb 9th, 2011, 02:23 PM
#2
Re: Getting error trying to open .exe file using Shell
You will need the full path to the EXE
-
Feb 9th, 2011, 02:25 PM
#3
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
is it possible to find where exactly the folder which contains the .exe fiels is placed? Because i am not talking about a standard path.
-
Feb 9th, 2011, 02:27 PM
#4
Re: Getting error trying to open .exe file using Shell
-
Feb 9th, 2011, 02:31 PM
#5
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
Can cd return the filepath without save/load? :S
-
Feb 9th, 2011, 02:33 PM
#6
Re: Getting error trying to open .exe file using Shell
 Originally Posted by systemous
is it possible to find where exactly the folder which contains the .exe fiels is placed? Because i am not talking about a standard path.
App.Path will return the path that the EXE is running from.
-
Feb 9th, 2011, 04:30 PM
#7
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
I tried the app path but nothing. I decided to wirte the full path for a test but nothing. I created a shortcut of the game and tried to run it again but nothing again. the same stupid error again and again. any ideas?
-
Feb 9th, 2011, 04:40 PM
#8
Re: Getting error trying to open .exe file using Shell
Shell is pretty straight forward. You pass it the correct path and it will run the application. Unless you are ready to start showing the code you are using then I can't recommend anything further.
-
Feb 9th, 2011, 04:45 PM
#9
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
-
Feb 9th, 2011, 04:54 PM
#10
Re: Getting error trying to open .exe file using Shell
Since the username is Administrator, I would check and see if you have read and execute permissions for that directory.
-
Feb 9th, 2011, 04:58 PM
#11
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
even if i try to create a shortcut of the .exe on the desktop and run it, it says file not found.
-
Feb 9th, 2011, 05:05 PM
#12
Re: Getting error trying to open .exe file using Shell
Are you an administrator on the machine?
-
Feb 9th, 2011, 05:06 PM
#13
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
-
Feb 9th, 2011, 05:09 PM
#14
Thread Starter
Addicted Member
Re: Getting error trying to open .exe file using Shell
i found it. i created a shortcut of the .exe and then using Shell "cmd.exe /c start 1.lnk" it worked. thank you all for the help
-
Feb 9th, 2011, 05:16 PM
#15
Re: [RESOLVED] Getting error trying to open .exe file using Shell
That full path has spaces in it. When Shell() calls WinExec() you're subject to the following:
Security Remarks
The executable name is treated as the first white space-delimited string in lpCmdLine. If the executable or path name has a space in it, there is a risk that a different executable could be run because of the way the function parses spaces. The following example is dangerous because the function will attempt to run "Program.exe", if it exists, instead of "MyApp.exe".
Code:
WinExec("C:\\Program Files\\MyApp", ...)
If a malicious user were to create an application called "Program.exe" on a system, any program that incorrectly calls WinExec using the Program Files directory will run this application instead of the intended application.
The example there is in C, which is why you see the escaped \'s there.
The point is, your path needs quotes around it, e.g.:
Code:
Shell """C:\Documents and Settings\Administrator\Desktop\Life VS Death\...\Air Station.exe"""
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|