# AutoIt script: Pause a logoff/shutdown



## firestormer (Sep 16, 2005)

Im creating a program with the following code:


```
$listDrives=DriveGetDrive( "REMOVABLE" ) 
	If NOT @error Then	
	$chk=True 
	Else	
	$chk=False 
	EndIf
Beep(500, 400)
Sleep(100)
Beep(500, 400)
Sleep(100)
Beep(500, 400)
msgbox (48,"Removable Device Detected","Removable Device Detected Please Remove", 30000)
```
The idea is that it runs at logoff to alert the user if they have left a USB drive plugged in. What i want to know is how i can pause the logoff/shutdown until this program has closed.

or

if i stick it in the logoff script will windows pause automaticly until it closes?

TY


----------

