i made a little script for run a programs at my PC
when i try to run this script i get this error
Line 22 (File)
If (computername = "Zief") {
If (computername = "Zief") ^ERROR
Unable to parse line.
And Anyone can give me script for get pnpdeviceid?
like this script?
i try to add this script but i always get error
i want to add this script into my progams and make my programs cannot run into different PC
when i try to run this script i get this error
Line 22 (File)
If (computername = "Zief") {
If (computername = "Zief") ^ERROR
Unable to parse line.
[ autoit ]
And Anyone can give me script for get pnpdeviceid?
like this script?
[ autoit ]
Func _getpnpdeviceid($drive, $fullid = 0) $objwmiservice = ObjGet("winmgmts:{impersonationLevel=Impersonate}!\\.\root\cimv2") If NOT IsObj($objwmiservice) Then Return - 1 $coldevice = $objwmiservice.execquery("SELECT * from Win32_LogicalDiskToPartition") $var = "" For $objitem In $coldevice If StringInStr($objitem.dependent, $drive) Then $var = StringTrimLeft($objitem.antecedent, StringInStr($objitem.antecedent, "=")) EndIf Next If NOT $var Then Return - 2 $coldevice = $objwmiservice.execquery("SELECT * from Win32_DiskDriveToDiskPartition") $diskpartition = $var $var = "" For $objitem In $coldevice If StringInStr($objitem.dependent, $diskpartition) Then $var = StringTrimLeft($objitem.antecedent, StringInStr($objitem.antecedent, "=")) EndIf Next If NOT $var Then Return - 3 $coldevice = $objwmiservice.execquery("SELECT * from Win32_DiskDrive") $physicaldrive = StringReplace(StringReplace($var, "\\", "\"), '"', "") $var = "" For $objitem In $coldevice If $objitem.deviceid = $physicaldrive Then $var = $objitem.pnpdeviceid EndIf Next If NOT $var Then Return - 4 If NOT $fullid Then $var = StringTrimLeft($var, StringInStr($var, "\", 0, -1)) Return $var EndFunc If $id <> "ID" Then Exit Else EndIf
i try to add this script but i always get error
i want to add this script into my progams and make my programs cannot run into different PC