Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Bind to a Folder Using the Browse for Folder Dialog BoxContent of Bind to a Folder Using the Browse for Folder Dialog Box.vbsMD5 Hash: B28B4AD85BE6766C951FEB4157BE3264 |
||
' Description: Uses the Shell object to display the Browse for Folder dialog box. After a folder has been selected, the script reports whether or not the folder is read-only.
Const WINDOW_HANDLE = 0 Const NO_OPTIONS = 0 Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder _ (WINDOW_HANDLE, "Select a folder:", NO_OPTIONS, "C:\Scripts") Set objFolderItem = objFolder.Self objPath = objFolderItem.Path objPath = Replace(objPath, "\", "\\") strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2") Set colFiles = objWMIService.ExecQuery _ ("Select * from Win32_Directory where name = '" & objPath & "'") For Each objFile in colFiles Wscript.Echo "Readable: " & objFile.Readable Next | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |