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

Thread Solved

Join Date: May 2008
Posts: 6
Reputation: haslamjd is an unknown quantity at this point 
Solved Threads: 0
haslamjd haslamjd is offline Offline
Newbie Poster

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

 
0
  #1
Jul 23rd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 31
Reputation: gbarnas is an unknown quantity at this point 
Solved Threads: 6
gbarnas's Avatar
gbarnas gbarnas is offline Offline
Light Poster

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

 
0
  #2
Jul 24th, 2009
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
LOST: 8' rocket, green with yellow computer bay, last seen streeking skyward in NY state!

Get IT tools and resources at our web site
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 6
Reputation: haslamjd is an unknown quantity at this point 
Solved Threads: 0
haslamjd haslamjd is offline Offline
Newbie Poster

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

 
0
  #3
Jul 25th, 2009
Thanks Glenn, your suggestions did the trick. Thank you so much!
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 31
Reputation: gbarnas is an unknown quantity at this point 
Solved Threads: 6
gbarnas's Avatar
gbarnas gbarnas is offline Offline
Light Poster

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

 
0
  #4
Jul 25th, 2009
Thanks! Good to hear it helped!

G-
LOST: 8' rocket, green with yellow computer bay, last seen streeking skyward in NY state!

Get IT tools and resources at our web site
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Windows NT / 2000 / XP Forum


Views: 593 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Windows NT / 2000 / XP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC