Colorizing Windows command line output from PHP

Download dynwrap.dll from : Then extract it to %systemroot%\system32 directory and then run following command in command line: regsvr32.exe “%systemroot%\system32\dynwrap.dll” You’ll get a success message which means dynwrap.dll is registered. Then you can use it this way : $com = new COM(‘DynamicWrapper’); // register needed features $com->Register(‘kernel32.dll’, ‘GetStdHandle’, ‘i=h’, ‘f=s’, ‘r=l’); $com->Register(‘kernel32.dll’, ‘SetConsoleTextAttribute’, ‘i=hl’, … Read more

Running CMD command in PowerShell

Try this: & “C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\i386\CmRcViewer.exe” PCNAME To PowerShell a string “…” is just a string and PowerShell evaluates it by echoing it to the screen. To get PowerShell to execute the command whose name is in a string, you use the call operator &.