Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Suppress flashing due to shell_exec
On my WinXP Pro system with PHP 5.0.4 CLI
(command line interface), if I do

$ver = shell_exec("ver");

it will return the correct value
(e.g. Microsoft Windows XP [Version 5.1.2600])
but there will be a flashy thingy on the screen, and
like the guy said in MIB, I don't like flashy thingies.

How can I get that command to run sychronously
without showing me the DOS box (CMD window) that
it uses?  Oh, I should mention that I don't want
to create a (separate) file to do this.

Thanks for any tips,
Csaba Gabor from Vienna

Report this thread to moderator Post Follow-up to this message
Old Post
Csaba Gabor
04-22-05 01:55 PM


Re: Suppress flashing due to shell_exec
"Csaba Gabor" <csaba@z6.com> wrote in message
news:e55ae.14239$0z2.9588@news.chello.at...
> On my WinXP Pro system with PHP 5.0.4 CLI
> (command line interface), if I do
>
> $ver = shell_exec("ver");
>
> it will return the correct value
> (e.g. Microsoft Windows XP [Version 5.1.2600])
> but there will be a flashy thingy on the screen, and
> like the guy said in MIB, I don't like flashy thingies.
>
> How can I get that command to run sychronously
> without showing me the DOS box (CMD window) that
> it uses?  Oh, I should mention that I don't want
> to create a (separate) file to do this.


Why do you want to know what system your server is running? Can't you
hardcode it, and update if you ever change the servers OS?

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-22-05 08:57 PM


Re: Suppress flashing due to shell_exec
Kimmo Laine wrote:
> "Csaba Gabor" <csaba@z6.com> wrote in message
> news:e55ae.14239$0z2.9588@news.chello.at...
> 
>
> Why do you want to know what system your server is running? Can't you
> hardcode it, and update if you ever change the servers OS?

Hardcoding?  Yikes! - always to be avoided.  However, as I
mentioned above, this has nothing to do with a server - I am
using the command line interface (CLI) version of PHP.
This is very useful for automating tasks on PCs if I don't
want to use VBScript.  On my systems, if I double click on a
.PHP file or press enter when it is selected, it gets handed
to the CLI PHP.exe.  Nifty.

The emphasis in this post is not on determining the operating
system (one could also use php_uname() for that), but rather
on hiding the annoying flashingness of the DOS box.

However, the original motivation for wanting to know this was
that I want to have a Dialog Box for selecting a directory (not
a file) on Windows systems and the CommonDialog FileOpen/SaveAs
do not allow you to return a directory (not a very good design
decision, if you ask me).  Fortunately, there is at least a poor
substitute, the browseForFolder method of the Shell.Application
COM object.  The reason I say poor substitute is that this
method is evidently buggy and behaves differently on different
versions of windows to the extent that you have to look at
different properties and subobjects to get the actual returned
directory, if any.  This is very nicely documented at:
http://groups-beta.google.com/group... />
737cf0ca1d
I have solved the original problem (I think), but this residual
question is still something I'd like to figure out.

Csaba

Report this thread to moderator Post Follow-up to this message
Old Post
Csaba Gabor
04-22-05 08:57 PM


Re: Suppress flashing due to shell_exec
"Csaba Gabor" <csaba@z6.com> kirjoitti
viestissä:wk6ae.14363$0z2.9584@news.chello.at...
> Kimmo Laine wrote: 
>
> Hardcoding?  Yikes! - always to be avoided.  However, as I
> mentioned above, this has nothing to do with a server - I am
> using the command line interface (CLI) version of PHP.
> This is very useful for automating tasks on PCs if I don't
> want to use VBScript.  On my systems, if I double click on a
> .PHP file or press enter when it is selected, it gets handed
> to the CLI PHP.exe.  Nifty.
>
> The emphasis in this post is not on determining the operating
> system (one could also use php_uname() for that), but rather
> on hiding the annoying flashingness of the DOS box.
>
> However, the original motivation for wanting to know this was
> that I want to have a Dialog Box for selecting a directory (not
> a file) on Windows systems and the CommonDialog FileOpen/SaveAs
> do not allow you to return a directory (not a very good design
> decision, if you ask me).  Fortunately, there is at least a poor
> substitute, the browseForFolder method of the Shell.Application
> COM object.  The reason I say poor substitute is that this
> method is evidently buggy and behaves differently on different
> versions of windows to the extent that you have to look at
> different properties and subobjects to get the actual returned
> directory, if any.  This is very nicely documented at:
> http://groups-beta.google.com/group...>
e6737cf0ca1d
> I have solved the original problem (I think), but this residual
> question is still something I'd like to figure out.
>

I didn't realize what you were doing. I'm used to think of php as in server
only so I thought why does it matter what flashes there, nobodys watching...
:)

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-22-05 08:57 PM


Re: Suppress flashing due to shell_exec
"Csaba Gabor" <csaba@z6.com> wrote in message
news:e55ae.14239$0z2.9588@news.chello.at...
> On my WinXP Pro system with PHP 5.0.4 CLI
> (command line interface), if I do
>
> $ver = shell_exec("ver");
>
> it will return the correct value
> (e.g. Microsoft Windows XP [Version 5.1.2600])
> but there will be a flashy thingy on the screen, and
> like the guy said in MIB, I don't like flashy thingies.
>
> How can I get that command to run sychronously
> without showing me the DOS box (CMD window) that
> it uses?  Oh, I should mention that I don't want
> to create a (separate) file to do this.


Why do you want to know what system your server is running? Can't you
hardcode it, and update if you ever change the servers OS?

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-25-05 01:55 AM


Re: Suppress flashing due to shell_exec
Kimmo Laine wrote:
> "Csaba Gabor" <csaba@z6.com> wrote in message
> news:e55ae.14239$0z2.9588@news.chello.at...
> 
>
> Why do you want to know what system your server is running? Can't you
> hardcode it, and update if you ever change the servers OS?

Hardcoding?  Yikes! - always to be avoided.  However, as I
mentioned above, this has nothing to do with a server - I am
using the command line interface (CLI) version of PHP.
This is very useful for automating tasks on PCs if I don't
want to use VBScript.  On my systems, if I double click on a
.PHP file or press enter when it is selected, it gets handed
to the CLI PHP.exe.  Nifty.

The emphasis in this post is not on determining the operating
system (one could also use php_uname() for that), but rather
on hiding the annoying flashingness of the DOS box.

However, the original motivation for wanting to know this was
that I want to have a Dialog Box for selecting a directory (not
a file) on Windows systems and the CommonDialog FileOpen/SaveAs
do not allow you to return a directory (not a very good design
decision, if you ask me).  Fortunately, there is at least a poor
substitute, the browseForFolder method of the Shell.Application
COM object.  The reason I say poor substitute is that this
method is evidently buggy and behaves differently on different
versions of windows to the extent that you have to look at
different properties and subobjects to get the actual returned
directory, if any.  This is very nicely documented at:
http://groups-beta.google.com/group... />
737cf0ca1d
I have solved the original problem (I think), but this residual
question is still something I'd like to figure out.

Csaba

Report this thread to moderator Post Follow-up to this message
Old Post
Csaba Gabor
04-25-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:25 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.