Jump to content

Search the Community

Showing results for tags 'AutoSelfDelete'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Inpired by a script by guinness, here: '?do=embed' frameborder='0' data-embedContent>> he gave me an idea and i did another one for autodelete for some compiled scripts i dont want to execute out of his intended directory (privileges stuff). Thanks ; #FUNCTION# ==================================================================================================================== ; Name .......: __AutoSelfDelete; Author: Zalomalo, inspired in guinness's _SelfRename. ; Description.: AutoDelete executing script because unauthorized bad conditions (bad finemame, wrong path, etc.). ; The purpose is it autodelete as fast as possible and force relog session after return this function, and exiting. ; Is assumed the script is running compiled (exe), and all conditions have been set before. ; Do no error comprobations since have no sense for this purposes. ; Parameters: $iDelay [optional] An integer value for the delay to wait (in seconds) before beging trying to delete the executable. ; Return values: Success - Returns the PID of the bat file. ; Failure - Returns 0 & sets @error to non-zero ; ------------------------------------------------------------------------------------------------------------------------------- Func __AutoSelfDelete($iDelay=1) If Not StringInStr(@ScriptName,'.exe',2) Then Return Local $sTmpBat=@TempDir &'\TmpFile.bat' While FileExists($sTmpBat) $sTmpBat=@TempDir &'\TmpFile'& Chr(Random(65,122,1)) &'.bat' WEnd Local Const $sTmpBatData='@ECHO OFF' &@CRLF _ & 'PING -n '& Int($iDelay) &' -w 1000 127.0.0.1>nul' &@CRLF _ & 'TASKKILL /PID '& @AutoItPID &' /F'&@CRLF _ ; The script must have been exited allready, just by the case & 'DEL /F /Q "'& @AutoItExe &'"' &@CRLF _ & 'DEL /F /Q "'& @TempDir &'\*.bat"' Local Const $hfBat=FileOpen($sTmpBat,2) FileWrite($hfBat,$sTmpBatData) FileClose($hfBat) Return Run($sTmpBat, @TempDir, @SW_HIDE) EndFunc ;==>__AutoSelfDelete
×
×
  • Create New...