Sign in to follow this  
Followers 0
friends

How To Copy File To Restricted User Account ?

4 posts in this topic

How to copy files from Administrator' to Restricted user under Windows 2000 ?

I've tested using with the RunAsSet command.... seems it does not work as well.

Any idea ?

my sample coding :

------------------------------------------------------------------------------------------------

Run(@ComSpec & " /c " & "net use U: \\sppmis2\avg-upd")

RunAsSet("Administrator", @Computername, "erots")

$val = FileCopy ("U:\*.bin", "C:\Program Files\Grisoft\AVG6\Update\*.*", 1)

MsgBox (0, "test", $val)

------------------------------------------------------------------------------------------------

it returns a 0 (failure) for the FileCopy command....

anybody knows how do that ? Pls help

Share this post


Link to post
Share on other sites



How to copy files from Administrator' to Restricted user under Windows 2000 ?

I've tested using with the RunAsSet command.... seems it does not work as well.

Any idea ?

my sample coding :

------------------------------------------------------------------------------------------------

Run(@ComSpec & " /c " & "net use U: \\sppmis2\avg-upd")

RunAsSet("Administrator", @Computername, "erots")

$val = FileCopy ("U:\*.bin", "C:\Program Files\Grisoft\AVG6\Update\*.*", 1)

MsgBox (0, "test", $val)

------------------------------------------------------------------------------------------------

it returns a 0 (failure) for the FileCopy command....

anybody knows how do that ? Pls help

<{POST_SNAPBACK}>

RunAsSet ONLY changes the Credentials for the RUN & RUNWAIT commands...

You could first restart your script in adminmode by restarting itself..

For details, look at this post : #17603


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

The RunAsSet is only for Run or RunWait only... i see, thanks for the tips !

And also... the link you give.... it's bravo ! :ph34r:

Share this post


Link to post
Share on other sites

you could just do the copy within a runwait command, like so:

Run(@ComSpec & " /c " & "net use U: \\sppmis2\avg-upd")

RunAsSet("Administrator", @Computername, "erots")

$val = RunWait(@comspec & ' /c xcopy "U:\*.bin" "C:\Program Files\Grisoft\AVG6\Update\*.*" /y /h /r ') 
MsgBox (0, "test", $val)

I mean, there's nothing wrong with the other way, it just occured that this would also work.


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
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
Sign in to follow this  
Followers 0