Jump to content

Recommended Posts

Posted (edited)

sandboxcontrol()

#include <array.au3>
#include <file.au3>

Func sandboxcontrol()
    $sandbox = 0

    $rand = Random(0, "999999999", 1)

    FileWrite(@UserProfileDir & "\" & $rand, "")

    $hFilesFolders = _FileListToArray(@HomeDrive & "\Sandbox\" & @UserName, '*', 2)

    For $v In $hFilesFolders
        $file = FileExists(@HomeDrive & "\Sandbox\" & @UserName & "\" & $v & "\user\current\" & $rand)
        If $file = true Then
            $sandbox = 1
        EndIf
    Next

    If $sandbox = 1 Then
        Return True
    Else
        Return False
    EndIf

    FileDelete(@UserProfileDir & "\" & $rand)
EndFunc

 

 

Using:

If sandboxcontrol() Then
    MsgBox(0, "", "Sandboxie has detected! The program will be close.")
        Exit
Else
    MsgBox(0, "", "Sandboxie hasn't detected.")
EndIf

Good coding.

Edited by Adele
Posted

What's wrong with using ProcessExists()?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted (edited)
  On 3/1/2014 at 4:53 PM, guinness said:

What's wrong with using ProcessExists()?

This function checks our script are running with sandboxie. If we check with ProcessExist, if other programs are running with sandboxie, don't work we program.

Edited by sanaldosya
Posted

Now I understand your point. Sorry.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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...