Click to See Complete Forum and Search --> : Using the Shell function
BirK
August 17th, 2001, 09:53 AM
Im trying to use the Shell function in order to start an executable file that requires an argument (a file name). The program can only be executed from the command promt (DOS) and the argument is a file name (converts .wad files to .pcx files). It doesn't work. I can see that the progam starts the same way it does when i double klick on it in windows, that is without an argument. But it refuses to read the argument when i use Shell "C:\wad3.exe & " " & fileName, 2 . If i start it from the command promt (like: c:\wad3.exe batman.wad) it works as intended.. Any idea how to solve this problem? Is there any other function that can be used?
Andrew_Fryer
August 17th, 2001, 10:05 AM
Put the whole command line into the string, i.e
dim myStr as string
myStr = "C:\wad3.exe " & fileName
Shell myStr
That should work.
Andrew
BirK
August 17th, 2001, 10:16 AM
Nope, doesn't make any difference... ahhh, this problem drives me crazy!!!
Thanks anyway mate!
Andrew_Fryer
August 17th, 2001, 10:26 AM
Hello again,
It seems to work for me....one thing I noticed though - you need to include the DOS name instead of the Windows one, i.e if you are specifying a path then My Documents becomes MYDOCU~1 - if you are specifying a file to open the pass the directory in the DOS format.
Thanks
Andrew
BirK
August 17th, 2001, 10:36 AM
i have copied both the executable and the file to convert to c: just for testing purpose so thera are no long file names. Also i have tried with other dos programs, for example Shell "Regsvr32.exe " & "test.dll" which works excellent. So I cannot understand why this wad3-program only runs from the command promt... it's coded with c++, so maybe I should make a post to that forum instead...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.