简体   繁体   中英

System error 85 has occured in SQL Server 2005

I'm executing a batch file from SQL Server using this code:

exec sp_configure 'show advanced options', '1'
reconfigure
exec sp_configure 'xp_cmdshell','1'
reconfigure

exec xp_cmdshell '" D:\network.bat"'

and the neywork.bat contains the below commands

rem disconnect and re-set upn network drive connection
net use z: /d /yes
net use z:\\mlisfile07

Here the z: is mapped to some other path, but in the output it is showing as

network connection could not be found
system error 85 has occured

You are missing a space between the drive letter and the network path:

net use z: \\mlisfile07
         ~~~

The possible reason is that your logged in SQL-SERVER user doesn't have administrative permissions.

Please review : http://support.microsoft.com/kb/253821 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM