friends Posted August 13, 2004 Share 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted August 13, 2004 Developers Share 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. Link to comment Share on other sites More sharing options...
friends Posted August 13, 2004 Author Share 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 ! Link to comment Share on other sites More sharing options...
emmanuel Posted August 13, 2004 Share 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) 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