Share Settings Resetting after Reboot


  1. Posts : 6
    Windows 7 Home Premium 64bit.
       #1

    Share Settings Resetting after Reboot


    Hi I recently got an Win7 Home Premium Desktop. I also had some external USB HDD's which I am attaching to the desktop computer. The problem is the share settings on these external USB drives do not stick, and resets whenever I reboot, and reverts back to not shared.

    I have narrows it down to that fact that the USB drives seems to get mounted with a significant enough of a delay that somehow the system looses the share settings. This problem does not happen with the built-in internal HDD, nor did this occur when I had the external USB HDD's on a WinXP system.

    Is there any way to overcome this issue?
      My Computer


  2. Posts : 5,092
    Windows 7 32 bit
       #2

    As an experiment try getting the external drives working correctly. Then eject them and kill the power to the drives. Reboot. Power up the drives. See if the shares are still intact.

    I used internal drives in USB docking stations. I powered down the docks before shutting down or rebooting. Then powered them up after login. The share settings held up very well.

    If the power off technique works then you may need to use batch files with Net Use statements to map drives instead of the automatic reconnect method.

    Edit: It's a good idea to use something link sync.exe from SysInternals to flush the drive buffers before powering them down.
      My Computer


  3. Posts : 6
    Windows 7 Home Premium 64bit.
    Thread Starter
       #3

    Thanks for the suggestion. I tried what you recommended. The interesting thing is it won't let me eject the volume that I had set to share saying its in use (but I know no one else is using the volume). But I can eject the others I havent set the share permissions on.

    I also tried to just unplug the volume without ejecting and then plugging it back in. The computer in that case, remounts the volume and the share setting comes back as it was.

    So it seems it only looses the share settings when the computer itself reboots, AND encounters a delay in the mounting process which is always under Windows 7, that didnt occur under WinXP.

    Does any of that make any difference? I mean I can make a script to configure the sharing as you suggested, but would be nice if I didnt have to, and to figure out why this occurs.
      My Computer


  4. Posts : 5,092
    Windows 7 32 bit
       #4

    Ok, I suggested eject to be on the safe side. But as you point out, it won't do it while shared. What I did with my docking stations is wait for drive activity to stop. Then run sync.exe to flush the disk buffers. Then I would power down the docks. On boot I would run the batch with net use statements etc..

    I did notice with my external Seagate FreeAgent USB 2.0 that I could leave it plugged in wih Vista. But W7 didn't like that so much. So I plugged it back into the Vista machine.

    I don't know if there's a way to get rid of the W7 latency with externals. And this drive was set to never spin down until the machine shut down. Have you looked on forums of the particular drive maker? Often brand specific work-arounds can be found there.

    The only other thing I might try is setting the network services to Automatic(Delayed Start) and see if that gives the drives a chance to spin up.
      My Computer


  5. Posts : 6
    Windows 7 Home Premium 64bit.
    Thread Starter
       #5

    Here's what I ended up doing in case anyone wants to know.
    I put a batch file in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    The batch file has the following code:

    Code:
    @echo off 
    cls
    
    echo Setting Up External Drive Share.
    echo off 
    
    setlocal
    
    set counter=0
    :archivesharing
    if exist "Z:\" (
      echo Z:\ Drive exists.
      echo off 
       
      net share Archives /DELETE
      echo Set Archives Share
      net share Archives=Z:\ /GRANT:Everyone,FULL
      
    ) else (
    
      echo Waiting for Archives to Mount.
      timeout /t 1
      set /A counter = %counter% + 1
      if %counter% leq 120 (
      goto :archivesharing
      )
    
    )
    endlocal
    However, I want to do the following instead:

    Code:
    @echo off 
    cls
    
    echo Setting Up External Drive Shares.
    echo off 
    
    setlocal
    
    set counter=0
    :archivesharing
    if exist "Z:\" (
      echo Z:\ Drive exists.
      echo off 
      set sharestate=net view desktopw7 | findstr "Archives" 
      if "%sharestate%" equ "" (
      echo Set Archives Share
      net share Archives=Z:\ /GRANT:Everyone,FULL
      )
    ) else (
      echo Waiting for Archives to Mount.
      timeout /t 1
      set /A counter = %counter% + 1
      if %counter% leq 120 (
      goto :archivesharing
      )
    )
    endlocal
    The problem though is
    Code:
     set sharestate=net view desktopw7 | findstr "Archives"
    Doesn't seem to assign the sharestate value properly and is always blank. Any ideas on why that is?
    I've tried a bunch of other ways to assign this variable using for loop, tmp file etc but that variable refuses to have any values assigned to it other then simple numbers.
      My Computer


  6. Posts : 5,092
    Windows 7 32 bit
       #6

    When I do batch it's way simpler. So I'm not the one to debug it. Perhaps someone else can see something.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:56.
Find Us