Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2009
    Shoreline, Washington, USA
    Thanked 1 Time in 1 Post


    Tips on working within Windows 7's Libraries

    By Fred Langa

    Win7's Libraries are a powerful organizing tool, but they're not always the best option for accessing your files.

    For some kinds of file management, the old way — using Windows Explorer and working within the files' true folder — is still the best way.

    The full text of this column is posted at (paid content, opens in a new window/tab).

    Columnists typically cannot reply to comments here, but do incorporate the best tips into future columns.

    Last edited by revia; 2011-01-20 at 14:59.

  2. #2
    New Lounger
    Join Date
    Jan 2010
    Groveland, MA, USA
    Thanked 0 Times in 0 Posts
    If David truly does not want to shutdown or reboot with a USB drive attached, I would initiate shutdown thru a script that actually checks for the presence of a USB drive.

    {code - shutdown.cmd
    @echo off
    title Shutdown System

    :* * Verify that there is no UFD present
    wscript ufdDetect.vbs
    if errorlevel 1 goto ufd
    if errorlevel 0 goto sd

    shutdown /r /t 000 /d p:0:0

    {end of code

    {code - ufdDetect.vbs
    '************************************************* **************************************
    ' File: ufdDetect.vbs
    ' Author: Joe Rawlins
    ' Purpose: Detect the number of UFDs attached to system
    ' Notes: DriveType
    ' 0 = Unknown
    ' 1 = No Root Directory
    ' 2 = Removable Disk
    ' 3 = Local Disk
    ' 4 = Network Drive
    ' 5 = Compact Disc
    ' 6 = RAM Disk
    ' Last Modified: 05/12/2009 jtr Initial creation
    '************************************************* **************************************
    Option Explicit

    Dim objWMIService
    Dim colDisks, objDisk
    Dim objDictionary

    Dim strComputer

    Dim strDrive, strDrives

    Dim i, intUFD

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    ' Get UFD Drive Letters - Removable Drive = DriveType 2
    Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where DriveType = 2")
    Set objDictionary = CreateObject("Scripting.Dictionary")

    For Each objDisk in colDisks
    objDictionary.Add objDisk.DeviceID, objDisk.DeviceID
    intUFD = 0
    For i = 68 to 90 ' 67 is C and 90 is Z - this will exclude any Floppy drives
    strDrive = Chr(i) & ":"
    If objDictionary.Exists(strDrive) Then
    strDrives = strDrives & strDrive
    intUFD = intUFD + 1
    End If

    Select Case intUFD
    Case 0
    WScript.Quit 0
    Case Else
    WScript.Echo "There are UFDs attached!" & vbCrLf & vbCrLf & "Please remove all and then press OK!"
    WScript.Quit 1
    End Select
    {end of code

    I had written this mainly to detect for USB Keys and therefore use the Microsoft terminology UFD (USB Flash Device) to refer to them. If no UFDs are found the system will shutdown without any prompts. If any are found it will continue to check until all are removed and only then allow shutdown.
    Quidquid Latine dictum sit, altum sonatur.

  3. #3
    Lounge VIP bobprimak's Avatar
    Join Date
    Feb 2009
    Hinsdale, IL, USA
    Thanked 157 Times in 131 Posts
    Two things about removing USB drives:

    1) You should never just unplug them. They may be in use, and the drive can be permanently damaged. This is why Windows has the Safely Remove Hardware routine.

    2) It is safe, and often preferable, to leave USB drives plugged in until Windows has shut down completely, and even for up to twenty seconds longer. Again, this protects the drives against physical damages. When rebooting, however, an attached USB device will often try to boot, and if it is not the boot drive, Windows will fail to launch. So remove the drives after complete Windows shutdown, and then reattach them olny after a successful Windows reboot.
    -- Bob Primak --

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts