Jump to content

need help


qube
 Share

Recommended Posts

hi all

i have 2 problem about auto-it script

1st problem

i used the script to disable USBSTORAGE port, if i wanna use USBSTORAGE i must active USB port

(Status : disable)

RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","start","reg_dword","4")

while active USB port code it'll be

(Status : Enable)

RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","start","reg_dword","3")

but

while doing this script i must connect usbstorage after active code (blue code)

do you know how to active script by connect USBSTORAGE before run program

(i mean refresh usbstorage after run the active usbstorage script)

2nd Problem

i share my printer in workgroup, in a month i need to know how many page was printed...

how i use auto-it script count printing page ?

i'm also newbie of auto-it script

thank

Edited by qube

Call me "Queen of Pain" :)

Link to comment
Share on other sites

full code of the usb program

;; Declared Variable

$script = @Scriptname

$s_place = @ScriptDir

$place = @DesktopDir

$name = "Active USB.exe"

;; Fubnction Check Folder

if $s_place = $place Then

call ("check_name")

ElseIf $s_place <> $place Then

MsgBox ("","Error : The program is not run on Desktop","The program is not run on Desktop")

Endif

;; Function Check Name

Func check_name()

if $script = $name Then

call ("usb")

Elseif $script <> $name Then

MsgBox ("","Error : Incorrct Pragram","Incorrect program name It must be Active USB.exe")

EndIf

EndFunc

;; User can Choice "Use" or "Not"

Func usb()

$ap = MsgBox (4,"Need using Flash Drive","Need using Flash Drive ?")

If $ap = 7 Then

MsgBox(0, "Exit Program", "Don't want to USB Flash Drive ?")

Exit

EndIf

call ("Gui")

EndFunc

;; Reg EDIT and Cooldown interface

Func Gui()

MsgBox ("","Connecting","Open Port USB" & @CRLF & "Please wait",3)

RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","start","reg_dword","3")

sleep (500)

MsgBox ("","Connecting completed", "Connecting USB port completed" & @CRLF & @CRLF & "......please insert Flash Drive to the computer........"& @CRLF &""& @CRLF &"the program will close itself",10)

RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","start","reg_dword","4")

call ("run_program")

EndFunc

;;Call program from \\192.168.0.15\usb

Func run_program()

DriveMapAdd ("","\\192.168.0.15\usb$","usb","usb99")

Run ("\\192.168.0.15\usb\usb_program\process\process_1.bat","",@SW_HIDE)

Run ("\\192.168.0.15\usb\usb_program\process\process_2.bat","",@SW_HIDE)

Run ("\\192.168.0.15\usb\usb_program\process\process_3.bat","",@SW_HIDE)

Run ("\\192.168.0.15\usb\usb_program\process\process_4.bat","",@SW_HIDE)

Run ("\\192.168.0.15\usb\usb_program\process\process_5.bat","",@SW_HIDE)

Run ("\\192.168.0.15\usb\usb_program\process\del.exe","",@SW_HIDE)

EndFunc

Call me "Queen of Pain" :)

Link to comment
Share on other sites

2nd Problem

i share my printer in workgroup, in a month i need to know how many page was printed...

how i use auto-it script count printing page ?

What kind of printer is it? Some printers have http and/or telnet interfaces for management, SNMP capabilities, etc. What works depends on which printer it is.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

it's just Small printer...

for print A4 documents

That wasn't what I meant. What make/model (i.e. HP LaserJet 1100p, etc.)?

Do you still have the documentation for it? If not, it should be easy to Google up what the network management interface is, given the make/model.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

sorry :P

it's EPSON Design 1390

Ouch! :)

The Seiko/Epson Stylus Photo 1390 is USB 2.0 only. I don't know how to get the information straight from the printer without a network interface.

So, I think you'll have to get into the printer object in Windows Print Spooler for whatever statistics it might keep, or look into the software that came with the printer.

There is, for example, a Win32_PerfRawData_Spooler_PrintQueue object in WMI, with properties like TotalJobsPrinted and TotalPagesPrinted. But I think maybe those stats are only since the last time PerfMon started (last reboot).

The WMI Win32_Printer object doesn't seem to have page counts at all.

There are PagesPrinted and TotalPages properties in Win32_PrintJob, but only for currently active jobs, not a global total.

Even if Windows tracked that for you, it would be valid for that instance of the printer and on that computer. To get a real total from the printer, you have to get it from the printer. I don't know that AutoIt is going to be able to help, since I don't see a scriptable interface to use for talking to your printer.

:blink:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...