PSexec net files with the server as a target.  But the script would need creds 
on the server.  Or Sysinternals PSFile will do it remotely too.

From: [email protected] [mailto:[email protected]] On 
Behalf Of James Rankin
Sent: Thursday, September 8, 2016 10:54 AM
To: [email protected]
Subject: [NTSysADM] Close open files from command line

I'm doing a bit of hack-work getting MS User Profile Disks to run on Windows 10.

It works fine, apart from when I log out, the .vhdx file on my file server is 
still locked in use by the SYSTEM process (the actual machine account for the 
client MACHINENAME$ shows as the user with the file open). This means that when 
the user logs back in, it fails to mount the User Profile Disk and gives me a 
temporary profile instead.

Restarting the client device doesn't release the lock, but closing the open 
files through Computer Management on the file server does. Once the handle to 
the .vhdx file is closed, the user can log back in and get the assigned User 
Profile Disk without issue.

So I'm wondering how I could run a script at user logoff that releases the file 
lock on the server? Last time I tried anything like that I was using the net 
files command - but that would have to be invoked on the file server end, so 
probably a non-starter.

Anyone have any ideas or insight?

James Rankin
EUC Solutions Architect | 07809 668579 | [email protected]<mailto:[email protected]>
One Trinity Green, Eldon Street, South Shields, Tyne & Wear, NE33 1SA
Tel: 0191 481 3446


Reply via email to