MSDOS commands (some dont work via shell_exec()?)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
brian183
Forum Newbie
Posts: 13
Joined: Thu Aug 26, 2004 1:28 am

MSDOS commands (some dont work via shell_exec()?)

Post by brian183 »

I've recently been asked by a coworker to make (or find) a program that'll scan a hard drive and compare what files are on the drive to cached list of files that are on it from a day ago so she can easily see what new files are on the hard drive. I've searched the net and didn't find something simple (and free) that'll do this for her so I want to make a php script, that can easily do this (god I luv php), via the CLI.

It'll have a menu choices of what she wants to do with this program and after she makes a choice it'll execute the choice (maybe output errors or w/e) and then go back to the menu. I want to execute an MSDOS command via shell_exec (or the backticks) called "CLS". CLS is a command to clear the dos screen completely.

When I try to execute this DOS command via php's shell_exec() it doesn't clear the screen at all. It gives me a return character of ASCII value 12 (it's the symbol for female or the planet venus). I looked this character up on the ASCII table and it says the code is FF.

I forget what FF is. So anyway, if anyone can help me get this DOS command to work i'd greatly appreciate it or maybe there's a php function that can do this that I'm not finding.

thanx
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it'd probably be easier to do this through a command-line executable.. since those functions are available standard. php isn't exactly built to run menu driven systems via command-line..
brian183
Forum Newbie
Posts: 13
Joined: Thu Aug 26, 2004 1:28 am

Post by brian183 »

it seems that the only way to accomplish this is to make a separate program with C (or assembly) to clear the screen and then run the prog with exec() in php. This is pretty annoying but it seems like the only way to do such a thing.
Post Reply