How to do multiple lines with shell?

DOS specific questions.
Post Reply
Bob Paw
Posts: 8
Joined: Nov 23, 2014 14:22

How to do multiple lines with shell?

Post by Bob Paw »

For example:

Code: Select all

shell "if exist filename (...echo It's there...) Else (...echo Not there!)"
sleep
petan
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe
Contact:

Re: How to do multiple lines with shell?

Post by petan »

You ask on the same things in three threads ..
Stay in one plz !

A) What is your OS ??
B) You don't need shell !
Use command 'fileexists' instead
http://www.freebasic.net/wiki/wikka.php ... Fileexists
Bob Paw
Posts: 8
Joined: Nov 23, 2014 14:22

Re: How to do multiple lines with shell?

Post by Bob Paw »

First of all, no I don't, but anyway, it's Windows 7
BTW, you didn't answer my question. That's only an example. Sometimes I might need it for other things but it's not cmd help that I want, I know I could use | or &. So, what about creating files?
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: How to do multiple lines with shell?

Post by dkl »

The command given to shell is sent directly to cmd.exe (on Windows anyways), so you can use whatever line/statement separators cmd.exe supports. I think cmd.exe supports at least && to chain commands together, as in command1 && command2. Another solution could be to use multiple shell() invocations.
Post Reply