Trouble using COM Object...

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
imc1975
Forum Newbie
Posts: 3
Joined: Fri Sep 16, 2005 3:16 pm

Trouble using COM Object...

Post by imc1975 »

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I have the following script:

Code: Select all

// pararme en el directorio temporal 
chdir ($tmpdir); 

// Habilitar el camino del ejecutable. 
$cmd = 'movescu.exe'; 

$arg = array(); 
$arg[] = '-S'; 
$arg[] = '-aet'; 
$arg[] = 'MyVServer'; 
$arg[] = '-aec'; 
$arg[] = $aec; 
$arg[] = '-aem'; 
$arg[] = 'MyVServer'; 
$arg[] = '+P'; 
$arg[] = '201'; 
$arg[] = 'localhost'; 
$arg[] = '200'; 
$arg[] = basename($destination); 

$cmdline = "cmd /C $cmd ". implode(' ', $arg); 
$WshShell = new COM("WScript.Shell"); 
$oExec = $WshShell->Run($cmdline, 0, true);
It should run a hidden command shell in windows, execute de binary movescu.exe with the params above, wait until it finish, and close the cmd.

I doesn´t. Even when there are a lot o calls like this one after and before, the one that doesn't works is this one.

Can any buddy help me?


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're lucky you're new here.. cross-posting and not using bbcode for posting code... that's two strikes in one.... ;)

Are you sure that command works?
Post Reply