Click here to Skip to main content
15,741,215 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +

using a batch file, on my admin account, I would like to load the regedit hive of a disconnected windows user (NTUSER.DAT). Then, getting part of the "RemotePath" value of one of his mapped drive (what comes next \\\\server\\users\\) :
"ProviderName"="Microsoft Windows Network"

is this possible in batch ? How ?

Any help would help me so much.

What I have tried:

I have no specific idea of about how to achieve this.
Any help would greatly help me improve my script.
Thank you.
Updated 15-Feb-21 6:10am

1 solution

According to this StackOverflow answer[^], it is possible to do this in Powershell.
reg.exe load 'HKLM\TempHive' Path\to\offline\file.dat
$path = Get-ItemProperty -Path "HKLM:\TempHive\Network\z" -name RemotePath | Select-Object -ExpandProperty RemotePath
reg.exe unload 'HKLM\TempHive'
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900