Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18011
Number of posts: 55384

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
shell command to run games Posted by Lizado on 5 Jan 2002 at 12:23 PM
Hi there!

I'm told that I can run all my games by using the shell command, but there is a problem - the game shows an error message! The problem is that it dont change default path that means that when I start my program in C:\programs\apprun\ itll default to this folder. When I start a game within my program it thinks that it is started in its own directory and make paths like this \dlls\custom.dll, which my program will treat as C:\programs\apprun\dlls\custom.dll when it should treat it with its own path c:\games\game\dlls\custom.dll and that means that the program wont be able to find the file.

With other words I need a command that makes me able to change default dir. (in combination with the shell command)

PS: Please turn a blind eye to my awfully grammars Im Danish :)
<br>
Report
Re: shell command to run games Posted by ghost13 on 5 Jan 2002 at 1:25 PM
well use the full path
shell "c:\games\dll\123.dll"
tell me if it didnt help or if i got your question wrong

The Ghost
ghost@crazygrandpa.com
Report
Re: shell command to run games Posted by Lizado on 5 Jan 2002 at 1:42 PM
: well use the full path
: shell "c:\games\dll\123.dll"
: tell me if it didnt help or if i got your question wrong
:
: The Ghost
: ghost@crazygrandpa.com
:

:-/ Its not quite the answer i was hoping for cause c:\games\dll\123.dll is just an example - there are 1000 of file paths that's shorted like this one. Beside there is one command that change the path (like PathTree or so...), cause like I said its an impossible task to change all.

I once got the command, but a virus forced me to format my comp. So i will be able to recognize the right command

Btw: PathTree doesn't work just an example :)

Lizado

Report
Re: shell command to run games Posted by KDivad Leahcim on 6 Jan 2002 at 4:28 AM
: : well use the full path
: : shell "c:\games\dll\123.dll"
: : tell me if it didnt help or if i got your question wrong
: :
: : The Ghost
: : ghost@crazygrandpa.com
: :
:
: :-/ It&#8217;s not quite the answer i was hoping for cause c:\games\dll\123.dll is just an example - there are 1000 of file paths that's shorted like this one. Beside there is one command that change the path (like PathTree or so...), cause like I said its an impossible task to change all.
:
: I once got the command, but a virus forced me to format my comp. So i will be able to recognize the right command
:
: Btw: PathTree doesn't work just an example :)
:
: Lizado
:
:

You can use ChDir to change the path and then shell the program or you can use the API ShellExecute:
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

ShellExecute 0, "open", "File name here", "", "Folder here", 2

Report
Re: shell command to run games Posted by Lizado on 6 Jan 2002 at 6:38 AM
: : : well use the full path
: : : shell "c:\games\dll\123.dll"
: : : tell me if it didnt help or if i got your question wrong
: : :
: : : The Ghost
: : : ghost@crazygrandpa.com
: : :
: :
: : :-/ It&#8217;s not quite the answer i was hoping for cause c:\games\dll\123.dll is just an example - there are 1000 of file paths that's shorted like this one. Beside there is one command that change the path (like PathTree or so...), cause like I said its an impossible task to change all.
: :
: : I once got the command, but a virus forced me to format my comp. So i will be able to recognize the right command
: :
: : Btw: PathTree doesn't work just an example :)
: :
: : Lizado
: :
: :
:
: You can use ChDir to change the path and then shell the program or you can use the API ShellExecute:
:
: Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
: (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
: ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
: 
: ShellExecute 0, "open", "File name here", "", "Folder here", 2
: 

:

Thx my prob. solved!

Lizado

Report
Re: shell command to run games Posted by jacob_miw on 6 Jan 2002 at 7:07 AM
Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)

Translation
If you think it's too complicated to ask in English, just ask in danish :)

LOL

jacob_miw
----------
ICQ# 56564298

Report
Re: shell command to run games Posted by KDivad Leahcim on 6 Jan 2002 at 7:38 AM
: Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
:
: Translation
: If you think it's too complicated to ask in English, just ask in danish :)
:
: LOL
:
: jacob_miw
: ----------
: ICQ# 56564298
:
:

I prefer Hick.
Report
Re: shell command to run games Posted by jacob_miw on 6 Jan 2002 at 10:49 AM
: : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
: :
: : Translation
: : If you think it's too complicated to ask in English, just ask in danish :)
: :
: : LOL
: :
: : jacob_miw
: : ----------
: : ICQ# 56564298
: :
: :
:
: I prefer Hick.
:

Yep sure. Me too. Definetely!!

eeh. BTW, what does Hick. mean?

jacob_miw
----------
ICQ# 56564298

Report
Re: shell command to run games Posted by KDivad Leahcim on 7 Jan 2002 at 3:20 AM
: : : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
: : :
: : : Translation
: : : If you think it's too complicated to ask in English, just ask in danish :)
: : :
: : : LOL
: : :
: : : jacob_miw
: : : ----------
: : : ICQ# 56564298
: : :
: : :
: :
: : I prefer Hick.
: :
:
: Yep sure. Me too. Definetely!!
:
: eeh. BTW, what does Hick. mean?
:
: jacob_miw
: ----------
: ICQ# 56564298
:
:

<language dialect="southern american" style="drawl">Weelp, seein' as how you'ins don' rightly unnerstan' wot I means when I sez "Hick", I s'pose I oart to 'splain it to ya. Eet's real simple-like, ya see. It's just bee-in us country folk's way of talkin', ya hear?</language>

Note: Use of xeml (Expanded Emotional Markup Language) is licensed to the public domain for use without restriction by JWCS.Net Limited and KDLTech.

<grin> Have fun!

KDL
Report
Re: shell command to run games Posted by Lizado on 7 Jan 2002 at 4:37 AM
: : : : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
: : : :
: : : : Translation
: : : : If you think it's too complicated to ask in English, just ask in danish :)
: : : :
: : : : LOL
: : : :
: : : : jacob_miw
: : : : ----------
: : : : ICQ# 56564298
: : : :
: : : :
: : :
: : : I prefer Hick.
: : :
: :
: : Yep sure. Me too. Definetely!!
: :
: : eeh. BTW, what does Hick. mean?
: :
: : jacob_miw
: : ----------
: : ICQ# 56564298
: :
: :
:
: <language dialect="southern american" style="drawl">Weelp, seein' as how you'ins don' rightly unnerstan' wot I means when I sez "Hick", I s'pose I oart to 'splain it to ya. Eet's real simple-like, ya see. It's just bee-in us country folk's way of talkin', ya hear?</language>
:
: Note: Use of xeml (Expanded Emotional Markup Language) is licensed to the public domain for use without restriction by JWCS.Net Limited and KDLTech.
:
: <grin> Have fun!
:
: KDL
:

Heh :) I think it would be rather difficult to understand Danish - at least for some people!

Har jeg ikke ret i det? Tror nppe de forstr hvad der str her


Lizado

Report
Re: shell command to run games Posted by KDivad Leahcim on 7 Jan 2002 at 5:10 AM
: Heh :) I think it would be rather difficult to understand Danish - at least for some people!
:
: Har jeg ikke ret i det? Tror nppe de forstr hvad der str her
:
:
: Lizado
:
:

That's why I prefer hick. I understand it! <grin>



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.