I am having following issue when I try to use net use
using a batch file which is configured in Hudson.
I added test
user as administrator in remote Windows Server 2012 and also set the password.
My batch script:
net use p: /delete
net use p: "\\cazrt\C$" /USER:test /PERSISTENT:NO xxxxx
set "source=%~1"
set "target=p:/%~2"
echo "%source%" "%target%"
echo F|xcopy /S /I /Q /Y "%source%" "%target%"
Output on execution:
[exec] C:\HudsonProjects\NGA>net use p: /delete
[exec]
[exec] C:\HudsonProjects\apps>net use p: "\\cazrt\C$" /USER:test /PERSISTENT:NO xxxxx
[exec] System error 5 has occurred.
[exec]
[exec] Access is denied.
If I try to use net use
without PERSISTENT
, I get the same access denied error and the network connection could not be found.
Output on execution:
[exec] C:\HudsonProjects\NGA>net use p: /delete
[exec]
[exec] C:\HudsonProjects\apps>net use p: "\\cazrt\C$" /USER:test xxxxx
[exec] The network connection could not be found.
[exec] More help is available by typing NET HELPMSG 2250.
[exec]
[exec]
[exec]
[exec] C:\HudsonProjects\apps>set "source=D:/target/DROP"
[exec]
[exec] C:\HudsonProjects\apps>set "target=p:/C:/temp"
[exec]
[exec] C:\HudsonProjeSystem error 5 has occurred.
[exec]
[exec] Access is denied.
If I type net use
from local windows machine, it is showing:
\\cazrt\c$ command executed successful.