note 75603 added to function.exec
| From: | conrad at osu1 dot php dot net | Date: | Thu, 07 Jun 2007 17:02:43 +0000 |
| Subject: | note 75603 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127274@lists.php.net to get a copy of this message | ||
Windows note: Despite people syaing that you CAN you CANNOT exec a .vbs windows script host (wsh)
file using exec() - you need to execute your vbs file via a "windows link" (.lnk file - a
bog standard shortcut)
ie: I right click and dragged my datapurge.vbs a few pixels to the side and chose "Create
Shortcuts Here" and then deleted the autogenerated "Short cut to datapurge.vbs" and
renamed it merely datapurge.vbs - bear in mind as far as php is concerend it's ACTUALLY called
datapurge.vbs.lnk
however you will need to sleep(); your php page to make sure the .vbs has had time to run if you
intend on using the vbs output (say a file your vbs made) this is becase the .lnk instantly runs and
php immediately continues processing without barely skipping a beat even if the vbs takes yonks to
run.
If you are wondering why anyone would ever WANT to run a .vbs from within .php I can see some
reasons - there are various windows platform objects just not accesible from php. (and most php
programmers know a little .asp though they would say they don't! so asp-a-like .vbs is the
logical choice)
----
Server IP: 69.147.83.197
Probable Submitter: 89.145.205.221
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- https://master.php.net/note/edit/75603
Del: integrated -- https://master.php.net/note/delete/75603/integrated
Del: useless -- https://master.php.net/note/delete/75603/useless
Del: bad code -- https://master.php.net/note/delete/75603/bad+code
Del: spam -- https://master.php.net/note/delete/75603/spam
Del: non-english -- https://master.php.net/note/delete/75603/non-english
Del: in docs -- https://master.php.net/note/delete/75603/in+docs
Del: other reasons-- https://master.php.net/note/delete/75603
Reject -- https://master.php.net/note/reject/75603
Search -- https://master.php.net/manage/user-notes.php