Hi All,
Been lately caught up with a few issues and could not get time to go through the posts here.
I would need help on some scripts. Any help will be highly appreciated.
I need to install a printer by calling a cmd file from a location.
Once the printer is installed I need to capture the image of the Devices and Printers section from the control panel.
The script that I have now is
#to call the batch file
Start-Process -FilePath E:\NullPrinter.cmd -Wait -passthru;$a.ExitCode
To take screenshot
function screenshot([Drawing.Rectangle]$bounds, $path) {
$bmp = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($bmp)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$bmp.Save($path)
$graphics.Dispose()
$bmp.Dispose()
}
The above script isnt working. Can someone please help?