Jump to content

Script trapped in "temp" memory


Recommended Posts

Hi everyone,

My problem is that I have a script wich seems to be stuck into my Autoit memory or something like that, I'll explain what I mean.

I have this script just below with a function called "GetProcess" *** dont look to mistake in this code it's alright and doesn't matter for this issue *** :

;Liste des processus distant !
;#include <GUIConstantsEx.au3>;Ajout de fichier pour Combolist
;Opt('MustDeclareVars', 1)

;GetProcess()

;Func GetProcess()
    
    
    GUICreate("ProcessList2", 300, 200)
    Opt("GUICoordMode", 2)
    $Label1 = GUICtrlCreateLabel("Entrer le nom de l'Ordinateur :", 10, 10, 100, 40);Texte pour la boîte du nom de l'ordinateur
    $PC = GUICtrlCreateInput("", 0, -1, 150, 32);Boîte pour le nom de l'ordinateur
    $Button = GUICtrlCreateButton("Get Process!", -60, 50, 100, 30, 0x0001);bouton d'action qui execute le changement de nom
    $Exit = GUICtrlCreateButton("Quitter", -100, 10, 100, 30, 0x0001);bouton pour quitter l'application
    
;MsgBox(0, "GUI", $Label1)
;********Fonta pour les différents texte*******
        GUICtrlSetFont (3, 10 , 400 , 6)
        GUICtrlSetFont (4, 16 , 400 , 0)
        GUICtrlSetFont (5, 12 , 400 , 0)
        GUICtrlSetFont (6, 16 , 400 , 0)
        
        GUISetState();Obtien le status du combolist
        
    While 1;execute en boucle ...
        $event = GUIGetMsg();déclare la variable $event comme étant l'evenement de la fenêtre
        $Read = GUICtrlRead(4,1);Retourne l'entrée de donnée du nom de l'ordi et l'envois sous variable ($Read=nom)
        Select;Selection = à ...
            Case $event = $GUI_EVENT_CLOSE;Fermeture de la fenêtre
                ExitLoop;Sort de la boucle
            Case $event = $Button
                MsgBox(0, "GUI", $Read)
            ;Run("cmd /c tasklist /s " & $Read & " /u Domain\Username /p password > \\computer\folder\task.txt")
            ;sleep("1000")
            ;Run("notepad.exe \\pier-luc\logiciels\task.txt")
            ;ExitLoop
            Case $event = $Exit
                Exit
        EndSelect
    WEnd
EndFunc

Now I tried to do test in another script wich is :

Run("cmd /c tasklist david > \\computer\folder\task.txt")
sleep("5000")
Run("notepad.exe \\computer\folder\task.txt")

but it's still opening my function called GetProcess, even if I changed my orginial version like you see I tried to do basic changed as changing the name of my windows for ProcessList2 instead of ProcessList, or tried to put the func in comment but it still opened my older version of Script. is there someone already who experiences something similar ?

Link to comment
Share on other sites

I don't quite get it. Try searching your computer for the name of the script.

Because when you use Run with just a filename and not a full path, Windows searches current folder and path.

I had an issue like this once with file extensions. I made an au3 file that made a file called secedit.bat that called the command secedit and I figured it would execute the secedit.exe windows command but instead it ran the secedit.bat file causing an endless loop, I had to give it the full path and the file extension. I was banging my head on the wall over such a Monday morning mistake lol :D

www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org
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...