UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Run Wscript From Php    
 
   
ScorpDevil
post Jun 28 2018, 09:33 AM
Post#1



Posts: 637
Joined: 3-June 11
From: Miami, FL


Hi Guys -

I'm running a php script as follow:
CODE
    $obj = NEW COM('WScript.Shell');
    //
    if (is_object($obj)) {
        //
        $cmd = 'wscript "C:\dir\subdir\move_file.vbs"';
        //
        $obj->Run('cmd /C '.$cmd, 0, $wait);
        //
    } else {
        //
        echo 'can not create wshell object';
        //
    }
    //
    $obj = null;
    //

The vbs simply creates a copy of the a file in another location. Works perfectly when I hard code the file location and the destination folder.
But I can't make it work passing the source and destination as parameters

Bottom line, How to build my $cmd with the parameters?!

I tried the following but no luck
CODE
    $cmd = 'wscript ""C:\dir\subdir\move_file.vbs ';
        $cmd = $cmd."/From:".Chr(34).Chr(34)."$fFile".Chr(34).Chr(34)." ";
        $cmd = $cmd."/To:".Chr(34).Chr(34)."$tFile".Chr(34).Chr(34).Chr(34).Chr(34);


Thanks a lot for the help
SD
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd October 2019 - 12:11 PM