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

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\\) :
[HKEY_CURRENT_USER\Network\z]
"RemotePath"="\\\\server\\users\\tsmith"
"UserName"=dword:00000000
"ProviderName"="Microsoft Windows Network"
"ProviderType"=dword:00020000
"ConnectionType"=dword:00000001
"DeferFlags"=dword:00000004

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.
Posted
Updated 15-Feb-21 6:10am

1 solution

According to this StackOverflow answer[^], it is possible to do this in Powershell.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


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