![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Change share script Hello, I am relatively new to scripting. In an effort to NOT wake up at 1:30 in the morrning to migrate a share, does anyone know a vbscript to do that? Here's what I have (all Win2003): \\server1\oldshare is the old share. We've migrated the data in the share to a SAN and now it's stored in \\server1\newshare I want a script that will copy the NTFS permissions and then delete the share to 'oldshare' while creating the share to 'newshare' Anyone have a path for me to take here? TIA! Jon |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Change share script "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message news:e8lG3x$1JHA.1712@xxxxxx Quote: > Hello, > > I am relatively new to scripting. In an effort to NOT wake up at 1:30 in > the morrning to migrate a share, does anyone know a vbscript to do that? > Here's what I have (all Win2003): > > \\server1\oldshare is the old share. We've migrated the data in the share > to a SAN and now it's stored in \\server1\newshare > > I want a script that will copy the NTFS permissions and then delete the > share to 'oldshare' while creating the share to 'newshare' > > Anyone have a path for me to take here? > > TIA! > > Jon @echo off net share oldshare /delete net share newshare="d:\User Files\ShareName" permcopy.exe {Technical Resource Kit} I would actually use robocopy.exe to copy the files to the new destination - it has a switch to copy NTFS permissions. You can do it with a VB Script too but you will end up with a much more complex solution, which requires much more testing and debugging. However . . . If this is a production server and if people's ability to do their job depends on the availability of the various shares then I would get up at 1:30 am and supervise the delivery of this baby and test things in full. Most of my clients would take a dim view of me having a undisturbed rest while their system is falling to pieces. How tolerant is your boss/client? How secure is your job? Anyone nipping at your heels? |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Change share script I forgot to mention that this also need to be a hidden share. Is there a switch that I need to include? "Pegasus [MVP]" <news@xxxxxx> wrote in message news:%23FlPe5$1JHA.4412@xxxxxx Quote: > > "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message > news:e8lG3x$1JHA.1712@xxxxxx Quote: >> Hello, >> >> I am relatively new to scripting. In an effort to NOT wake up at 1:30 in >> the morrning to migrate a share, does anyone know a vbscript to do that? >> Here's what I have (all Win2003): >> >> \\server1\oldshare is the old share. We've migrated the data in the share >> to a SAN and now it's stored in \\server1\newshare >> >> I want a script that will copy the NTFS permissions and then delete the >> share to 'oldshare' while creating the share to 'newshare' >> >> Anyone have a path for me to take here? >> >> TIA! >> >> Jon > The following three commands will do the trick: > @echo off > net share oldshare /delete > net share newshare="d:\User Files\ShareName" > permcopy.exe {Technical Resource Kit} > > I would actually use robocopy.exe to copy the files to the new > destination - it has a switch to copy NTFS permissions. You can do it with > a VB Script too but you will end up with a much more complex solution, > which requires much more testing and debugging. > > However . . . If this is a production server and if people's ability to do > their job depends on the availability of the various shares then I would > get up at 1:30 am and supervise the delivery of this baby and test things > in full. Most of my clients would take a dim view of me having a > undisturbed rest while their system is falling to pieces. How tolerant is > your boss/client? How secure is your job? Anyone nipping at your heels? > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Change share script Share are hidden when they have a "$" at the end of their name. "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message news:%23ivCGDA2JHA.1420@xxxxxx Quote: >I forgot to mention that this also need to be a hidden share. Is there a >switch that I need to include? > > > "Pegasus [MVP]" <news@xxxxxx> wrote in message > news:%23FlPe5$1JHA.4412@xxxxxx Quote: >> >> "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message >> news:e8lG3x$1JHA.1712@xxxxxx Quote: >>> Hello, >>> >>> I am relatively new to scripting. In an effort to NOT wake up at 1:30 in >>> the morrning to migrate a share, does anyone know a vbscript to do that? >>> Here's what I have (all Win2003): >>> >>> \\server1\oldshare is the old share. We've migrated the data in the >>> share to a SAN and now it's stored in \\server1\newshare >>> >>> I want a script that will copy the NTFS permissions and then delete the >>> share to 'oldshare' while creating the share to 'newshare' >>> >>> Anyone have a path for me to take here? >>> >>> TIA! >>> >>> Jon >> The following three commands will do the trick: >> @echo off >> net share oldshare /delete >> net share newshare="d:\User Files\ShareName" >> permcopy.exe {Technical Resource Kit} >> >> I would actually use robocopy.exe to copy the files to the new >> destination - it has a switch to copy NTFS permissions. You can do it >> with a VB Script too but you will end up with a much more complex >> solution, which requires much more testing and debugging. >> >> However . . . If this is a production server and if people's ability to >> do their job depends on the availability of the various shares then I >> would get up at 1:30 am and supervise the delivery of this baby and test >> things in full. Most of my clients would take a dim view of me having a >> undisturbed rest while their system is falling to pieces. How tolerant is >> your boss/client? How secure is your job? Anyone nipping at your heels? >> > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Change share script Right, but when I create the share with the script, it simply makes it the default name of the folder. Is there a switch in the script that would allow it to add the $ in the share name? "Pegasus [MVP]" <news@xxxxxx> wrote in message news:ObYWoXA2JHA.5772@xxxxxx Quote: > Share are hidden when they have a "$" at the end of their name. > > > "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message > news:%23ivCGDA2JHA.1420@xxxxxx Quote: >>I forgot to mention that this also need to be a hidden share. Is there a >>switch that I need to include? >> >> >> "Pegasus [MVP]" <news@xxxxxx> wrote in message >> news:%23FlPe5$1JHA.4412@xxxxxx Quote: >>> >>> "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message >>> news:e8lG3x$1JHA.1712@xxxxxx >>>> Hello, >>>> >>>> I am relatively new to scripting. In an effort to NOT wake up at 1:30 >>>> in the morrning to migrate a share, does anyone know a vbscript to do >>>> that? Here's what I have (all Win2003): >>>> >>>> \\server1\oldshare is the old share. We've migrated the data in the >>>> share to a SAN and now it's stored in \\server1\newshare >>>> >>>> I want a script that will copy the NTFS permissions and then delete the >>>> share to 'oldshare' while creating the share to 'newshare' >>>> >>>> Anyone have a path for me to take here? >>>> >>>> TIA! >>>> >>>> Jon >>> >>> The following three commands will do the trick: >>> @echo off >>> net share oldshare /delete >>> net share newshare="d:\User Files\ShareName" >>> permcopy.exe {Technical Resource Kit} >>> >>> I would actually use robocopy.exe to copy the files to the new >>> destination - it has a switch to copy NTFS permissions. You can do it >>> with a VB Script too but you will end up with a much more complex >>> solution, which requires much more testing and debugging. >>> >>> However . . . If this is a production server and if people's ability to >>> do their job depends on the availability of the various shares then I >>> would get up at 1:30 am and supervise the delivery of this baby and test >>> things in full. Most of my clients would take a dim view of me having a >>> undisturbed rest while their system is falling to pieces. How tolerant >>> is your boss/client? How secure is your job? Anyone nipping at your >>> heels? >>> >> > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Change share script "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message news:e5cSkcA2JHA.1372@xxxxxx Quote: > Right, but when I create the share with the script, it simply makes it the > default name of the folder. Is there a switch in the script that would > allow it to add the $ in the share name? name: @echo off net share oldshare$ /delete net share newshare$="d:\User Files\ShareName" permcopy.exe {Technical Resource Kit} But I am curious. The workers will come in the next morning and need to get at their old data that is now stored at a new UNC location. Will that part of the change be automated so they will not need to know the UNC? /Al Quote: > "Pegasus [MVP]" <news@xxxxxx> wrote in message > news:ObYWoXA2JHA.5772@xxxxxx Quote: >> Share are hidden when they have a "$" at the end of their name. >> >> >> "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message >> news:%23ivCGDA2JHA.1420@xxxxxx Quote: >>>I forgot to mention that this also need to be a hidden share. Is there a >>>switch that I need to include? >>> >>> >>> "Pegasus [MVP]" <news@xxxxxx> wrote in message >>> news:%23FlPe5$1JHA.4412@xxxxxx >>>> >>>> "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message >>>> news:e8lG3x$1JHA.1712@xxxxxx >>>>> Hello, >>>>> >>>>> I am relatively new to scripting. In an effort to NOT wake up at 1:30 >>>>> in the morrning to migrate a share, does anyone know a vbscript to do >>>>> that? Here's what I have (all Win2003): >>>>> >>>>> \\server1\oldshare is the old share. We've migrated the data in the >>>>> share to a SAN and now it's stored in \\server1\newshare >>>>> >>>>> I want a script that will copy the NTFS permissions and then delete >>>>> the share to 'oldshare' while creating the share to 'newshare' >>>>> >>>>> Anyone have a path for me to take here? >>>>> >>>>> TIA! >>>>> >>>>> Jon >>>> >>>> The following three commands will do the trick: >>>> @echo off >>>> net share oldshare /delete >>>> net share newshare="d:\User Files\ShareName" >>>> permcopy.exe {Technical Resource Kit} >>>> >>>> I would actually use robocopy.exe to copy the files to the new >>>> destination - it has a switch to copy NTFS permissions. You can do it >>>> with a VB Script too but you will end up with a much more complex >>>> solution, which requires much more testing and debugging. >>>> >>>> However . . . If this is a production server and if people's ability to >>>> do their job depends on the availability of the various shares then I >>>> would get up at 1:30 am and supervise the delivery of this baby and >>>> test things in full. Most of my clients would take a dim view of me >>>> having a undisturbed rest while their system is falling to pieces. How >>>> tolerant is your boss/client? How secure is your job? Anyone nipping at >>>> your heels? >>>> >>> >>> >> > |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Change share script Al, It's a Citrix Terminal Server topology. Their profiles are stored centrally. Jon "Al Dunbar" <alandrub@xxxxxx> wrote in message news:e1R993C2JHA.5276@xxxxxx Quote: > > "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message > news:e5cSkcA2JHA.1372@xxxxxx Quote: >> Right, but when I create the share with the script, it simply makes it >> the default name of the folder. Is there a switch in the script that >> would allow it to add the $ in the share name? > No, you just put the "$" signs where they need to be - as part of the > share name: > > @echo off > net share oldshare$ /delete > net share newshare$="d:\User Files\ShareName" > permcopy.exe {Technical Resource Kit} > > But I am curious. The workers will come in the next morning and need to > get at their old data that is now stored at a new UNC location. Will that > part of the change be automated so they will not need to know the UNC? > > > /Al > Quote: >> "Pegasus [MVP]" <news@xxxxxx> wrote in message >> news:ObYWoXA2JHA.5772@xxxxxx Quote: >>> Share are hidden when they have a "$" at the end of their name. >>> >>> >>> "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message >>> news:%23ivCGDA2JHA.1420@xxxxxx >>>>I forgot to mention that this also need to be a hidden share. Is there a >>>>switch that I need to include? >>>> >>>> >>>> "Pegasus [MVP]" <news@xxxxxx> wrote in message >>>> news:%23FlPe5$1JHA.4412@xxxxxx >>>>> >>>>> "Jon LaBarge" <jon.labarge@xxxxxx> wrote in message >>>>> news:e8lG3x$1JHA.1712@xxxxxx >>>>>> Hello, >>>>>> >>>>>> I am relatively new to scripting. In an effort to NOT wake up at 1:30 >>>>>> in the morrning to migrate a share, does anyone know a vbscript to do >>>>>> that? Here's what I have (all Win2003): >>>>>> >>>>>> \\server1\oldshare is the old share. We've migrated the data in the >>>>>> share to a SAN and now it's stored in \\server1\newshare >>>>>> >>>>>> I want a script that will copy the NTFS permissions and then delete >>>>>> the share to 'oldshare' while creating the share to 'newshare' >>>>>> >>>>>> Anyone have a path for me to take here? >>>>>> >>>>>> TIA! >>>>>> >>>>>> Jon >>>>> >>>>> The following three commands will do the trick: >>>>> @echo off >>>>> net share oldshare /delete >>>>> net share newshare="d:\User Files\ShareName" >>>>> permcopy.exe {Technical Resource Kit} >>>>> >>>>> I would actually use robocopy.exe to copy the files to the new >>>>> destination - it has a switch to copy NTFS permissions. You can do it >>>>> with a VB Script too but you will end up with a much more complex >>>>> solution, which requires much more testing and debugging. >>>>> >>>>> However . . . If this is a production server and if people's ability >>>>> to do their job depends on the availability of the various shares then >>>>> I would get up at 1:30 am and supervise the delivery of this baby and >>>>> test things in full. Most of my clients would take a dim view of me >>>>> having a undisturbed rest while their system is falling to pieces. How >>>>> tolerant is your boss/client? How secure is your job? Anyone nipping >>>>> at your heels? >>>>> >>>> >>>> >>> >>> >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Powershell script to enumerate share space | PowerShell | |||
| Help Please - Script to change IE proxy settings | VB Script | |||
| Help with Change DNS/WINS PowerShell script | PowerShell | |||
| Password change script | VB Script | |||
| Help with Script to Create and Share User Directory | PowerShell | |||