Jump to content
Sign in to follow this  
carloscor

Documents and Settings user folder attributes change

Recommended Posts

carloscor

Hi, I was wondering if anybody could help with a simple scritp that would change

any user folder and every subfolder under it from "hidden" to "not "hidden"

The problem is that I have several PCs that have this folders hidden and

are causing users to have access issues.

So far the following has worked for me for the following:

FileSetAttrib("C:\Documents and Settings\All Users", "-H", 1)

But when I try to run:

FileSetAttrib("C:\Documents and Settings\%username%", "+H", 1)

or

FileSetAttrib("C:\Documents and Settings\@username", "+H", 1)

Nothing happen all the local user folders of people that had logged in

stayed the same. I'm not much into scripting and I know I don't have the

concept right on the last one.

The local user folder is not specific and it could be different on every PC.

The other issue is that every PC may have several different local users

logged in, therefore many diferent user folders.

I would appreciate any pointers.

Share this post


Link to post
Share on other sites
BrewManNH

FileSetAttrib("C:Documents and Settings" & @username, "+H", 1)

You need to add the username macro to the folder path by concantenating it to the path, you can't put it inside the quotes because AutoIt won't interpret it correctly.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
carloscor

Thank you so very much for the the advice and guidance.

I added the corrected line of code. but still does not unhides the users

folders. :oops:

Share this post


Link to post
Share on other sites
BrewManNH

They may not be hidden, they may be system folders there's a difference. Also, if they're system folders, they're hidden for a reason and there is no good reason I can think of to unhide them for normal users. Users don't need to be rooting around their AppData/Application Data folder, because most of them have no idea what they're for, and access issues usually have nothing to do with whether a folder is hidden or not, it's mostly about permissions, and everyone has full access rights to their own profile folders already.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
carloscor

Would love to show you what is happening but is too long to explain. But thanks for your help. Again very appreciated.

Share this post


Link to post
Share on other sites
Mechaflash

I don't understand how the local users would get access errors. Whether the %appdata% or %userprofile% dirs are hidden or labeled as system folders, they are still accessible and shortcuts will still work.

If you can't access them, then its a permissions issue, in this case, especially since you didn't know that it's a permissions issue, you probably don't have a right to access them either :oops:


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×