Jump to content

How To Copy File To Restricted User Account ?


Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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)

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...