Batch File that denies access to a folder

Thanks Carnage. Then flaw with the changing permissions is one I actually want because if I break something at least I know there is a backdoor. :D Also any luck with the guides?
 
I just Google for everything.. I don't know much of batch scripting except what I need to pick up from Google. I've already learned a few other languages, so it helps me pick up other languages more easily.
 
Aahhh okay. btw have you heard of a programming language named logo? I found it in an old computer and internet term dictionary. It was designed for Windows 95 and NT but it still has some relevant stuff.

Also the script with icacls caused mayhem. I think I won't play with that just yet lol. I have another folder using a similar script with the hidden name as control panel and it caused absolute trouble. Good thing I have administrative rights and I reversed the damage through the GUI version as I am more experienced doing it that way.

EDIT: Did some play around and found a few problems here are the screen shots: (NOTE: This is meant to be used for both XP and Windows 7 it worked in XP but not in 7 and for some reason in windows XP it locked ALL files on the external 75GB drive)
 
Here's the shots:
anotherissue.jpg


majorbatchfileproblem.jpg


So as you can see this won't work on windows 7 and I can't get any shots of XP at the moment as I am about to send in my XP PC to the repair shop. It's RAM crashed badly and caused major issues in the systems files possibly I may have to reinstall D: but that's okay I still got the disks and I know where they are :)
 
The funny thing is even though it says access denied it still unlocks the folder???? What the!
Also the Are you Sure thing is annoying and I can't seem to find the cause of it.
 
The script I posted works on Win7 for me... It's what I tested it on..

Post your script that you're using, because I tested the one I modified fully and it wouldn't unlock when I entered an incorrect password, and it only locked the files/folders that were under the specified LOCKFOLDER variable. The one I modified also doesn't have the additional "are you sure you want to unlock" line... So not sure which one you're using.
 
I tried to use Cacls.exeto see if it would fix the issue and it did not. So therefore something is wrong. I will go home and continue trying to find the issue. I will post a screen shot of the script when I get home.
 
You don't need to post a screenshot of the script.. just copy/paste it into a post..
 
Well in all seriousness the script I used was the one you constructed. But I will make a re test to find the answer. Now are you sure that this works in windows 7 home premium?

EDIT: Okay I did a retest and I found that the are you sure thing disappeared so maybe I was responsible for that although I am not sure how it happened.
 
No idea about home premium; I'm running Pro. If you can run the icacls.exe from command line in Home Premium manually, then it should work through batch file.
 
Back
Top Bottom