Gbasic Shell too many parameters

April 12, 2011 at 23:23:49
Specs: N/A
I am trying to create a small program using Quick Basic 4.5 (QB45) to copy a file from a long path on C: to my c:\qb45 folder. When I run the program I get an error 'too many parameters'.
I am using the Shell command to copy this file, which I will then search for specific data.
Basic code is
10 Open "transfer.bat" for output as #1
20 Print #1, "copy "; chr$(34); "c:\Program Files\Directory one\Directory two\Directory three\directory four\the-file-to-copy.cvs "; chr$(34); "newfile.txt"
30 close #1
40 shell "transfer"
50 end

(note: chr$(34) puts in a double quote)
When I run it (F5) the dos windows shows:
c:\QB45>copy "c:\Program Files\Directory one\Directory two\ ....\directory four\the-file-to-copy.cvs" newfile.txt (note, same results with or without stating newfile.txt)
Too many parameters

I am using the shell because this will be a single executable when done, and I need to search this cvs file (lists all my device names with their ip addresses on the network) for a specific device based on the users input, and access it dependent on the users selected method.
I have also tried, shell "go.bat transfer" where go.bat only contains %1 but no luck. Wierd part is, if I open a cmd window and go to my qb45 folder, I can run the transfer.bat and it copies the file just fine.
Any thoughts ??

See More: Gbasic Shell too many parameters

Report •

April 13, 2011 at 00:11:47
I'm not sure if I had exactly the same problem but way back I had a similar problem using SHELL with Microsoft BASIC compilers. I switched to Power Basic. I believe that Free Basic will also work.

Report •
Related Solutions

Ask Question