Command line question

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
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Command line question

Post 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!
User avatar
m@ndio
Forum Regular
Posts: 163
Joined: Fri Jun 06, 2003 12:09 pm
Location: UK

Post by m@ndio »

what programming language? VC++?VB?
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post by liljester »

err... php.
User avatar
m@ndio
Forum Regular
Posts: 163
Joined: Fri Jun 06, 2003 12:09 pm
Location: UK

Post by m@ndio »

sorry this threw me:
command line encryption app (windows)
can you explain what you mean by this?
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post 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?
User avatar
m@ndio
Forum Regular
Posts: 163
Joined: Fri Jun 06, 2003 12:09 pm
Location: UK

Post 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.
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post 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.
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post 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?
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Post 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*
Post Reply