Shell command and variables Shell command and variables nenebien (TechnicalUser) (OP) 11 Sep 07 14:21 hello i'm trying to run an external file through shell (C:\>file.exe parameter) and i like let the user to input the parameter in a variable. can i pass the variable to the shell? how?sorry for my poor english, if i'm not clear please let me know.thanks!jul RE: Shell command and variables Freestone (MIS) 11 Sep 07 17:58 This example passes two parameters to C:\test.batQB 4.5 code:CODESHELL "c:\test.bat p1 p2"test.bat:CODE@echo offclsecho In TEST.BATecho Parameter1 = %1echo Parameter2 = %2echo.pause Hope this helps. RE: Shell command and variables Buff1 (Programmer) 11 Sep 07 22:12 line input "Enter parameter for program ";Var$shell "C:\File.EXE "+Var$The space after exe will be mandatory. If it requiresa "/" character thenshell "C:\file.exe /"+Var$ RE: Shell command and variables PROFESSORSPARKIE (Instructor) 12 Sep 07 00:37 EXECUTE THE ".BAT" FILE AS SPECIFIED BY FREESTONETHENIn the bat file code SET MYPARM1=%1SET MYPARM2=%2THEN RUN THE PROGRAM WITH THE FOLLOWING CODE AT THE BEGINNINGMYFIRSTPARM$ = ENVIRON$("MYPARM1")MYSECONDPARM$ = ENVIRON$("MYPARM2")NOW THE QBASIC PROGRAM CONTAINS THE PASSED STRINGS AS MYFIRSTPARM$ & MYSECONDPARM$ . Computer thought: I teach a lot of programming so I can learn. You can never learn it all. RE: Shell command and variables nenebien (TechnicalUser) (OP) 13 Sep 07 15:22 thank you all!!I did it with Buff1 advice, thank you all for your interest.now i've got another issue,i'm getting "illegal function call" error i guess that's because the commandstring in the SHELL is too big, is there a way to fix that?thanks again! RE: Shell command and variables Freestone (MIS) 13 Sep 07 17:36 It would help if you could post some of the failing code. RE: Shell command and variables Buff1 (Programmer) 22 Sep 07 22:33 I doubt that it's too long unless it's over 256 characters.I would more likely look to an error in the code.Without at least a snipet though, we are unable to say forsure. Like saying "I sneezed -- what's wrong with me?"and expecting the exact diagnosis. RE: Shell command and variables PROFESSORSPARKIE (Instructor) 6 Dec 07 04:01 Another thought: when you shell to another program/bat file the current environment is passed straight through so the values can be retrieved directly by the shelled program.you used to be able to increase the set area in the cmd box up to 4k that you run the programs in. look in the system for that possibility, maybe use the properties folder on the cmd icon. Maybe it is in the windows equivalent of autoexec of config files . Sorry I don't have the time right now. Computer thought: I teach a lot of programming so I can learn. You can never learn it all.