Jump to content

RunAs different user with FileGetTime and UNC path with spaces


Recommended Posts

I want retrieve modified date of ntuser.dat on a remote computer's local profile. These computers are in different domains, and I have use different system administrator credential to access accordingly. I wonder if there is a way to RunAs FileGetTime with a different user. I am thinking out loud here that I might need to use DOS command 

set FileDate=
Edited by wuruoyu
Link to comment
Share on other sites

I don't believe you need to RunAs to get the date from a file. If it is on your domain, then all you need to do is authenticate yourself so you can access the file and either get the file's date now, or copy it back to your computer, get the date, and then clean up. I'm not sure if AutoIt handles UNC paths well.

 

 

Link to comment
Share on other sites

Hi BetaLeaf, thanks for your reply.

I managed to authenticate the remote administrative shared c$ with _WinNet_AddConnection2, and FileGetName work with UNC paths that have no spaces. 

But FileGetName can't return time for UNC path with spaces. e.g. \\computer\c$\Documents and Settings\user\ntuser.dat"

Link to comment
Share on other sites

Have you tried using quotes? Maybe try downloading the file first to your computer before performing the operation you needo. Something like filecopy or in inetget. Remember to clean up and unneeded files when you are done.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...