How can I disable users to choose "show hidden files" in setting?
I want to use a .bat file to protect my files.( I've already got the batch - I use it to HIDE and UNHIDE )
But the problem is, the user can simply show hidden files.
Can I disable this option?
Thanks!
Open regedit and change the CheckedValue from 1 to 0 at:
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/Current Version/Explorer/Advanced/Folder/Hidden/SHOWALL
and restart.
Do remember to backup the registry first.
Just write a bit of code to check this setting every 3 seconds or so and if it has changed, set it back again. Oh, and it is fine to change settings on a "Company Owned computer" or even a BYOD Computer without the users knowledge! Most users have no business playing with hidden files anyway...
Related
I am making a batch file to password protect a hidden folder.
How can I make it so the user cant view the preview window at the side, since the preview window allows them to see the password that is set in the .bat file.
To make the code of your batch file both hidden and un-editable, the best option is to convert it to an exe. I would recommend you use this bat-to-exe converter.
Also FYI, making a folder hidden is a rather ineffective protection step that only works against layman tech users. Perhaps encrypting the folder may be a better solution for you.
I´m trying to make some changes(Wallpaper/Themes) on a windows7 enviroment, until now, I copied some files in to a directory with admin rights, so the "hard" part is over.
Trying to change the registryKey with a batch or with a Powershell file will work, as an Admin and as a normal-user.
The bad thing is, if I try to make the changes as an Admin, then the changes will be just for the adminSession. And I want to make the changes for the normalUser and every new user(with not admin rights).
I found that with a batch file, I can make some changes to my normalUser account:
HKCU:\Software\Micorsoft....\Themes\ and change the value CurrentTheme to my own Windows theme.
If I check my registry, I notice that the CurrentTheme value was accepted, and after a reboot stay so.
But Windows shows me the default theme... ¬¬
I tried to change "everything" to set my Theme as default, but nothing works..
Is there a way to make it works? Why windows is refusing to take the changes in the registry and always show me the default Theme?
Go to HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows
In the left pane, right click on Windows and click on New and Key. Type Personalization and press enter (if not already exists).
Create a New and String Value called ThemeFile and press Enter. Right click on ThemeFile and click on Modify. Type in the full path of the .theme file with file extension in "" (example: "C:\Users\UserName\AppData\Local\Microsoft\Windows\Themes\NewCustomTheme.theme") ; it will be default for new users.
Are the systems on a domain?
You should know that registry values stored within the Policies key and all the subkeys after that can be reset by domain group policy at any time. That is to say that if you make a change here and reboot or run gpupdate, you can expect the values to be erased.
If you really want to change the theme for all users, you should use Group Policy to apply the theme, as seen in this link. Group Policy Settings for Windows Personalization.. Look in the section under "Set a Specific Theme".
I've done this for clients a number of times. You can also set a specific theme as the default by logging on as the Default Profile and making changes. Keep in mind that this approach should be done when you build a system image to deploy to the environment.
I've been trying to edit my host file for a while now and I keep failing.
I tried to open notepad as administrator and then click File --> Open and choosing the host file but I get this error message:
hosts
You don't have permission to open this file.
Contact the file owner or an administrator to obtain permission.
I tried notepad++ as well (as administrator) but I couldn't even get to the file with it (it doesn't show the etc folder in drivers).
I also tried to check my "User Account Control Settings" but it was already on the lowest level (never notify).
While looking online for a solution I've noticed more people having the same problem but I couldn't find a solution that worked for me.
I'm running Windows 7 Home Premium 64-bit
You have to run notepad++ (or your favorite text editor) as an administrator. Right click notepad++ and it should display an option to run it as admin. Once open, locate the hosts file and open it with notepad++.
Windows hosts file location: c:\windows\system32\drivers\etc
Note: copy and paste the above url in the file-explorer when opening a file within notepad++ instead of locating it manually as some directories are hidden.
If the above doesn't work, Windows 10, 8 sometimes requires you to first turn off your antivirus.
If you require editing the hosts file often, you could look into third-party freeware tools to aid you. [1][2]
This works:
For Windows 7 and Windows Vista
Click Start -> All Programs -> Accessories.
Right click on Notepad and select Run as administrator.
Click Continue on the "Windows needs your permission" UAC window.
When Notepad opens Click File -> Open.
In the filename field type the file location, i.e.:
C:\Windows\System32\Drivers\etc\hosts
Click Open.
Make the necessary changes to the hosts file.
Click File -> Save to save your changes.
In my case I could open the file (and Notepad++ was running as admin) however I could not edit it: I could neither type some text, nor delete anything - no popups, no warnings - it looked like keyboard is not working.
I copied the hosts file in the same location, deleted the original hosts file and renamed the new one to hosts. After that I was able to edit the file. I am guessing this should be some permission issue.
OS - windows 7
But first of all you have to do temporally disable your virus guard.
Dissable your antivirus and open notepad.exe with run as administrator edit your host file and save this.
'Run as admin' not enough in windows 8. Set 'modify' access also not enough if you have antivirus
So you need
1) Disable antivirus
2) Set 'modify' access for all applications
3) Modify 'hosts' file
4) Revert 1-2 steps
OK I got it! I had to right click the file, go to Properties, Security tab and click Edit.
Then I took ownership for the file and I had the ability to edit the file's permissions.
On windows 8 running notepad as administrator wasn't enough for me to edit this file. When I tried to open the file from within an administrator session of notepad the etc directory was empty. I changing explorer to show hidden files and extensions, but that only helped in explorer. To edit this with notepad I needed to modify the security settings on the file so that all users and all applications could write to the file. After I finished my changes I set the file back to read only and execute for all applications and users.
there are two notepad.exe in x64 windows,
you must use full path c:\windows\system2\notepad.exe ,this one is 64 bit version,
only type notepad whithout path may be launch 32 bit notepad.
(c:\windows\syswow64\notepad.exe)
"Run as administrator" just let you enforce launch 64 bit notepad.exe
using 32 bit software to edit c:\windows\system32\drivers\etc\hosts
the x64 system will automatic redirect to c:\windows\syswow64\drivers\etc
and there is no hosts file.
the GUI stiil display current folder is c:\windows\system32
but the real folder is c:\windows\syswow64
I had the same problem. After opening the notepad as an Administrator and editing hosts file, I could not save it (denied access). I could not even change file's permissions. What worked for me was copying the file elsewhere, editing there, and then overwriting the original through Command Prompt opened as Administrator. I didn't have to turn off antivirus program.
To open the Command Prompt as administrator, press windows+X and select that option from the menu.
Than, type: mv path-to-the-copy-of-hosts-file\hosts c:\windows\system32\drivers\etc\hosts
I just needed to uncheck "read only" property to allow modify that file.
I installed my application in Windows 7 and as part of the installation, it installs some text files. Now, if I open the text file in notepad and try to save it, I get an "Access denied" error. I'm logged in as administrator on the machine and the file is not marked read only and security permissions seem to be fine.
However, I could delete or rename the file without any problem and I could create a new file with the same name/location using notepad and the save works fine.
I understand it has something to do with UAC. I'm wondering what UAC does in order to block access to the file. Our application is not installed in Program files folder as I believe UAC restrict any changes to files in Program Files folder
Can anyone throw light on what is going on.
regards
G
With UAC, just because you're logged in as a user with administrator privileges does not mean a program actually runs with them. The program has to either request privilege elevation (which gives the "Do you want to allow this program to _____" UAC pop-up) or explicitly be run as administrator (right-click on the program/shortcut and choose Run as Administrator).
By default most areas of the drive outside of the standard "user files" (a.k.a. My Documents & co.) are restricted to administrator-only access, but the folder permissions can be changed to add access for a particular user if desired.
You will find that saving files almost anywhere except the "my documents" area for the user will be restricted, this includes saving to other drives on the system etc.
If you check the permissions for the directory you are trying to write to, all you have to do is expressely give the user permission. Otherwise only the admins have permission, which requires UAC approval from the user to get the admin token.
You normally get "Access Denied" error when the file is in use. UAC could not be an issue here. Check out if the file is in use by anyother process.
You can use tools like Process Explorer from sysinternals to do that.
You have to right click the file and select properties. THen open the security tab and you can see different accounts with differet privelages. Click USERS and it should highlight. The box under it should have a bunch of check marks that indicate what this user can do. Click Full Control. Apply and Okay. Then you can save!!!
I need my application installer set the program to auto-startup for all users.
Then each individual user should be able to modify this option without affecting others.
Currently I write to HKLM/../Run with installer, which acomplishes the first task.
But then I can't disable autorun for current user, because deleting th HKLM/../Run entry would disable it for everybody.
Is there a way to do that, without using shortcuts in Autostart folder?
start it for all users always but check a configuration variable in HKLU to see if it should exit immediately
Any reason not to use the HKCU Run key in the first place?
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]