How to do multiple lines with shell?

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

How to do multiple lines with shell?

Postby Bob Paw » Nov 23, 2014 17:58

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?

Postby petan » Nov 23, 2014 18:15

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?wakka=KeyPgFileexists
Bob Paw
Posts: 8
Joined: Nov 23, 2014 14:22

Re: How to do multiple lines with shell?

Postby Bob Paw » Nov 23, 2014 18:41

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: 3211
Joined: Jul 28, 2005 14:45
Location: Germany

Re: How to do multiple lines with shell?

Postby dkl » Nov 23, 2014 19:12

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.

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 3 guests