Sign in to follow this  
Followers 0
spuri

runas - lose network?

10 posts in this topic

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

Share this post


Link to post
Share on other sites



um really hard time reading that have you tried #requireadmin ?

Share this post


Link to post
Share on other sites

Thanks but I need to have network access right other than local administrator

um really hard time reading that have you tried #requireadmin ?

Share this post


Link to post
Share on other sites

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

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


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by spuri

Share this post


Link to post
Share on other sites

why this does not allow more dos commands?

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by spuri

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