×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Shell Execution Problem

Shell Execution Problem

Shell Execution Problem

(OP)
Hi. I was triing to do some stuff on ms dos with qb using shell command.
When I type ;

Start > Run > cmd.exe

and then type

'ftype txtfile'

it runs but when I use command in qb;

'Shell "ftype txtfile"

it fails.

I really wonder why it doesn't work with qb while it works with cmd?

my MSDOS version is 5.0

Thanks a lot.

RE: Shell Execution Problem

My first thought is memory. when running a qb program the
memory is limited when shelling, but from the command prompt or Start>run you probably have more memory available for the program.

Otherwise we would need to know more about the program(s)
to arrive at a valid conclusion

RE: Shell Execution Problem

A little more explicit:

Shell "ftype.exe txtfile"

Add water (makes its own sauce).

RE: Shell Execution Problem

i compiled hello.bas and ran it via shell and it worked fine
(XP) and used cmd.exe to get to the prompt then cd to the folder containing hello and typed hello and it worked fine.

So, don't know what to tell you unless im missing something here.

RE: Shell Execution Problem

You might want to try and check your path. For instance; if you have your program that is using the SHELL command in the DOS directory, and the ftype program is in another directory (say the “utilities” directory) then the SHELL command will not work unless you specify the drive and path in your SHELL command. The command may look more like this:

SHELL "c:\utilities\ftype.exe txtfile"

Just replace “utilities” in the above example with the directory path to the ftype.exe program. And this will only work if the textfile is located in the same directory as the ftype.exe program; otherwise you will need to specify the path for the txtfile after the ftype.exe program just like you did with the program itself.

Hope this helps.

RE: Shell Execution Problem

(OP)
well I made windows search for ftype and it couldn't found it. Anyway, thanks a lot !!!

RE: Shell Execution Problem

If you cannot find FTYPE command
but it apparently works
that means it is internal command of CMD.EXE
So you can call it as
CMD.EXE /C FTYPE txtfile

like this:
SHELL "CMD.EXE /C FTYPE txtfile"

(checked with QBasic on XP Prof SP2, it works )

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close