Results 1 to 14 of 14

Thread: Running programs

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83

    HELP MEEEEEEEEEEEEEEEEEEEEE!

    I want to run a program through dos(or the dos prompt), but the command is sent through vb...it needs to run a program with parameters....i tried shell....but it didn't work right...

    specifically the program is:Mo`Paq 2k
    with this code
    Shell ("C:\program files\starcraft\mpq2k.exe e " & strfilename & " staredit\scenario.chk")
    Last edited by Iceman; Mar 21st, 2001 at 12:50 AM.
    Ian Callanan
    VB6.0
    [email protected]

  2. #2
    Guest
    Hey what parameters are you trying to use?

    I know the > does not work for some reason with shell
    and i dont know how to get that to work

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    I'm trying to get it to extract a file(the e is the command for this) from the mpq (strfilename) and the file its extracting is the last part, "staredit\scenario.chk"

    this EXACT command worked from the dos prompt...
    Ian Callanan
    VB6.0
    [email protected]

  4. #4
    Guest
    Try
    Shell ("C:\program files\starcraft\mpq2k.exe e " & strfilename & "\staredit\scenario.chk")

    Because the strfilename needs the "\" after the filename? And it probable cant have a space between the File Path

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    you understand everything after mpq2k is meant to be parameters right?
    Ian Callanan
    VB6.0
    [email protected]

  6. #6
    Guest
    yes, but isnt strfilename your only parameter?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    NO!

    normally to run this you go to the dir through msdos that its in then type something like this:

    mpq2k e "C:\program files\starcraft\maps\bob.scm" staredit\scenario.chk

    the first runs it
    the second is the command, e is extract
    the third is the mpq file
    the last is the file INSIDE the mpq its getting
    Ian Callanan
    VB6.0
    [email protected]

  8. #8
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    change it to this:
    shell(chr(34)+"C:\program files\starcraft\mpq2k.exe"+CHR(34)+" e " & strfilename & "\staredit\scenario.chk")
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    that didn't seem to work

    remember it HAS to be run from a dos propmt normally...I've seen it done through vb before...(this exact thing)
    Ian Callanan
    VB6.0
    [email protected]

  10. #10
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    how about this...


    Shell "C:\program files\Starcraft\mpq2k.exe e " & chr(34) & strfilename & chr(34) & " staredit\scenario.chk",vbNormalFocus

    if not does this on its own work...?

    Shell "C:\program files\Starcraft\mpq2k.exe" ,vbNormalFocus
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    YOUR CODE WORKED!!!(hint: I'm happy!)





    the program doesn't work if you double click on it as it needs parameters

    if you run it with none from dos it gives you a help message for what to type
    Ian Callanan
    VB6.0
    [email protected]

  12. #12
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    Explanation:

    Example listed above...

    Shell ( etc...) wont work...

    X = Shell ( etc....) will work

    ok...remove the X = ...you must remove the ( )

    also

    Lord Orwell...Very close...

    Take your shell (remove the parenthesis) and this is what would be typed in run:

    "C:\program files\starcraftmpq2k.exe" e C:\program files\starcraft\maps\bob.scm \staredit\scenerio.chk

    got the " 's in the wrong places and added the \ where it was not needed.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    83
    it works, im happy, i sorta understand it, im happy, i got it loading the chk, im happy

    simple enough :P
    Ian Callanan
    VB6.0
    [email protected]

  14. #14
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    i had them in the correct place.
    The \ in the wrong place was a typo
    The fact that the filename stored in the variable had a space in it is another problem. It should be converted to 8.3 format to start with to prevent all of this.
    shell("C:\progra~1\starcraft\mpq2k.exe"+CHR(34)+" e " & strfilename & "\staredit\scenario.chk")
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width