Link to home
Start Free TrialLog in
Avatar of Bizfolio
BizfolioFlag for South Africa

asked on

access denied

i have a HDD with XP on, my PC is not booting so i removed the HDD and inserted it as  external, i am trying to copy the data off to backup, but eachtime i say copy and paste it gives me the following error: you don't currently have permission to access this folder.
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Assuming you have a admin account, copy the following text to a text file, save it as GrantPermissions.vbs and run it from the HDD now connected as an external drive.
    Dim oShell, oFSO, oNetWork, oFile, strSysDir, strPath, strScriptDir, strUserName, strToolPath, strCommand

    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oShell = CreateObject("WScript.Shell")
    Set oNetWork = CreateObject("WScript.NetWork")

    strSysDir = oFSO.GetSpecialFolder(1).Path
    If Right(strSysDir, 1) <> "\" Then strSysDir = strSysDir & "\"

    strToolPath = strSysDir & "icacls.exe"
    strPath = Wscript.ScriptFullName
    Set oFile = oFSO.GetFile(strPath)
    strScriptDir = oFSO.GetParentFolderName(oFile)
    strUserName = oNetWork.UserName

    strCommand = """" & strToolPath & """" & "" & strScriptDir & "" & "  /grant " & """ & strUserName & """ & ":(OI)(CI)F /T"

    oShell.Run strCommand, 1, True

Open in new window

Avatar of Bizfolio

ASKER

hi
I followed the steps above, but still no luck.

any other suggestions?
Right-click on the drive, select Properties.
In the Security tab add the required permissions.
nope still not working
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Question not closed by OP. I recommend a point split between the two answers which should solve the OPs question.