"이동식 드라이브에서 Windows 7이 휴지통을 사용하지 않도록하려면 어떻게합니까?"
시작하거나 로그인 할 때 다음 스크립트를 실행하십시오.
소스 Windows 7 : $ recycle.bin 폴더 생성을 비활성화 하시겠습니까? :
그렇습니다. 할 수 없다는 것에 화가 났기 때문에 스크립트를 작성했습니다 (아래 참조). 그것은 나를 위해 작동하지만 문제가있는 경우 조금 조정해야 할 수도 있습니다.
' Author: HSV Guy
' Description: Script to remove Recycle Bin folder. Run on Windows startup or login.
' Notes: 1) See http://www.sevenforums.com/tutorials/11949-elevated-program-shortcut-without-uac-prompt-create.html
' for how to run programs/scripts with elevated permissions without a UAC prompt.
' 2) Update value of RECYCLEBIN as per version of Windows (configured for Windows 7).
' Date: 1 April 2011
Dim SILENT
SILENT = TRUE
Call RunElevated
Dim filesys, drv, drvcoll, folder, RECYCLEBIN
RECYCLEBIN = ":\$Recycle.Bin\"
Set filesys = CreateObject("Scripting.FileSystemObject")
Set drvcoll = filesys.Drives
For Each drv in drvcoll
If drv.IsReady And filesys.FolderExists(drv.DriveLetter & RECYCLEBIN) Then
Set folder = filesys.GetFolder(drv.DriveLetter & RECYCLEBIN)
MyMsgBox "About to delete: " & folder
folder.Delete
Else
MyMsgBox "Skipped " & drv.DriveLetter & ". Folder doesn't exist or device not ready."
End If
Next
'Source code of RunElevated function shamelessly taken from:
' http://www.insidethe.com/blog/2009/12/how-to-launch-a-wsh-vbscript-as-administrator-in-windows-7-and-vista/
Function RunElevated
If WScript.Arguments.Named.Exists("elevated") = False Then
'Launch the script again as administrator
CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ /elevated", "", "runas", 1
WScript.Quit
Else
'Change the working directory from the system32 folder back to the script's folder.
Set oShell = CreateObject("WScript.Shell")
oShell.CurrentDirectory = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
MyMsgBox "Now running with elevated permissions" & SILENT
End If
End Function
Function MyMsgBox(Message)
If Not SILENT Then MsgBox Message
End Function