Although they remember friends, in a previous post I commented on USBAlert; a free application that works as a reminder to eject our USB stick when shutting down Windows. Well, returning to this topic today we will see how to do the same, but manually, as a trick. This means that we will create a single Script, which has the advantage that we will not need to install anything and it will be permanent, without the need for programming knowledge and in 3 simple steps.
1. Create the Script
We run Notepad and there we paste the following code:
Const DriveTypeRemovable = 1
Set oFS = Wscript.CreateObject("Scripting.FileSystemObject")
Set oDrives = oFS.Drives' Loop thru AZ. If found, exit early.
For Each Drive in oDrives
If Drive.DriveType = DriveTypeRemovable Then
If Drive.DriveLetter <> "A" Then
Wscript.Echo “HEY… DON'T FORGET YOUR USB STICK! » + Drive.DriveLetter
End If
End If
Next
Now what follows is to save it (on the desktop at the moment) with the extension «.vbs» (without quotes) and the name you want. So, for example, it looks like this: rememberusb.vbs (optionally you can download it here).
2. Save the Script
Now it is important to place it in the following directory: C: WINDOWSsystem32GroupPolicyUserScriptsLogoff
Remember that this default location is hidden, so you must unhide it from «Tools / Folder Options / View / Show all hidden files and folders«. If you can't find the directory, don't worry, in the 3rd step you can copy it directly.
3. Configure the Script in Windows
In the Start / Run menu, we write gpedit.msc and press Enter. The 'Group policy' and there we locate «User Settings / Windows Settings / Script«.
In the right panel we open 'Logout', then click the' buttonAdd ...'. In the new window we select 'Examine…'and select (or paste) there the Script that we have created. Finally we accept and apply all changes. Ready!
Now, the next time we turn off or close session in Windows, having the USB memory (Pendrive, flash memory, etc.) connected, this script will give us a warning / reminder / warning so as not to forget it. As can be seen in the first capture of this post. Otherwise, the logoff will not be affected in any way.
Nota.- This trick is tested in the XP version of Windows.
Link: Related article / Of interest: USBAlert (in case you prefer a program with more options).
(Seen in: SpamLoco)