Page 1 of 1

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

Posted: Thu Sep 09, 2004 8:29 pm
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

Posted: Fri Sep 10, 2004 12:28 am
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..

Posted: Fri Sep 10, 2004 3:23 pm
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.