Call me...


Hello
T he atheist rejects the claim that there is a
supernatural entity or force that interacts with existence...
Because it is a claim without basis.

Atheism makes no claims whatsoever.
Atheism asserts nothing.
Atheism IS NOT an act or an action
IT IS a position
 It has no objective.
Comparatively / Conversely:
Anti-theism IS an act or an action
 It IS NOT a position
 It has an objective.
Not all ATHEISTS are ANTI-THEIST.
All ANTI-THEISTS are ATHEIST.

Sunday, August 19, 2018

Powershell TWAIN / scan from USB

This is just me being lazy, really...
  1. Plug in USB scanner...
  2. Start Button
  3. Open the 'Devices and Printers' applet
  4. Find the scanner
  5. Right-Click, and 'Start a Scan'

Or -
Write something that will find the scanner, and open the 'Start a Scan' window, when the script is ran...


I enabled the Quick Launch bar, and have this in there as a shortcut - I just changed the icon to a 'scanner'. (from here: %SystemRoot%\System32\SHELL32.dll)


This is the command for the shortcut...
Target:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe –NoProfile -windowstyle hidden -file "C:\Users\Rich\PSScripts\StartScan.ps1"

This line can be ran, to discover the 'Device description' for your device...
(gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)}).Description

Here is the scripts text:
$DeviceDesc = "CanoScan"
$FindTWAIN = (gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Where-Object {($_.Description  -match $DeviceDesc)})
If ($FindTWAIN.Name -match $DeviceDesc){
$DeviceID = ($FindTWAIN.DeviceID).Replace("\","#")
$ClassGuid = $FindTWAIN.ClassGuid
$FullCommand = "`"C:\WINDOWS\system32\rundll32.exe`" fdprint,InvokeTask /ss `"\\?\"
$Params = "`"\\?\"+$DeviceID+"#"+$ClassGuid+"`""
& "C:\WINDOWS\system32\rundll32.exe" fdprint,InvokeTask /ss $Params
}

If ($FindTWAIN.Name -Notmatch $DeviceDesc){
#######################
$MsgBoxInfo = "$DeviceDesc device not found..."
[void] [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::MsgBox($MsgBoxInfo, "OKOnly,SystemModal,Exclamation", "Nothing Found.") | Out-null
 ## Out-null just supresses the 'ok' to the (ISE?) screen, after pressing the OK button.
#######################
}

13 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. A 3D laser scanner can collect millions of data points within a second. It can collect highly accurate and measurable data every time. You can try this service on your construction and manufacturing business. 3D laser scanner Houston, Texas

    ReplyDelete
  3. The AC powered hub draws from external supply (AC socket) and comes with an AC adapter. usb-c adapters

    ReplyDelete
  4. I really love your blog.. Pleasant colors & theme. Did you develop this site yourself? Please reply back as I’m hoping to create my own blog and would like to know where you got this from or just what the theme is called. Appreciate it!
    free

    ReplyDelete
  5. The SD memory card is fast becoming the most popular. A great variety of devices use the SD memory card. This non-volatile flash memory format is used in portable devices such as digital cameras, handheld computers etc.
    https://www.hugdiy.com/sd-card-c-13

    ReplyDelete
  6. Nice,
    Any ideas on how to look at other TWAIN / WIA devices?
    Sometimes the device is connected via Ethernet / WiFi.

    ReplyDelete
  7. Great points there, thanks. And here is another relevant article, maybe someone will find it useful too
    https://cgifurniture.com/3d-product-modeling-companies-furniture-marketing/

    ReplyDelete
  8. Truly accommodating Web journal simply shared much appreciated and I checked more related themes in laser scanning, reverse engineering, pointcloud. Keep updating. 3d laser scanner Denver, Colorado

    ReplyDelete
  9. A 3D laser scanner captures three-dimensional data of an object by using laser lights. The laser lights touched the object physically & capture data by rotating in 360 degrees. A 3D laser scanner can capture data by maintaining 100% accuracy. 3D laser scanner Calgary, Alberta

    ReplyDelete