Jump to content

Recommended Posts

Posted

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

Posted

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

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

  • Developers
Posted

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

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

Posted

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

Posted

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.

Posted

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.

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...