Jump to content

runas - lose network?


spuri
 Share

Recommended Posts

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

  • Developers

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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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