943,923 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jul 23rd, 2009
0

messed up cacls command, now I can't access files

Expand Post »
Yesterday I followed a thread trying to learn to lock file folders using the cacls in the command window. I thought I'd use the temp file folder as my target, thinking that it was the most innocent folder I had. I was able to lock it, but now I can't unlock it.

Here is the code that I used to lock it:
cacls %temp% /G %username%:R

it asked me: Are you sure <Y/N> I replied Y, and it returned "processed dir: C:\DPCUME~1\HASLAM~4.AFT\LOCALS~1\Temp

I could confirm that I was unable to save anything to the temp folder. So I then wanted to unlock the folder. I used the following code:

cacls %temp% /E /T /C /G %username%:F .nul

It returns : Access is denied.

If I use the exact path to the filename instead of %temp%, I get:
The trust relationship between this workstation and the primary domain failed.

I can't download files: tells me I don't have permissions
I can't save word documents: tells me I don't have permissions
I can't read Eudora email: tells me it can't access the temp folder

I am stuck. Any thoughts on the steps I need to follow to get this working? Would a system restore take me back to how I was before?

Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
haslamjd is offline Offline
6 posts
since May 2008
Jul 24th, 2009
0

Re: messed up cacls command, now I can't access files

First - a workaround. Change your TEMP envirionment variable so you can function..
Right-click My Computer and click Properties, select Advanced, click Environment Variables button and edit the TEMP variable to C:\TEMP. Create C:\TEMP if it doesn't already exist. Log off and back on. You should now have an accessible Temp folder.

Next, after logging in as an administrator (local or domain), browse to the affected Temp folder in Windows Explorer. From Properties on that folder, select Security, click Advanced, select the Owner tab, select Administrators, check the "Replace owner on subcontainers" box, and click Apply. You can then select the Permissions tab and grant Administrators full-control, and Users-Modify access.

Log off and back on as yourself - you should be able to CD to the old temp folder and create/delete files. Restore your original TEMP variable definition if you can access the personal temp location.

NEVER play with CACLS using only the /G option, as that will remove all System access and permit only the account(s) you specify, requiring the steps above to be performed as an admin to recover access. IF you want to experiment with CACLS, use /E to edit the permissions and grant specific access to a different account. You can use runas to open a command window with alternate credentials and test access rights with little or no ill effects.

Glenn
Reputation Points: 10
Solved Threads: 7
Light Poster
gbarnas is offline Offline
35 posts
since May 2009
Jul 25th, 2009
0

Re: messed up cacls command, now I can't access files

Thanks Glenn, your suggestions did the trick. Thank you so much!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
haslamjd is offline Offline
6 posts
since May 2008
Jul 25th, 2009
0

Re: messed up cacls command, now I can't access files

Thanks! Good to hear it helped!

G-
Reputation Points: 10
Solved Threads: 7
Light Poster
gbarnas is offline Offline
35 posts
since May 2009
Apr 14th, 2010
0
Re: messed up cacls command, now I can't access files
hey

Yesterday I followed a thread trying to learn to lock file folders using the cacls in the command window. I thought I'd use the "F:\songs" file folder in my "F:" as my target,....actually that folder has huge contents.....folder size may be more than 20GB..... I was able to lock it, but now I can't unlock it.

Here is the code that I used to lock it:
F:\cacls songs /E /P everyone:n
then it showed...

processed dir F:\songs

I could confirm that I was unable to access that folder......... So I then wanted to unlock the folder. I used the following code:

F:\cacls songs /E /P everyone:f

It returns : Access is denied.

...........

what should i do now...i cant access that folder........please reply this soon..........
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kvg1990 is offline Offline
2 posts
since Apr 2010
Apr 15th, 2010
0
Re: messed up cacls command, now I can't access files
Neat. It locked you out so you couldn't change it back. Shouldn't it do that?
Reputation Points: 239
Solved Threads: 296
Industrious Poster
gerbil is offline Offline
4,169 posts
since May 2005
Apr 15th, 2010
0
Re: messed up cacls command, now I can't access files
Ok... jus foolin widja.
songs is the directory on F:, correct?
K, run these in cmd:
cd /d f:
cacls songs /p everyone:f
-it should work.... Since you are doing a blanket change of all users' rights, you don't need the /e parameter.
Check result by
dir songs
...or just browse to songs in Explorer. Next time, play with scratch files or folders you create just so.
Last edited by gerbil; Apr 15th, 2010 at 3:29 am.
Reputation Points: 239
Solved Threads: 296
Industrious Poster
gerbil is offline Offline
4,169 posts
since May 2005
Nov 25th, 2010
0
Re: messed up cacls command, now I can't access files
hey

Before 2 days, I followed a thread trying to learn to lock file folders using the cacls in the command window.
nd i tried it on my very important folder ,which contain all my important documents ,files,and software...it is of approx size 25 GB.... I was able to lock it.My folder is in
"d:\kpg"
i lock this by this command
c:\>cacls d:kpg /d everyone
it was done...
bt when i tries to unlock it...
c:\> cacls d:kpg /g everyone:f
It give an msg "access is denies"

i hv also tried->
d:\>cacls kpg /p everyone:f
bt it give same msg...

Wht should i do...
Plz Help me...
I m in big trouble..
Plz help me
Plzzzzzzzzzzzzzzzzzz...
As soon as Possible
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kpggaurav1 is offline Offline
2 posts
since Nov 2010
Nov 25th, 2010
0
Re: messed up cacls command, now I can't access files
hey

Before 2 days, I followed a thread trying to learn to lock file folders using the cacls in the command window.
nd i tried it on my very important folder ,which contain all my important documents ,files,and software...it is of approx size 25 GB.... I was able to lock it.My folder is in
"d:\kpg"
i lock this by this command
c:\>cacls d:kpg /d everyone
it was done...
bt when i tries to unlock it...
c:\> cacls d:kpg /g everyone:f
It give an msg "access is denies"

i hv also tried->
d:\>cacls kpg /p everyone:f
bt it give same msg...

Wht should i do...
Plz Help me...
I m in big trouble..
Plz help me
Plzzzzzzzzzzzzzzzzzz...
As soon as Possible
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kpggaurav1 is offline Offline
2 posts
since Nov 2010
Nov 25th, 2010
0
Re: messed up cacls command, now I can't access files
I must admit.... tsk... you deny all permissions to Everyone and then expect anyone to be able to get access? Luckily, this is XP.
If you used cacls d:\kpg /p everyone:n OR cacls d:\kpg /d everyone to lock then the /e parameter will not allow any cmd containing it to work [there are no permissions to edit] eg. cacls d:\kpg /e /p everyone:f will fail, as should cacls d:\kpg /e /r everyone.
Interesting that cacls d:\kpg /p everyone:f did not work for you. It should, it creates new rights in the acl.
cacls d:\kpg /g everyone:f should have worked, also.
Try cacls d:\kpg /e /r everyone, just in case.
Last edited by gerbil; Nov 25th, 2010 at 11:44 pm.
Reputation Points: 239
Solved Threads: 296
Industrious Poster
gerbil is offline Offline
4,169 posts
since May 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
Message:
Previous Thread in Windows NT / 2000 / XP Forum Timeline: system goes to blue screen and ie keeps shutting down - HELP
Next Thread in Windows NT / 2000 / XP Forum Timeline: Messed up cacls command





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC