PDA

View Full Version : NET USE problem


Faydra
30th July 2009, 03:06 PM
I have a ton of shares sitting on Computer A.

I have a perl script ftp'ing files to and from Computer B to Computer A.

The problem: Shares sit on the C drive of ComputerA, and they need to move to the D drive.

The .bat files that start this process have a NET USE statement that maps everything to the C drive.

I wanted to move them over slowly - one share at a time, but I can't do that because the NET USE statement on all these .bat files does this:

NET USE Y: \\ComputerA\c$\Inetpub (file://\\ComputerA\c$\Inetpub)

Is there a way to clear a drive setting for your session only? If these .bat files could unmap and then remap the drives I'd be okay, but I'm not sure what would happen when 2 bat files try to map Y to something different at the same time.

I'm pretty much hosed, aren't I? I have to either modify the perl script to check for the presence of the directory on C and if it can't find it, move to D OR I have to do the whole thing at once.

Anyone have a more elegant solution?

GreNME
30th July 2009, 04:06 PM
Why are you using a perl script and why use the NET command? Why not just use Robocopy? No need for setting network drives (it allows UNC paths) and you don't need to use FTP (it uses SMB by default, I believe). If robocopy ain't your cuppa tea (or one of them is a *nix), try using rsync and DeltaCopy (http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp).

Far more elegant if the result is only to move files back and forth. However, why you want the files moved might change the type of suggested solution.

Faydra
30th July 2009, 04:21 PM
I am using Robocopy to move the shares from C to D.

This perl script/bat method is old - it got thrown on the C drive when they only had one ftp transfer to do - cut to years later and it's grown into this monstrosity that never should have been on C to begin with.

Eventually, everything is moving to Tumbleweed, but until that migration can happen, I have to get stuff off C because it's FULL and breaking things.

Ugh.

GreNME
30th July 2009, 09:17 PM
You can move over the network as well with Robocopy. You can schedule it or use a BAT file to do it.