I'm getting this error: Column count doesn't match value count at row 1 - mysql-error-1064

Column count doesn't match value count at row 1
This is the code:
/* execute SQL INSERT command */
$sql2 = "INSERT INTO form
(datesubmit,uitmid, idnumber, roomnumber, collegename, studname, phone, part,
program, faculty, cgpa, position1, position2, email, vehicle,
advisorname, hpnumberadvisor, emailadvisor, academic, oku,
date, sex, religion, address, fathername, fatherhp,
salfather, mothername, motherhp, salmother, namesibling1, ipt1, namesibling2,
ipt2, namesibling3, ipt3, namesibling4, ipt4, namesibling5, ipt5, namesibling6, ipt6, namesibling7, ipt7,
namesibling8, ipt8, namesibling9, ipt9, namesibling10, ipt10)
VALUES (now(),'" . $uitmid . "', '" . $idnumber . "', '" . $roomnumber . "', '" . $collegename . "',
'" . $studname . "', '" . $phone . "', '" . $part . "', '" . $program . "', '" . $faculty . "',
'" . $cgpa . "', '" . $position1 . "', '" . $position2 . "', '" . $email . "', '" . $vehicle . "',
'" . $advisorname . "', '" . $hpnumberadvisor . "', '" . $emailadvisor . "', '" . $academic . "', '" . $oku . "',
'" . $date . "', '" . $sex . "',
'" . $religion . "', '" . $address . "', '" . $fathername . "', '" . $fatherhp . "', '" . $salfather . "', '" . $mothername . "',
'" . $motherhp . "', '" . $salmother . "', '" . $namesibling1 . "', '" . $ipt1 . "',
'" . $namesibling2 . "', '" . $ipt2 . "', '" . $namesibling3 . "', '" . $ipt3 . "',
'" . $namesibling4 . "', '" . $ipt4 . "', '" . $namesibling5 . "','" . $ipt5 . "' ,'" . $namesibling6 . "' ,'" . $ipt6 . "',
'" . $namesibling7 . "' ,'" . $ipt7 . "' ,'" . $namesibling8 . "' ,'" . $namesibling9 . "' ,'" . $ipt9 . "' ,'" . $namesibling10 . "' ,'" . $ipt10 . "')";
mysql_query($sql2) or die ("Error: " . mysql_error());

The query is missing a values for ipt8. The error occurred because the values being inserted didn't match the number of fields specified in the table.

Related

Windows : make request on specific interface

I have 3 network interface plug in my pc (windows). I just wonder is there a easy way to make a http request from specific interface ?
I try curl but it seem not support windows.
Description here : https://curl.se/libcurl/c/CURLOPT_INTERFACE.html
libcurl does not support using network interface names for this option on Windows.
Here is my network details :
Ethernet adapter NETW 001:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::8a7:9368:bb58:1883%18
IPv4 Address. . . . . . . . . . . : 192.168.5.252
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.5.1
Ethernet adapter NETW 002:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::e4e0:bc83:3e56:8de0%13
IPv4 Address. . . . . . . . . . . : 192.168.78.252
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.78.1
Ethernet adapter NETW 003:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::f0e7:c451:335:8587%12
IPv4 Address. . . . . . . . . . . : 192.168.1.252
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
It is not clear what stops you from using the specific interface by its IPv4 Address. The same manual:
Pass a char * as parameter. This sets the interface name to use as outgoing network interface. The name can be an interface name, an IP address, or a host name.
If the parameter starts with "host!" it is treated as either an IP address or a hostname.
#if 1
curl_easy_setopt(curl, CURLOPT_INTERFACE, "192.168.78.252");
#else
curl_easy_setopt(curl, CURLOPT_INTERFACE, "host!192.168.78.252");
#endif

How to resolve windows container IP from DNS on Windows 10 using Docker for Windows?

How, from a Windows 10 host, can I access containers through their hostnames?
For example, if I have two containers
container-a
container-b
I want to be able to use this command from the host and have it resolve to the IP address of container-a:
ping container-a
I'm running the latest stable Docker for Windows on Windows 10 using the Windows Container mode.
I'm using the default "nat" network type, with a subnet of 172.20.16.0/20
From the host machine, the docker NIC details:
Ethernet adapter vEthernet (HNS Internal NIC):
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #2
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 172.20.16.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
and the physical NIC details:
Ethernet adapter Ethernet:
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.1.173(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::1:1%5
192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DNS Servers . . . . . . . . . . . : 192.168.1.1
NetBIOS over Tcpip. . . . . . . . : Enabled
Does the host NIC need to have the docker NIC's IP in it's DNS list?

Issues with starting virtual device with genymotion and virtualBox

I am not able to start my Genymotion virtual device with virtual box..every time i try to start my device It shows following error message:
when i tried to start my virtual device from my virtualbox It has the following error:
Detailed List of all my full ip configuration:
C:\Users\beetel>ipconfig/all
>
> Windows IP Configuration
>
> Host Name . . . . . . . . . . . . : beetel-PC Primary Dns Suffix
> . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP
> Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . .
> . : No
>
> Ethernet adapter Local Area Connection 2:
>
> Connection-specific DNS Suffix . : Description . . . . . . . .
> . . . : Microsoft Loopback Adapter Physical Address. . . . . . . .
> . : 02-00-4C-4F-4F-50 DHCP Enabled. . . . . . . . . . . : Yes
> Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . .
> . . . : fe80::e47e:753b:4c29:a5f1%18(Preferred) Autoconfiguration
> IPv4 Address. . : 169.254.165.241(Preferred) Subnet Mask . . . . .
> . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . :
> DHCPv6 IAID . . . . . . . . . . . : 369229900 DHCPv6 Client DUID. .
> . . . . . . : 00-01-00-01-15-89-26-AE-10-78-D2-16-02-DE
>
> DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
> fec0:0:0:ffff::2%1
> fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled
>
> Wireless LAN adapter Lenovo Easyplus Hotspot :
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft Virtual WiFi Miniport Adapter Physical Address. . . .
> . . . . . : 00-E0-4C-04-5F-F1 DHCP Enabled. . . . . . . . . . . :
> Yes Autoconfiguration Enabled . . . . : Yes
>
> Wireless LAN adapter Wireless Network Connection:
>
> Connection-specific DNS Suffix . : Description . . . . . . . .
> . . . : Leoxsys LEO-150N Wireless LAN 802.11n USB
> 2.0 Network Adapter Physical Address. . . . . . . . . : 00-E0-4C-04-5F-F1 DHCP Enabled. . . . . . . . . . . : Yes
> Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . .
> . . . : fe80::cce8:4e5f:3c3c:c5a5%12(Preferred) IPv4 Address. . . .
> . . . . . . . : 192.168.1.3(Preferred) Subnet Mask . . . . . . . .
> . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Thursday,
> 4 August 2016 5:20:45 PM Lease Expires . . . . . . . . . . :
> Sunday, 7 August 2016 5:20:44 PM Default Gateway . . . . . . . . .
> : 192.168.1.1 DHCP Server . . . . . . . . . . . : 192.168.1.1
> DHCPv6 IAID . . . . . . . . . . . : 201384012 DHCPv6 Client DUID. .
> . . . . . . : 00-01-00-01-15-89-26-AE-10-78-D2-16-02-DE
>
> DNS Servers . . . . . . . . . . . : 52.35.184.148
> 8.8.8.8 NetBIOS over Tcpip. . . . . . . . : Enabled
>
> Ethernet adapter Local Area Connection:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Realtek PCIe FE Family Controller Physical Address. . . . . . .
> . . : 10-78-D2-16-02-DE DHCP Enabled. . . . . . . . . . . : Yes
> Autoconfiguration Enabled . . . . : Yes
>
> Ethernet adapter VirtualBox Host-Only Network:
>
> Connection-specific DNS Suffix . : Description . . . . . . . .
> . . . : VirtualBox Host-Only Ethernet Adapter Physical Address. . .
> . . . . . . : 08-00-27-00-28-2A DHCP Enabled. . . . . . . . . . . :
> No Autoconfiguration Enabled . . . . : Yes Link-local IPv6
> Address . . . . . : fe80::d159:6ed4:c7c:c02f%20(Preferred) IPv4
> Address. . . . . . . . . . . : 198.168.56.1(Preferred) Subnet Mask
> . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . .
> . : DHCPv6 IAID . . . . . . . . . . . : 268959783 DHCPv6 Client
> DUID. . . . . . . . : 00-01-00-01-15-89-26-AE-10-78-D2-16-02-DE
>
> DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
> fec0:0:0:ffff::2%1
> fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled
>
> Ethernet adapter VirtualBox Host-Only Network #4:
>
> Connection-specific DNS Suffix . : Description . . . . . . . .
> . . . : VirtualBox Host-Only Ethernet Adapter #4 Physical Address.
> . . . . . . . . : 08-00-27-00-F4-D4 DHCP Enabled. . . . . . . . . .
> . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6
> Address . . . . . : fe80::4d07:55a8:8615:4646%30(Preferred) IPv4
> Address. . . . . . . . . . . : 192.168.21.2(Preferred) Subnet Mask
> . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . .
> . . : DHCPv6 IAID . . . . . . . . . . . : 705167399 DHCPv6
> Client DUID. . . . . . . . : 00-01-00-01-15-89-26-AE-10-78-D2-16-02-DE
>
> DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
> fec0:0:0:ffff::2%1
> fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled
>
> Tunnel adapter isatap.{4A68A292-E958-49F9-ADBB-B0A6B2E00AC2}:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft ISATAP Adapter Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter Teredo Tunneling Pseudo-Interface:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Teredo Tunneling Pseudo-Interface Physical Address. . . . . . .
> . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . :
> No Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter isatap.{D8400DF5-8661-42E9-AF74-66AC888DA466}:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft ISATAP Adapter #2 Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter isatap.{FEF87388-CE30-4169-8799-C1EDEBF97301}:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft ISATAP Adapter #3 Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter isatap.{EE6EC7B1-AA13-43F4-9369-16F2EB5820D1}:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft ISATAP Adapter #4 Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter isatap.{925F633E-80F4-4D9B-926B-85932E0FAF48}:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft ISATAP Adapter #5 Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter isatap.{F16B7224-D444-47AB-95DB-CC3EEDD96739}:
>
> Media State . . . . . . . . . . . : Media disconnected
> Connection-specific DNS Suffix . : Description . . . . . . . . . .
> . : Microsoft ISATAP Adapter #7 Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes
>
> Tunnel adapter 6TO4 Adapter:
>
> Connection-specific DNS Suffix . : Description . . . . . . . .
> . . . : Microsoft 6to4 Adapter Physical Address. . . . . . . . . :
> 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No
> Autoconfiguration Enabled . . . . : Yes IPv6 Address. . . . . . . .
> . . . : 2002:c6a8:3801::c6a8:3801(Preferred) Default Gateway . . .
> . . . . . . : 2002:c058:6301::c058:6301 DNS Servers . . . . . . . .
> . . . : fec0:0:0:ffff::1%1
> fec0:0:0:ffff::2%1
> fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Disabled
I am using wifi on my system...
I tried every possible solution listed on stackoverflow related to genymotion error, virtualbox error and dhcp error or google solutions ...but none work..
EDIT 1:
Some Solutions I have Tried:
manually entering IP addresses, network masks and DHCP server as described on several posts (ie 192.168.56.1 etc)
deleting network adapters on global options in virtualbox so they get recreated upon start of genymotion.
installing a new VM for a generic phone instead of custom phone.
deleting virtualbox and genymotion and reinstalling from scratch + downloading all VMs again.
freeing up RAM to make sure I have most RAM available.
changing system RAM resources in VM configuration to 1024 or 2048 or increasing it as far as I could.
confirmed hyper-V is disabled from windows so that is NOT the issue.
setting "promiscuous mode" to: "allow VMs", or "deny", or "allow everything".
repairing VirtualBox
Few Links i followed to solution:
Not able to start genymotion device
virtualbox-kernel requires an x86-64cpu but only detected an i686 cpu
System and software Details:
CPU type:32 bit,intel
Host Os: windows 7 32 bit
Guest Os: windows 10 32 bit
Oracle Virtual Box version 5.0.26 r108824
Genymotion version:2.7.2 Android studio:2.1.1
Edit 2:
While looking for solution i found that this problem might be due to missing
files during installation of VirtualBox I found that "VirtualBox-5.0.26-r108824-MultiArch_x86.msi" was missing so i manged to repair VirtualBox ..but still no Progress with solution
Please help..!!!! ....I am stuck badly android studio avd is also not working.Please either suggest some alternatives..or solution to problem.
Your CPU type is 32 bit but you are trying to launch 64 bit kernel. That's all. Just switch to 64 bit CPU. OS can stay 32bit.
UPD.
As far as I see, genymotion is now available only for 64 bit CPU:
As for alternatives... If you can't afford new CPU, you can try debugging on physical device (USB connected Android phone) - it's cheap, simple and efficient.

IP changes while pinging IPV6 address [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have made a small demo program to sniff IPV6 packets . I am trying to ping the said machine from a remote one . My site local address is "FEC0..." and Link local address is "FE80..." . However , when i ping the machine and view the destination address of the ping packet , the address is sometimes "FeC0..." , sometimes "Fe80..." and even "FF02.." at times. I cannot understand why it would ping to a IP different from the specified one. I specify the destination address as "FEC0...".
Can someone please explain this ?
Here is my output of "ipconfig /all"
Windows IP Configuration
Host Name . . . . . . . . . . . . : PT49
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Broadcast
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection 3:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
Physical Address. . . . . . . . . : 38-60-77-87-02-4B
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.2.249
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : fec0::1:3a60:77ff:fe87:24b%1
IP Address. . . . . . . . . . . . : fe80::3a60:77ff:fe87:24b%4
Default Gateway . . . . . . . . . : 192.168.2.1
DNS Servers . . . . . . . . . . . : 192.168.0.96
fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : FF-FF-FF-FF-FF-FF-FF-FF
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : fe80::5445:5245:444f%5
Default Gateway . . . . . . . . . :
NetBIOS over Tcpip. . . . . . . . : Disabled
Tunnel adapter Automatic Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Automatic Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : C0-A8-02-F9
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : fe80::5efe:192.168.2.249%2
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Disabled
Thanks in advance
Strange results are not surprising as you don't really have IPv6 connectivity (I'm not seeing any global unicast address in your ipconfig), get a tunnel+subnet from SixXS and try again :)

