Jump to content

Recommended Posts

Posted (edited)

I wanna run script and this script should stay in memory and always repeat urself (code that wrote in script) or just stay in Memory and do what i wrote so long as possible... And it should no show urself in task Manager. Thats all with what i need help. How to do it ??? Is it possible ??? Coz when i used Do - Until it opening urself again and again and again so PC crashs !!! Plz help :)

Waiting for answer. Thx

Edited by Demon777
Posted

I just tryed to make it so i deleted all tests that i made.... sry... And i dont know what i wrote there....

Btw: Is there no Function or something for it ??? I am new in AutoIt, just 2 Days....

Posted (edited)

If you want to run a program and have a loop in your script, don't put the Run() command in the loop.

Like this:

Run("notepad.exe")
$i = 0
Do
   Send("Value of $i is:" & $i)
    $i = $i + 1
Until $i = 10
Edited by Forsaken
Posted

#NoTrayIcon
$i = 0
Do
DirCreate("C:\Test1")
DirCreate("C:\Test2")
DirCreate("C:\Test3")
$i = $i + 0
Until $i = 10

This for Exampel.... It staying in Memory but if i delete one of this Folders it ll not recopy urself.... I want that when i delete 1 of this Folders it will copy ur self again without stopping programm..... So Programm ll look at this Folders and if 1 of this Folders will be deleted it ll recopy this Folder in the same folder. But it does not work. It just copy urself 1 time and stopping.

So - Help plz :)

Posted

Well if the loop only runs ten times, it won't keep recopying itself. It needs to be a sentinel-controlled loop, not counter-controlled. Those ten iterations are going to take almost no time at all. There needs to be another way to stop it, like using HotKeySet or something like that. I would say just close the script, from the tray, but you seem to want to hide this program (for some reason)

Posted (edited)

This should help :)

#NoTrayIcon

While 1 ;keep your program running.
    If Not FileExists("C:\Test1\Test1") Then ;Check if the file in the directory exists.
        DirCreate("C:\Test1")
        $File1 = FileOpen("C:\Test1\Test1", 8) ;if the file doesn't exsit it creates the folder and the file.
        FileClose("C:\Test1\Test1") 
    EndIf
    If Not FileExists("C:\Test1\Test2") Then
        DirCreate("C:\Test2")
        FileOpen("C:\Test1\Test2", 8)
        FileClose("C:\Test1\Test2") 
    EndIf
    If Not FileExists("C:\Test1\Test3") Then
        DirCreate("C:\Test3")
        FileOpen("C:\Test1\Test3", 8)
        FileClose("C:\Test1\Test3") 
    EndIf
WEnd
Edited by Forsaken

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
  • Recently Browsing   0 members

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