move file to a shared folder in windows 7

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Tundrabob
Posts: 4
Joined: 30 Jan 2011 11:21

move file to a shared folder in windows 7

#1 Post by Tundrabob » 30 Jan 2011 14:01

So I made a batch file that cleans up the file name of a video and then moves it from my download folder to a folder that is being shared to the rest of my network. The problem I'm having is that once it moves, it isn't shared like the rest of the files in that folder. So I need to know if there is a way to make that file shared once it has been moved over. it basically moves it from one directory to another on the same drive so its real quick(no actual copying of bits). I can make it move to the network location and then it is shared, but that actually transfers the file and takes a while. Not the best solution imo. I tried using "net share" but I can't get the syntax right.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: move file to a shared folder in windows 7

#2 Post by aGerman » 30 Jan 2011 16:01

Hmm, I'm not familiar with this stuff. I't sounds to me like the files don't inherit all features of the parent folder, because moving them changes the adress but not the properties.
Maybe removing after copying is the best way :|

Regards
aGerman

ChickenSoup
Posts: 79
Joined: 13 Dec 2010 10:32

Re: move file to a shared folder in windows 7

#3 Post by ChickenSoup » 31 Jan 2011 07:57

In windows if you move a file to a different directory on the same drive, it will keep its NTFS permissions from where it was. If you copy the file, it inherits the permissions. Also, if you move a file to a different Windows drive (partition) or to a network drive, it actually copies the file and then deletes it after it is copied (thus following the copy rules). Your issue is definately this. The easy way is to copy and then delete. Otherwise you can look at resetting the permissions to whatever the share has from the command line with icacls for Windows Vista/7 and xcacls for WinXP. I don't have experience with them but google and /? should get you in the right direction.

Tundrabob
Posts: 4
Joined: 30 Jan 2011 11:21

Re: move file to a shared folder in windows 7

#4 Post by Tundrabob » 03 Feb 2011 18:17

found a solution I like. Used Robocopy to copy security info. not sure if this is the technically correct approach but it works.
my batch looks like this:

...some name cleanup stuff...
move "E:\Downloads\%movie%" "E:\my movies\"
robocopy "E:\my movies" "E:\my movies" "%movie%" /COPY:S /IS

Thanks for the help. Nice forum.

Post Reply