friends 0 Posted August 13, 2004 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
Jos 2,175 Posted August 13, 2004 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. Share this post Link to post Share on other sites
friends 0 Posted August 13, 2004 The RunAsSet is only for Run or RunWait only... i see, thanks for the tips ! And also... the link you give.... it's bravo ! Share this post Link to post Share on other sites
emmanuel 0 Posted August 13, 2004 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