ghetek Posted January 4, 2010 Share Posted January 4, 2010 Hey everybody. I need to copy a file to the users @homedrive. the problem is that these users do not have permissions to do so. the file source is inside of a UNC path that all users have access to. How can i copy the file with higher credentials? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 4, 2010 Share Posted January 4, 2010 (edited) That macro only returns a drive letter, maybe a complete path is needed for your operation? Try this: ConsoleWrite(@HomeDrive & @HomePath & @LF) or ConsoleWrite(@HomeDrive & "\" & @LF) Edited January 4, 2010 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
ghetek Posted January 4, 2010 Author Share Posted January 4, 2010 That macro only returns a drive letter, maybe a complete path is needed for your operation? Try this: ConsoleWrite(@HomeDrive & @HomePath & @LF) Well i think its more of a credential problem because Users are not allowed to create files on their C:\ drives. i just need to find a way to create a file in the C: root with elevated privileges. Link to comment Share on other sites More sharing options...
failedtocompile Posted January 5, 2010 Share Posted January 5, 2010 (edited) You may want to look at doing it like this. $usr = 'Administrator' $pwd = 'password' $dom = @ComputerName RunAs($usr, $dom, $pwd, "", @ComSpec & ' /k ' & 'mkdir c:\test123' & ' ' & '&&' & ' ' & 'dir' & ' ' & '&&' & ' ' & 'cd c:\test123', @SystemDir, @SW_SHOW) or you can do just bare basic $usr = 'Administrator' $pwd = 'password' $dom = @ComputerName RunAs($usr, $dom, $pwd, "", @ComSpec & ' /k ' & 'mkdir' & ' ' & @HomeDrive & '\test123', @SystemDir, @SW_SHOW) only down side is the creds are stored within the exe, but you could have it read from an ini file or include encrypt string etc etc. just remember that my example is just that an example showing you the potential of what you can do, not many people know how to trunk multiple commands in DoS. ftc Edited January 5, 2010 by failedtocompile Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now