Jump to content

mimo78

Active Members
  • Posts

    20
  • Joined

  • Last visited

About mimo78

  • Birthday 02/02/1978

Profile Information

  • Location
    Denmark, Viborg

mimo78's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. you are not the only dummy. I have several printers to monitor and this post sound very usefull. (HP, Xerox, Brother and Cannon printers once I learn how the communication works, I plan on making an app that monitors these printers for tonerstatus and other maintainance (drum, fuser etz) brunal's code for the xerox return some values for my xerox (phaser 6360n) which is colour istead of black. (nut sure for what but proberbly black toner) So I start working on deciffering the cmd block of code. Where did you all get those blocks of codes???? So far I understand that: the 1st byte is 0x30 and the whole thing is terminated by a 0x0500 (null) and that the OID string is put just before the termination(null) this page helped me a bit to understand whats going on, maybe some of you can "deciffer" some more information, and teach the rest of us. http://www.henrys.de/daniel/index.php?cmd=...insock/SNMP.HTM Regarding MIB: I used ireasoning MIB browser (you can load MIBS into it) - I downloaded a MIB from xerox and loaded it into the browser - it lets you do a walk to (makes all the querys in the mib to the device) it didn't tell me there to find the remaining toner for a specific colour yet, but then again I don't even know how to make that query yet either. hopefully some of us will get some thing out of all this.. best regards MiMo
  2. Is there a way to make a window always active??? The reason is I made a lot of installers for the applications we have, mostly adobe software, becasue their ways of doing things don't work for me and many others. lately I have made my cs3 master class "1 click installer" My problem with thise install scripts is that they might lose focus (for instance someone put in a mic in their soundcard and the soundcard software pops up asking if he put it in the right jack) now my install script is sending a lot of commands, but the window it was intended to don't listen, and therefor doesn't recive. (becasue its not active) if you make a scipt that opens notepad, waits for 2 sec and then writes some stuff, if you click somewhere else in those 2 seconds it will not send this to notepad, but make a "dung" sound instead. I searched but didn't found so: is there a way in autoit to make a window keeping focus? is there a script or function,udf that does this? It would greatly improve my unattended install scripts best regards mimo78
  3. Is it possible to replace strings while reading stdoutread. I have some chars that is replaced with boxes, because stdoutread can't find out what to do with them. so is it possible to do a stringreplace or stringregreplace while or before passing to stdout ?
  4. tryed that, but that only shows the current workgroup I am in, not all the workgroups but thanx anyway
  5. Can someone tell me how to put all my workgroups in an array?!? net view /domain - lists all the workgroups and I want to put them all in an array
  6. How do I pass a variable to a function, when using guionevent mode?!?
  7. I found the soulution to my problem: 1 line in cmd file @echo off don't use ANY other line with echo all my cmds are now stripped down to 3 lines: @echo off start wait //server/deploy/program.exe exit the problem in my case was the cmd scripts I made and used, not the autoit script So begin there !
  8. 1 and a haf day I spend debuging my code. while it was my cmd script all along, when i first found the problem and didn't find the cause I tryed every thing. All along it was my cmd files that got the service on the remote machine halted. it turns out that when I added a @echo off and NO echo lines in script it WORKS pling I did turn off echo, but didn't remove the echo lines telling I am now installing this for you, bla bla bla Let this be a leason for all: find out WHATS wrong, then find out WHY wrong then walking that path the soulution WILL come to you somehow.....
  9. I am having trouble with psexec from sysinternals(now microsoft) and I was wondering if anyone had the same experience. I have a script that instructs a remote machine copy a cmd script and then execute it (the -c switch) I had tested it first with an exe and there is no problem with the exe files. But when using cmd files the remote host doesn't terminate psexecsvc.exe and therefor my script never get something back telling it that the command was executed and we can quit. it just keeps running the psecx process until i terminate it manualy on the remote host (after that my script on the controlong machine stops the scrip correctly) when i do the same thing as my script in a commando promt instead there is no error?!? anyone working with psexec expirienced this and know the cause or just the solution? The run command I use in script: $command = "psexec " &$host &" -u " &$username &" -p " &$password &" -i -c " &$serverpath &"\" &$program $run = run($command, "",@SW_MAXIMIZE, 2 + 4) host is the remote host, username is username, password is password, serverpath is the path to the server, program is the cmd (or exe) to copy and start. The run command in my command promt: psexec \\test-pc -u Admin -p fejlkode47 -i -c \\server\programmer\!deploy\testprog.cmd from command prompt success, from script failure: why?!? anuone anyida?!? plz help
  10. update: I found something interesting that has to do with psexec when i ran cmd files my autoit application just keeps running the script because the loop never is exited. The psexecsvc.exe keeps running on the remote host. When I terminate the process on the remote host, my program exits (as it should, although with an error saying error communicating with psexec service on test-pc. So: when I start the remote job by a command prompt there is no problem When I start the remote job by my scrips something goes wrong and communication is lost. does this tell anybode something?
  11. well I am not trying to send this code in my cmd. I made a simple "show this window for 15 sec and exit" test program(EXE), and it worked. I was able to remote execute it on an other machine. I thaught that was it, but when I used one of my cmd installation files it faild. I have the installation of acrobat reader in a cmd file and it did run on the remote host. But the running window on the "calling host" that startet the remote job never exited. I then wrapped my "15 sec test" exe into a cmd file with a start /wait \\server\test.exe. same result. The program ran and exitet on the remote host, but never finishes on the host that initiated the program. So why does exe work and cmd not? is it my run line thats wrong? is it my cmd that could be missing something? is is the fact that when i call a cmd script on a remote host (or local for that matter) the unc path is ignored and defaults to a windows dir. I thing I have excluded the last, cus I ran a regedit that disables unc path checking when running cmd scripts (acording to some kb article so it should be ok) furthermore I used pushd and popd commands witch adds a working dir path to you scrip (again compensating for unc path) PSexec: (the tool I run) http://www.microsoft.com/technet/sysintern...ies/psexec.mspx pushd: http://www.microsoft.com/resources/documen...d.mspx?mfr=true Cmd.exe does not support UNC names as the current directory: KB156276 http://support.microsoft.com/kb/156276 I have a lot of cmd scripts (for installation purpos) and I was making this in the intend to run the cmds. (but remotely instead of locally on all my 100+ machines.
  12. I was wondering if someone knew the difference betwin running an exe and running a cmd file? especially regarding to stdoutread and stderrread functions reason? I have some code that execute a psexec (remote execute) that work with exe files but no cmd files: CODE#include <GUIConstants.au3> $serverpath = "\\server\programmer\!deploy" $program = "testprog2.cmd" ;$program = "testprog.exe" $username = "Admin" $password = "fejlkode47" $host = "\\test-pc" $install = install($host, $username, $password, $serverpath, $program) $run = run($install, "",@SW_MAXIMIZE, 2 + 4) ;While 1 ; $line = StdoutRead($run) ; If @error Then ExitLoop ; MsgBox(0, "STDOUT read:", $line) ;Wend While 1 $line = StderrRead($run) If @error Then ExitLoop MsgBox(0, "STDERR read:", $line) Wend MsgBox(4096, "Status", "Installation Complete") Func install($host, $username, $password, $serverpath, $program) $command = "psexec " &$host &" -u " &$username &" -p " &$password &" -i -c " &$serverpath &"\" &$program return $command EndFunc I was wondering if someone could tell me why. I thought it was the use of unc path I even found a solution for it, but that did not fix it the cmd file that is executed is the same as the exefile just wrapped in a cmd file with a start /wait command. this is frustrating me, so I hope for someone to help me
  13. Is there a way to wait for a run command to complete without using runwait? I am working on a "deploy apps to workgroups machines" and ran into a problem... I have 2 installations I have to run on 2 remote hosts. For now the programs and hosts are hardcoded into the script I thought I could use the stderrread or stdoutread to control when they are finished but I can't What It currently does: run both programs on both hosts at the same time. what I want: run both programs on both host 1 at a time. (so when the first program has finished on both host we are ready to run the 2nd program on both hosts. If i use runwait I can only run 1 instance at a time. So it would be run program 1 on host 1, run program 1 on host 2, run program 2 on host 1 and finaly run program 2 on host 2 (having about 100 computers that needs installation of office programs, graphical programs, etz this will be very time consuming to say at least) therefore I have to wait for the first program to finish run on both hosts, before moving to program 2 on both hosts Hope anyone can answer my question as english is not my first langui. if not Ask and I will try to explain my code in it's current state: CODE#include <GUIConstants.au3> #include <array.au3> dim $program_queue[2] $program_queue[0] = "testprog.exe" $program_queue[1] = "testprog2.exe" _ArrayDisplay( $program_queue, "programs to run" ) dim $client_queue[2] $client_queue[0] = "\\test-pc" $client_queue[1] = "\\test-pc2" _ArrayDisplay( $client_queue, "Clients to run on" ) $serverpath = "\\server\Programmer\!DEPLOY" $username = "Admin" $password = "fejlkode47" ;$host = "\\test-pc" $i=0 while $i < 2 $program = $program_queue[$i] while 1 for $Client in $client_queue $install = install($client, $username, $password, $serverpath, $program) $SERR = StderrRead($install) $SOUT = StdoutRead($install) next if $SOUT="" then exitloop wend sleep(15000) ; wait for program 1 on both clients to finish, before proceeding $i = $i +1 wend MsgBox(4096, "STATUS:", "DONE") exit Func install($host, $username, $password, $serverpath, $program) $command = "psexec " &$host &" -u " &$username &" -p " &$password &" -i -c " &$serverpath &"\" &$program run($command,"",@SW_MAXIMIZE, 2 + 4) ;return $command ;DEBUGGER EndFunc
  14. This allmost qualifys for spam, but my script is still in trouble. Sometimes 2 or more workgroups are in the same array, like it jumps over a newline and reads on. like this 0 = workgroup1 1 = workgroup2 workgroup3 2 = workgroup4 anyone help here? suggestions, tips anything thanx
  15. HA Got it, it was just a question of getting the correct way out of the loop. Life is nice again This will put all your workgroups in an array. The cmd was skipped so nothing else needed to run this if anyone has some use for this feel free to use it CODE#include <array.au3> $workgroups = domains() $workgroups_count = UBound($workgroups) ; MsgBox(0, "number of workgroups found:", $workgroups_count) _ArrayDisplay($workgroups , "LIST OF WORKGROUPS:") func domains() $command = ' /c net view /domain | findstr . | find /v "---" | find /v "dom" | find /v "Command" ' $foo = Run(@ComSpec & $command, @workingdir, @SW_HIDE, 2) local $array[1] while 1 $line = StdoutRead($foo) If @error Then ExitLoop _ArrayAdd( $array, $line) wend _ArrayDelete( $Array,0) return $array endfunc plz Give me feedback what you think about it, things can always get better...
×
×
  • Create New...