-
John Littell
AskWoody PlusApril 14, 2011 at 3:43 pm in reply to: Setting the Read-only Property for a Folder of files #1275951Thanks to Joe and Mike. You both pointed me in very different directions. Oh, I am using VB 2010 express.
Mike: You got me to remember the File class and using SetAttributes. After some experimenting I got control of the ReadOnly attributes but for each file only. I then tried to branch out into the Directory and DirectoryInfo classes, but could find no mention of attributes or ReadOnly.Joe: Now that was a bit of reading. I think it said repeatedly that setting the directory flag would not set the flags in the included files. But this is not true. In my Windows 7 system, checking the RO flag in the directory properties does turn it on in every included file. And the reverse also works. I did notice that once the file attributes are set (either way), that the directory RO box simply shows a solid filler, which tells me nothing.
As I need to do this is VB code, I suppose I could Shell to the Attrib command, but that seems awfully clumsy.So, as it stands, I can do the basics; that is, loop through every file in the directory and set the file attribute as needed. Or I can use Attrib to set it through the directory. Why would I want to do this? Because I need to issue a My.Computer.FileSystem.DeleteDirectory(…) method. This will fail if any of its contained files is set to read only.
Any more ideas would be appreciated.
John
-
John Littell
AskWoody PlusThank you. My imperfect memory was trying to get SetKeys to work.
John
-
John Littell
AskWoody PlusHans,
Thank you for introducing me to an area of Vista I did not know about. This allows you to change the default templates WE assigns to each folder displayed, but I could not see any way to change the size of one of the default windows. Any other ideas?Thanks,
John Littell
-
John Littell
AskWoody PlusNow that I’ve created all this confusion, it’s about time I jumped back in and asked a question that makes sense. Forget, of course, all mention of Firefox. Were talking plain Windows Explorer here. Re-asking the question, we now get…
I have a medium size directory tree that I use Windows Explorer to display several dozen times a day. The window size that it defaults to is bit too small to show the entire directory structure. I have to manually increase the size (drag the borders) every time. Is there any way I can direct WE to use a larger initial window?
Unquote. Again, I apologize for temporarily having the intelligence of a fence post.
John Littell
-
John Littell
AskWoody PlusDanny D.
Sorry for the delayed response. The Lounge seemed to be down yesterday.Does your answer mean that the VB/VBA category now applies only to version 6 and earlier?
John
-
John Littell
AskWoody PlusMy thanks go to all responders. It is so simple when you know.
John
PS. What determines this a .net question, not a VB question?
-
John Littell
AskWoody PlusThanks, I will dig into them.
John
-
John Littell
AskWoody PlusDavdA,
Displaying or not displaying all icons (controlled by the desktop’s View setting) was never an issue. I simply did not know how to turn on the Computer shortcut icon. Of the two solutions described for me earlier in this conversion (Start, Computer, Show on Desktop. and Desktop Personalize, Change desktop Icons, select Computer check box). Both are equally valid, although the latter technique has more power. I shall try to remember both techniques. I thank you again for the information.
John -
John Littell
AskWoody PlusNow this idiot know of three features of Vista I’d never seen before. (And I’ve been using Windows since Version 1; I’ve been using computers since the early 1960s.)
Thank you one and all.
John
-
John Littell
AskWoody PlusThank you. I think I tried everything but that.
John
-
John Littell
AskWoody PlusDave, thanks for sticking with me.
The problem has gone away, but it has not been solved. First some detailed responses… (In the following shutdown.exe tests, NG stands for the shutdown.exe failure described above, ie. the “Shutting down” screen freezes up (the little circle stops spinning) after a few seconds. I then achieve actual power off by holding in the power on key.)
-f, according to my notes copied from some web site long ago, stands for “force non-closing drivers off”. Because you questioned it, I tried the command without -f, NG
I tried the command with 00 instead of just 0, NG
Following the script you sent me, I tried substituting /s /t 00 for -s -t 00, NG
Following up on dodgy USB devices mentioned above, I unplugged all USB devices, except the keyboard. Shutdown worked!
I starting putting them back one at a time to find the culpret, and while both my UPS battery backup and my external hard disk initially failed (NG), all the USB devices are now connected (USB, hard disk, DSL modem, and printer) and shutdown has worked several times. In the process of trying devices, I successfully used every USB port available, so it looks like I have one or more poor connections. I guess the solutions has to be jiggle every connection.
Thanks again for your support,
John Littell
-
John Littell
AskWoody PlusSilly me, I forgot the switches. OK, this time I executed “shutdown.exe -s -f -t 0” the following three ways:
1. By typing it into the Run box.
2. By executing a shortcut pointing to the .exe file.
3. By executing a .bat file containing the .exe file.The results were the same in all cases:
1. a DOS window flashed.
2. Shut down started – the gadgets, etc. were cleared.
3. The “Shutting down…” screen appeared, but after a few seconds froze; ie. the spinning wheel stopped spinning.As I said before, this seemed to start failing about the time I upgraded from Vista Home Premium to Vista Ultra but I absolutely cannot be sure. And, Google search results on ‘Vista” and “shutdown.exe” show time and time again that the two work together.
John
-
John Littell
AskWoody PlusDave and Paul,
In answer to your questions:
1. I created a shortcut to c:windowssystem32shutdown.exe. It did nothing (a DOS window flashed briefly, then nothing).
2. I typed shutdown.exe into the Run window. Same as above.
I’m beginning to have a complex.And thanks to the unsigned personage for the Vista administrator information. It is much appreciated.
John
-
John Littell
AskWoody PlusDave,
The copy of shutdown.exe I am using is in C:WindowsSystem32 , its size is 29 KB and the Modified date is 1/20/2008 (not that that means much). I have no recollection as to whether it came pre-loaded into Vista (which was purchased preloaded on my AlienWare PC nearly a year earlier), or whether I loaded it is from somewhere else. I can say that I did not transfer it over from my XP system as that program’s size is 19 KB with a Modefied date of 8/4/2004. And I believe I’m running SP1 because I can remember installing it; I have forgotten, however, where in Vista to look to verify this. (Finally, remember that psshutdown.exe (203 KB) that I downloaded earlier in this conversaion does not run either. After a brief flash of a DOS window, it does nothing.)Thanks for your time with my problem. John
-
John Littell
AskWoody PlusThank you for your suggestions. But I still cannot get shutdown.exe to work. It worked fine for the past year, and then it stopped. (It freezes in the “Shutting down” screen.) I do specify the run switches “Shutdown.exe -s -f -f 0”. I have only one user defined so it defaults to administrator. I realize that there are administrator modes and there are administrator modes. If I have suddenly switched to administrator second class, I don’t know why. In a batch file, how can I force administrator first chass?
Another thought: It stopped working about the time I upgraded from Windows Home to Windows Ultra. (Why? Because it was there?) From the Web research I’ve done, it should’t matter. Any other suggestions would be appreciated. (In response to an earlier suggestion, I do not know how to convert gadgets to run in a batch file.)
John
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
2 hours, 18 minutes ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
5 hours, 44 minutes ago -
W11 24H2 – Susan Bradley
by
G Pickerell
7 hours, 39 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
5 hours, 40 minutes ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
11 hours, 47 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
2 hours, 42 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
11 hours, 6 minutes ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
1 hour, 35 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
19 hours, 21 minutes ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
3 hours, 33 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
3 hours, 48 minutes ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
1 day, 12 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
1 day, 20 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
23 hours, 14 minutes ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
1 day, 5 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
1 day, 16 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
3 days, 7 hours ago -
50 years and counting
by
Susan Bradley
5 hours, 58 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
8 hours, 47 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
3 days, 18 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
3 days, 18 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
3 days, 18 hours ago -
OneNote and MS Word 365
by
CWBillow
3 days, 20 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
3 days, 20 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
3 days, 21 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
1 day, 12 hours ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
4 days, 8 hours ago -
Windows 11 Insider Preview build 26120.3671 (24H2) released to BETA
by
joep517
4 days, 8 hours ago -
Forcing(or trying to) save Local Documents to OneDrive
by
PateWilliam
4 days, 17 hours ago -
Hotpatch for Windows client now available (Enterprise)
by
Alex5723
4 days, 5 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.