Robocopy as another user.
Posted on 2012-04-13
I am trying to make an application or script to run robocopy as a server administrator in order to copy folder structures and keep the permissions intact.
I have tried various ways but with little to no success.
I have tried creating an application to start the program as a process, passing the username, password and domain, but this runs into an issue with multiple users not being able to run this application. Robocopy just flashes for a moment and I cannot see the particular issue but it seems that it the username gets locked up to a single user.
I have tried just running the program with runas with the /netonly tags and it does seem to work, but in order to automate it i build an application to send the keystrokes to the console the issue arose that if the focus is shifted to another application it just sends the keystrokes to whatever is open.
A coworker suggested using windows script host but before i delve into that I guess I would like to ask if there is any way to get this running by any other means I have over looked.
to recap i need a program, process, script or whatever to copy a folder structure on a server to another location on the same server and preserve the permissions.