Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

shell command to run games

LizadoLizado Posts: 4Member
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:programsapprun 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 dllscustom.dll, which my program will treat as C:programsapprundllscustom.dll when it should treat it with its own path c:gamesgamedllscustom.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 :)


Comments

  • ghost13ghost13 Posts: 250Member
    well use the full path
    shell "c:gamesdll123.dll"
    tell me if it didnt help or if i got your question wrong

    The Ghost
    ghost@crazygrandpa.com
  • LizadoLizado Posts: 4Member
    : well use the full path
    : shell "c:gamesdll123.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:gamesdll123.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 [italic]PathTree[/italic] 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 :)

    [blue]Lizado[/blue] ;-)

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : : well use the full path
    : : shell "c:gamesdll123.dll"
    : : tell me if it didnt help or if i got your question wrong
    : :
    : : The Ghost
    : : ghost@crazygrandpa.com
    : :
    :
    : :-/ It’s not quite the answer i was hoping for cause c:gamesdll123.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 [italic]PathTree[/italic] 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 :)
    :
    : [blue]Lizado[/blue] ;-)
    :
    :

    You can use ChDir to change the path and then shell the program or you can use the API ShellExecute:
    [code]
    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
    [/code]
  • LizadoLizado Posts: 4Member
    : : : well use the full path
    : : : shell "c:gamesdll123.dll"
    : : : tell me if it didnt help or if i got your question wrong
    : : :
    : : : The Ghost
    : : : ghost@crazygrandpa.com
    : : :
    : :
    : : :-/ It’s not quite the answer i was hoping for cause c:gamesdll123.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 [italic]PathTree[/italic] 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 :)
    : :
    : : [blue]Lizado[/blue] ;-)
    : :
    : :
    :
    : [blue]You can use ChDir to change the path and then shell the program[/blue] or you can use the API ShellExecute:
    : [code]
    : 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
    : [/code]
    :

    Thx my prob. solved! :-)

    [blue]Lizado[/blue] ;-)

  • jacob_miwjacob_miw Posts: 194Member
    Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)

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

    LOL

    jacob[green]_[/green]miw
    ----------
    [italic]ICQ# 56564298[/italic]

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
    :
    : [b]Translation[/b]
    : If you think it's too complicated to ask in English, just ask in danish :)
    :
    : LOL
    :
    : jacob[green]_[/green]miw
    : ----------
    : [italic]ICQ# 56564298[/italic]
    :
    :

    I prefer Hick.
  • jacob_miwjacob_miw Posts: 194Member
    : : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
    : :
    : : [b]Translation[/b]
    : : If you think it's too complicated to ask in English, just ask in danish :)
    : :
    : : LOL
    : :
    : : jacob[green]_[/green]miw
    : : ----------
    : : [italic]ICQ# 56564298[/italic]
    : :
    : :
    :
    : I prefer Hick.
    :

    Yep sure. Me too. Definetely!!

    eeh. BTW, what does Hick. mean?

    jacob[green]_[/green]miw
    ----------
    [italic]ICQ# 56564298[/italic]

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : : : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
    : : :
    : : : [b]Translation[/b]
    : : : If you think it's too complicated to ask in English, just ask in danish :)
    : : :
    : : : LOL
    : : :
    : : : jacob[green]_[/green]miw
    : : : ----------
    : : : [italic]ICQ# 56564298[/italic]
    : : :
    : : :
    : :
    : : I prefer Hick.
    : :
    :
    : Yep sure. Me too. Definetely!!
    :
    : eeh. BTW, what does Hick. mean?
    :
    : jacob[green]_[/green]miw
    : ----------
    : [italic]ICQ# 56564298[/italic]
    :
    :

    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?

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

    Have fun!

    KDL
  • LizadoLizado Posts: 4Member
    : : : : Hvis du synes det er for besvrligt at sprge p engelsk kan du jo bare sprge p dansk :)
    : : : :
    : : : : [b]Translation[/b]
    : : : : If you think it's too complicated to ask in English, just ask in danish :)
    : : : :
    : : : : LOL
    : : : :
    : : : : jacob[green]_[/green]miw
    : : : : ----------
    : : : : [italic]ICQ# 56564298[/italic]
    : : : :
    : : : :
    : : :
    : : : I prefer Hick.
    : : :
    : :
    : : Yep sure. Me too. Definetely!!
    : :
    : : eeh. BTW, what does Hick. mean?
    : :
    : : jacob[green]_[/green]miw
    : : ----------
    : : [italic]ICQ# 56564298[/italic]
    : :
    : :
    :
    : 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?
    :
    : Note: Use of xeml (Expanded Emotional Markup Language) is licensed to the public domain for use without restriction by JWCS.Net Limited and KDLTech.
    :
    : 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 :-)


    [blue]Lizado[/blue] ;-)

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : 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 :-)
    :
    :
    : [blue]Lizado[/blue] ;-)
    :
    :

    That's why I prefer hick. I understand it!
Sign In or Register to comment.