문제

I have a backup harddrive shared (SMB/CIFS) on my local Windows network. Now I need a windows BAT script that deletes some of the shared files in the backup drive. In Linux+bash it would be fairly simple but on a SMB/CIFS shared drive and using only batch scripting I could not find any solutions!

도움이 되었습니까?

해결책

There a few things you can try.First to 'enable' deleting on the share you can first map the drive with net use' : NET USE [driveletter:] \ComputerName\ShareName[\volume] [password | *] [/USER:[domainname]username] [/PERSISTENT:YES]`

And you probably will have access to the files with the DEL command.

If this does not work you'll need to execute the delete via SSH on the unix machine.For this you can use plink: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html The documentation is descriptive enough I think.. And if this does not work too you'll need the heavy weapon -> Cygwin which is also can be used via script to send commands via SSH

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top