Is it possible to create a Windows shortcut using PHP? -
I am writing a script to clear a group of media broadcasted on my hard drive, and it is still very much Works well at home (on my Mac) as I use simlinks in a directory, to give an impression that everything is held in one place, while the actual data is spread in 4 drives .
Unfortunately, I have to use it on Windows at the workplace, and of course there is no symlink support for PHP 5.3 (and I think Vista needs it when the command-line tool is " Mklink "was already visible).
As an alternative solution, I thought creating a shortcut, but I can not find a way to do this. Is it possible, or am I not considered a better solution?
Thanks for the above reply, I came to know that you can actually call POP from PHP Here's my first draft of a symlink () replacement:
if (! Function_exists ('symlink')) {function symlink ($ target, $ Link) {if (Substr ($ Link, -4, '.lnk')) $ link = '.lnk'; $ Shell = new COM ('WScript.Shell'); $ Shortcut = $ shell-> Createshortcut ($ link); $ Shortcuts- & gt; Target = $ target; $ Shortcut- & gt; Save (); }}
Comments
Post a Comment