Invoke $cmd not working

Hi Guys,

I am creating a windows application(winforms) using Powershell for creating custom forms for the printer and to create IE-Page Setup for the respective printer. I am using the following command through powershell 

$cmd = "cscript 'C:\Tools\forms.vbs' -a -n " + '"' + $formname + '"' + " -u inches -h 7.48 -w 7.48 -t 0 -e 0 -b 0 -r 0 " 


Invoke-Expression  $cmd 

Actually when the values of the switches -b & -r are zero, it has to throw error which is happening when running in cmd. But it is not throwing any errors or exception.

Help me ou

June 27th, 2015 2:06am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics