Page 1 of 1

Command line question

Posted: Wed Jul 02, 2003 11:45 am
by liljester
im writing a command line encryption app (windows)... everything works, but the screen is a bit clutterd. how do i issue a clearscreen "cls" command to the command window so that i can clear the screen?

anyone have any ideas?

Thanks!

Posted: Wed Jul 02, 2003 12:05 pm
by m@ndio
what programming language? VC++?VB?

Posted: Wed Jul 02, 2003 12:05 pm
by liljester
err... php.

Posted: Wed Jul 02, 2003 12:11 pm
by m@ndio
sorry this threw me:
command line encryption app (windows)
can you explain what you mean by this?

Posted: Wed Jul 02, 2003 12:20 pm
by liljester
i wrote a command line php script that asks for a directory path, and a password, and encrypts all the files in the given direcotry. it also will decrypt in the same manor.

my only question is how do i issue a "cls" command to the command window to clear the screen between operations?

Posted: Wed Jul 02, 2003 12:30 pm
by m@ndio
umm I don't really understand but hey I have been at work all day.. :(

try:

Code: Select all

shell_exec("cls"); // clear or clearscreen depending on what operating system it is
Let me know how you get on.

Posted: Wed Jul 02, 2003 12:46 pm
by liljester
thanks for the suggestion... no workie tho...

ive tried:
exec("cls");
shell_exec("cls");
passthrough("cls");
system("cls");

i think all of these functions open a new command line, not the existing one.

Posted: Wed Jul 02, 2003 1:49 pm
by SBukoski
I think you would need to have the windows handle of the opened command prompt and be able to manipulate based off of this handle. I've never used those functions so I'm not sure what they return, if anything.

Can you send the "cls" command along with your other commands when you first open it. or does the cls command need to be invoked at different times?

Posted: Wed Jul 02, 2003 2:31 pm
by liljester
i need to be able to clear the screen after every action... so it just wouldnt be when the script starts. *goes to brows php docs*