spuri Posted December 1, 2008 Share Posted December 1, 2008 RunAsWait( $sUserName, $sDomain, $sPassword, 0, @ComSpec & " /c xcopy "& $drvC & " " & $drv & $nwclient & "\ /T /E /O", $drv, @SW_HIDE ) P: is a network share. I would like to copy P:\template\proj1 to P:\proj1, works with runwait but it has not enought rights so I need runaswait, but than I lose my network drives. Do you know any working solution? thanks Link to comment Share on other sites More sharing options...
botanic Posted December 1, 2008 Share Posted December 1, 2008 um really hard time reading that have you tried #requireadmin ? Link to comment Share on other sites More sharing options...
spuri Posted December 1, 2008 Author Share Posted December 1, 2008 Thanks but I need to have network access right other than local administratorum really hard time reading that have you tried #requireadmin ? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 1, 2008 Developers Share Posted December 1, 2008 RunAsWait( $sUserName, $sDomain, $sPassword, 0, @ComSpec & " /c xcopy "& $drvC & " " & $drv & $nwclient & "\ /T /E /O", $drv, @SW_HIDE )P: is a network share. I would like to copy P:\template\proj1 to P:\proj1, works with runwait but it has not enought rights so I need runaswait, but than I lose my network drives.Do you know any working solution?thanksThe thing to realise is that the mapped resources availble on the PC running the script will not be available for the RunAsWait() shelled program as it is run with different credentials.Try using the UNC path to the file to be copied.Jos 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...
spuri Posted December 1, 2008 Author Share Posted December 1, 2008 You are right, I will try with unc path. Should I set logon_flag to 0 or 2? What is the difference?The thing to realise is that the mapped resources availble on the PC running the script will not be available for the RunAsWait() shelled program as it is run with different credentials.Try using the UNC path to the file to be copied.Jos Link to comment Share on other sites More sharing options...
Paulchen Posted December 2, 2008 Share Posted December 2, 2008 Did you use Vista? With default configuration you lose the network connection when vista elevate to admin rights. You can check this by enter "net use" on a command line. Link to comment Share on other sites More sharing options...
spuri Posted December 2, 2008 Author Share Posted December 2, 2008 thanks for the ideas I am on XP. Listed network drives with "NET USE", but there are no mapped drives, but I am able to map "NET USE P: \\server\pfolder\" This could solve my problem. Link to comment Share on other sites More sharing options...
spuri Posted December 2, 2008 Author Share Posted December 2, 2008 (edited) Local $RunC = RunAsWait($sUserName, $sDomain, $sPassword, 0, "cmd /k cd\ && NET USE P: \\mbbudfls002\projects\", @SystemDir) I got system error 67 - network drive not found than if i type in NET USE P: \\mbbudfls002\projects\ it is success what is my mistake? Edited December 2, 2008 by spuri Link to comment Share on other sites More sharing options...
spuri Posted December 3, 2008 Author Share Posted December 3, 2008 why this does not allow more dos commands? Link to comment Share on other sites More sharing options...
spuri Posted December 3, 2008 Author Share Posted December 3, 2008 (edited) I would like to run cmd net use p: \\server\share xcopy p:\xy\ p:\proj\xy\ (copy ntfs file rights) UNC path is not working.... why? why this does not work? what should I do? use addnetshare and map again with a user having more network access xcopy than delete net share? Edited December 3, 2008 by spuri 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