Get List of Printers from Windows Server

I'd like to query a Windows server that is publishing a set of printers programatically and find out
what printers are available on the remote machine (name and description) without installing the printers locally
the name of the printer driver respectively
I'd like to be able to process the result in some scripting language like AutoIT. Which options do I have?
This should help (although it's VBS):
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "Select printerName, serverName from " _
& " 'LDAP://DC=fabrikam,DC=com' where objectClass='printQueue'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Wscript.Echo "Printer Name: " & objRecordSet.Fields("printerName").Value
Wscript.Echo "Server Name: " & objRecordSet.Fields("serverName").Value
objRecordSet.MoveNext
Loop
More information you can find on this page.
If you really want it in AutoIt you can try this forum thread which happens to have some translation of the code above.
Basically if you type in 'printers' on autoit forum in search field you will get lots of information about it. Far better then me pasting it here :-)
As mentioned in comment if you have no AD you should use Scriptomatic to generate AutoIt WMI code for example:
; Generated by AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer & #CRLF
$Output = $Output & "==========================================" & #CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PrinterDriver", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "Caption: " & $objItem.Caption & #CRLF
$Output = $Output & "ConfigFile: " & $objItem.ConfigFile & #CRLF
$Output = $Output & "CreationClassName: " & $objItem.CreationClassName & #CRLF
$Output = $Output & "DataFile: " & $objItem.DataFile & #CRLF
$Output = $Output & "DefaultDataType: " & $objItem.DefaultDataType & #CRLF
$strDependentFiles = $objItem.DependentFiles(0)
$Output = $Output & "DependentFiles: " & $strDependentFiles & #CRLF
$Output = $Output & "Description: " & $objItem.Description & #CRLF
$Output = $Output & "DriverPath: " & $objItem.DriverPath & #CRLF
$Output = $Output & "FilePath: " & $objItem.FilePath & #CRLF
$Output = $Output & "HelpFile: " & $objItem.HelpFile & #CRLF
$Output = $Output & "InfName: " & $objItem.InfName & #CRLF
$Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & #CRLF
$Output = $Output & "MonitorName: " & $objItem.MonitorName & #CRLF
$Output = $Output & "Name: " & $objItem.Name & #CRLF
$Output = $Output & "OEMUrl: " & $objItem.OEMUrl & #CRLF
$Output = $Output & "Started: " & $objItem.Started & #CRLF
$Output = $Output & "StartMode: " & $objItem.StartMode & #CRLF
$Output = $Output & "Status: " & $objItem.Status & #CRLF
$Output = $Output & "SupportedPlatform: " & $objItem.SupportedPlatform & #CRLF
$Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & #CRLF
$Output = $Output & "SystemName: " & $objItem.SystemName & #CRLF
$Output = $Output & "Version: " & $objItem.Version & #CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_PrinterDriver" )
Endif
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc
There's lot more classes in WMI for pritners:
Win32_PrinterDriver
Win32_PrinterDriverDll
Win32_PrinterSetting
Win32_PrinterShare
Win32_PrintJob
Win32_Printer
Win32_PrinterConfiguration
Another example:
; Generated by AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer & #CRLF
$Output = $Output & "==========================================" & #CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "Attributes: " & $objItem.Attributes & #CRLF
$Output = $Output & "Availability: " & $objItem.Availability & #CRLF
$strAvailableJobSheets = $objItem.AvailableJobSheets(0)
$Output = $Output & "AvailableJobSheets: " & $strAvailableJobSheets & #CRLF
$Output = $Output & "AveragePagesPerMinute: " & $objItem.AveragePagesPerMinute & #CRLF
$strCapabilities = $objItem.Capabilities(0)
$Output = $Output & "Capabilities: " & $strCapabilities & #CRLF
$strCapabilityDescriptions = $objItem.CapabilityDescriptions(0)
$Output = $Output & "CapabilityDescriptions: " & $strCapabilityDescriptions & #CRLF
$Output = $Output & "Caption: " & $objItem.Caption & #CRLF
$strCharSetsSupported = $objItem.CharSetsSupported(0)
$Output = $Output & "CharSetsSupported: " & $strCharSetsSupported & #CRLF
$Output = $Output & "Comment: " & $objItem.Comment & #CRLF
$Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & #CRLF
$Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & #CRLF
$Output = $Output & "CreationClassName: " & $objItem.CreationClassName & #CRLF
$strCurrentCapabilities = $objItem.CurrentCapabilities(0)
$Output = $Output & "CurrentCapabilities: " & $strCurrentCapabilities & #CRLF
$Output = $Output & "CurrentCharSet: " & $objItem.CurrentCharSet & #CRLF
$Output = $Output & "CurrentLanguage: " & $objItem.CurrentLanguage & #CRLF
$Output = $Output & "CurrentMimeType: " & $objItem.CurrentMimeType & #CRLF
$Output = $Output & "CurrentNaturalLanguage: " & $objItem.CurrentNaturalLanguage & #CRLF
$Output = $Output & "CurrentPaperType: " & $objItem.CurrentPaperType & #CRLF
$Output = $Output & "Default: " & $objItem.Default & #CRLF
$strDefaultCapabilities = $objItem.DefaultCapabilities(0)
$Output = $Output & "DefaultCapabilities: " & $strDefaultCapabilities & #CRLF
$Output = $Output & "DefaultCopies: " & $objItem.DefaultCopies & #CRLF
$Output = $Output & "DefaultLanguage: " & $objItem.DefaultLanguage & #CRLF
$Output = $Output & "DefaultMimeType: " & $objItem.DefaultMimeType & #CRLF
$Output = $Output & "DefaultNumberUp: " & $objItem.DefaultNumberUp & #CRLF
$Output = $Output & "DefaultPaperType: " & $objItem.DefaultPaperType & #CRLF
$Output = $Output & "DefaultPriority: " & $objItem.DefaultPriority & #CRLF
$Output = $Output & "Description: " & $objItem.Description & #CRLF
$Output = $Output & "DetectedErrorState: " & $objItem.DetectedErrorState & #CRLF
$Output = $Output & "DeviceID: " & $objItem.DeviceID & #CRLF
$Output = $Output & "Direct: " & $objItem.Direct & #CRLF
$Output = $Output & "DoCompleteFirst: " & $objItem.DoCompleteFirst & #CRLF
$Output = $Output & "DriverName: " & $objItem.DriverName & #CRLF
$Output = $Output & "EnableBIDI: " & $objItem.EnableBIDI & #CRLF
$Output = $Output & "EnableDevQueryPrint: " & $objItem.EnableDevQueryPrint & #CRLF
$Output = $Output & "ErrorCleared: " & $objItem.ErrorCleared & #CRLF
$Output = $Output & "ErrorDescription: " & $objItem.ErrorDescription & #CRLF
$strErrorInformation = $objItem.ErrorInformation(0)
$Output = $Output & "ErrorInformation: " & $strErrorInformation & #CRLF
$Output = $Output & "ExtendedDetectedErrorState: " & $objItem.ExtendedDetectedErrorState & #CRLF
$Output = $Output & "ExtendedPrinterStatus: " & $objItem.ExtendedPrinterStatus & #CRLF
$Output = $Output & "Hidden: " & $objItem.Hidden & #CRLF
$Output = $Output & "HorizontalResolution: " & $objItem.HorizontalResolution & #CRLF
$Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & #CRLF
$Output = $Output & "JobCountSinceLastReset: " & $objItem.JobCountSinceLastReset & #CRLF
$Output = $Output & "KeepPrintedJobs: " & $objItem.KeepPrintedJobs & #CRLF
$strLanguagesSupported = $objItem.LanguagesSupported(0)
$Output = $Output & "LanguagesSupported: " & $strLanguagesSupported & #CRLF
$Output = $Output & "LastErrorCode: " & $objItem.LastErrorCode & #CRLF
$Output = $Output & "Local: " & $objItem.Local & #CRLF
$Output = $Output & "Location: " & $objItem.Location & #CRLF
$Output = $Output & "MarkingTechnology: " & $objItem.MarkingTechnology & #CRLF
$Output = $Output & "MaxCopies: " & $objItem.MaxCopies & #CRLF
$Output = $Output & "MaxNumberUp: " & $objItem.MaxNumberUp & #CRLF
$Output = $Output & "MaxSizeSupported: " & $objItem.MaxSizeSupported & #CRLF
$strMimeTypesSupported = $objItem.MimeTypesSupported(0)
$Output = $Output & "MimeTypesSupported: " & $strMimeTypesSupported & #CRLF
$Output = $Output & "Name: " & $objItem.Name & #CRLF
$strNaturalLanguagesSupported = $objItem.NaturalLanguagesSupported(0)
$Output = $Output & "NaturalLanguagesSupported: " & $strNaturalLanguagesSupported & #CRLF
$Output = $Output & "Network: " & $objItem.Network & #CRLF
$strPaperSizesSupported = $objItem.PaperSizesSupported(0)
$Output = $Output & "PaperSizesSupported: " & $strPaperSizesSupported & #CRLF
$strPaperTypesAvailable = $objItem.PaperTypesAvailable(0)
$Output = $Output & "PaperTypesAvailable: " & $strPaperTypesAvailable & #CRLF
$Output = $Output & "Parameters: " & $objItem.Parameters & #CRLF
$Output = $Output & "PNPDeviceID: " & $objItem.PNPDeviceID & #CRLF
$Output = $Output & "PortName: " & $objItem.PortName & #CRLF
$strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0)
$Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & #CRLF
$Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & #CRLF
$strPrinterPaperNames = $objItem.PrinterPaperNames(0)
$Output = $Output & "PrinterPaperNames: " & $strPrinterPaperNames & #CRLF
$Output = $Output & "PrinterState: " & $objItem.PrinterState & #CRLF
$Output = $Output & "PrinterStatus: " & $objItem.PrinterStatus & #CRLF
$Output = $Output & "PrintJobDataType: " & $objItem.PrintJobDataType & #CRLF
$Output = $Output & "PrintProcessor: " & $objItem.PrintProcessor & #CRLF
$Output = $Output & "Priority: " & $objItem.Priority & #CRLF
$Output = $Output & "Published: " & $objItem.Published & #CRLF
$Output = $Output & "Queued: " & $objItem.Queued & #CRLF
$Output = $Output & "RawOnly: " & $objItem.RawOnly & #CRLF
$Output = $Output & "SeparatorFile: " & $objItem.SeparatorFile & #CRLF
$Output = $Output & "ServerName: " & $objItem.ServerName & #CRLF
$Output = $Output & "Shared: " & $objItem.Shared & #CRLF
$Output = $Output & "ShareName: " & $objItem.ShareName & #CRLF
$Output = $Output & "SpoolEnabled: " & $objItem.SpoolEnabled & #CRLF
$Output = $Output & "StartTime: " & WMIDateStringToDate($objItem.StartTime) & #CRLF
$Output = $Output & "Status: " & $objItem.Status & #CRLF
$Output = $Output & "StatusInfo: " & $objItem.StatusInfo & #CRLF
$Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & #CRLF
$Output = $Output & "SystemName: " & $objItem.SystemName & #CRLF
$Output = $Output & "TimeOfLastReset: " & WMIDateStringToDate($objItem.TimeOfLastReset) & #CRLF
$Output = $Output & "UntilTime: " & WMIDateStringToDate($objItem.UntilTime) & #CRLF
$Output = $Output & "VerticalResolution: " & $objItem.VerticalResolution & #CRLF
$Output = $Output & "WorkOffline: " & $objItem.WorkOffline & #CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
Else
Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Printer" )
Endif

Resources