Accessing files from defunct laptop via USB cable HDD.


  1. Posts : 9
    Windows 10 Home 64bit
       #1

    Accessing files from defunct laptop via USB cable HDD.


    Recently my computer became inoperable so I removed the hard disk and fitted it into a USB case. I now need to access the previous Admin account folder to retrieve some files, but Windows says I need Admin permission and must reply Continue which I did but the folder still failed to open.
    I then created a matching local account (same name) on the new computer and tried again but still no luck.
    Does anyone know how to retrieve these files please?
      My Computer


  2. Posts : 6,967
    windows 10
       #2

    The files are own by admin on another PC so you will need to take ownership of the folders
      My Computer


  3. Posts : 9
    Windows 10 Home 64bit
    Thread Starter
       #3

    Do you mean I must right-click the folder, then Security followed by Edit/Advanced?
      My Computer


  4. Posts : 4,546
    Windows 11 Pro 64-bit
       #4

    You can use this script to add Take Ownership to the right-click menu in Windows Explorer.

    Code:
    @Echo Off
    
    Color 1A
    
    Cd %systemroot%\system32
    
    
    
    
    REM  --> Check for permissions
    Reg query "HKU\S-1-5-19\Environment" 
    REM --> If error flag set, we do not have admin.
    if %errorlevel% NEQ 0 (
    ECHO                 **************************************
    ECHO                  Running Admin shell... Please wait...
    ECHO                 **************************************
    
        goto UACPrompt
    ) else ( goto gotAdmin )
    
    :UACPrompt
        echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
        set params = "%*:"=""
        echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    
        "%temp%\getadmin.vbs"
        del "%temp%\getadmin.vbs"
        exit /B
    
    
    :gotAdmin
    
    Cls & Mode CON  LINES=11 COLS=104 & Color 0D & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo       浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
    Echo        Do You Want To Add Take Ownership to the Right-Click Menu in Windows Explorer (Y/N)?    
    Echo       藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
    Echo.
    Echo.
    
    
    Set /p input= RESPONSE: 
    
    If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start) 
    
    :_Ex
    If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)
    
    
    
    :_Start
    
    Reg.exe add "HKCR\*\shell\runas" /ve /t REG_SZ /d "Take Ownership" /f > Nul
    Reg.exe add "HKCR\*\shell\runas" /v "NoWorkingDirectory" /t REG_SZ /d "" /f > Nul
    Reg.exe add "HKCR\*\shell\runas\command" /ve /t REG_SZ /d "cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F" /f > Nul
    Reg.exe add "HKCR\*\shell\runas\command" /v "IsolatedCommand" /t REG_SZ /d "cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F" /f > Nul
    Reg.exe add "HKCR\Directory\shell\runas" /ve /t REG_SZ /d "Take Ownership" /f > Nul
    Reg.exe add "HKCR\Directory\shell\runas" /v "NoWorkingDirectory" /t REG_SZ /d "" /f > Nul
    Reg.exe add "HKCR\Directory\shell\runas\command" /ve /t REG_SZ /d "cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t" /f > Nul 
    Reg.exe add "HKCR\Directory\shell\runas\command" /v "IsolatedCommand" /t REG_SZ /d "cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t" /f > Nul
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0D & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo       浜様様様様様様様様様様様様様様様様様様融
    Echo         Take Ownership Context Menu Enabled   
    Echo       藩様様様様様様様様様様様様様様様様様様夕
    Echo.
    Echo. 
    
    Taskkill /im Explorer.exe /f >Nul
    
    Start Explorer.exe
    
    ping -n 6 localhost >Nul 
    Exit
    
    
    :_RegRestore
    
    
    Reg.exe delete "HKCR\*\shell\runas" /f > Nul
    Reg.exe delete "HKCR\Directory\shell\runas" /f > Nul
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0D & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo       浜様様様様様様様様様様様様様様様様様様様
    Echo        Take Ownership Context Menu Disabled    
    Echo       藩様様様様様様様様様様様様様様様様様様様
    Echo.
    Echo. 
    
    Taskkill /im Explorer.exe /f >Nul
    
    Start Explorer.exe
    
    ping -n 6 localhost >nul 
    Exit
      My Computer


  5. Posts : 9
    Windows 10 Home 64bit
    Thread Starter
       #5

    Many thanks; I will give it a try later.
      My Computer


  6. Posts : 3,865
    Windows 3.1 to Windows 10
       #6
      My Computer


  7. Posts : 25,040
    10 Home x64 (21H2) (10 Pro on 2nd pc)
       #7

    If you have Macrium Reflect there's a long way round, but useful if you don't want to risk changing anything on the HDD.

    Make a Macrium image of the HDD, then mount the .mrimg file. Wnen you do that there's an option to enable access to restricted folders.


    Accessing files from defunct laptop via USB cable HDD.-image.png
      My Computers


  8. Posts : 9
    Windows 10 Home 64bit
    Thread Starter
       #8

    I ran the script above and, after taking about 20 minutes, it eventually worked. Many thanks.
      My Computer


  9. Posts : 4,546
    Windows 11 Pro 64-bit
       #9

    You are very welcome!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 08:55.
Find Us




Windows 10 Forums