|
-
Mar 20th, 2001, 10:36 PM
#1
Thread Starter
Lively Member
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.
-
Mar 20th, 2001, 10:55 PM
#2
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
-
Mar 20th, 2001, 11:00 PM
#3
Thread Starter
Lively Member
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...
-
Mar 20th, 2001, 11:17 PM
#4
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
-
Mar 20th, 2001, 11:19 PM
#5
Thread Starter
Lively Member
you understand everything after mpq2k is meant to be parameters right?
-
Mar 20th, 2001, 11:27 PM
#6
yes, but isnt strfilename your only parameter?
-
Mar 21st, 2001, 12:02 AM
#7
Thread Starter
Lively Member
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
-
Mar 21st, 2001, 02:07 AM
#8
change it to this:
shell(chr(34)+"C:\program files\starcraft\mpq2k.exe"+CHR(34)+" e " & strfilename & "\staredit\scenario.chk")
-
Mar 21st, 2001, 05:51 PM
#9
Thread Starter
Lively Member
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)
-
Mar 21st, 2001, 06:26 PM
#10
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"
-
Mar 21st, 2001, 06:37 PM
#11
Thread Starter
Lively Member
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
-
Mar 21st, 2001, 06:47 PM
#12
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"
-
Mar 21st, 2001, 09:31 PM
#13
Thread Starter
Lively Member
it works, im happy, i sorta understand it, im happy, i got it loading the chk, im happy
simple enough :P
-
Mar 22nd, 2001, 12:40 AM
#14
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")
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
|