Jump to content

Rico.JohnnY

Member
  • Posts

    246
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    China

Posts posted by Rico.JohnnY

  1. Changelog:

    2011-3-20:

    - Script has been totally rewrited, now supports both attended and unattended mode, a few command line parameters added.

    - Resolve the "access denied" issue while Windows Media Player Network Sharing Service was running(in most case).

    - Add "/r" switch for renewing owner and security info for files and subdirectories that exist ONLY in new profile location.

    2011-3-23: fix a bug that a user can't delete files when using original path instead of actual path. For example, "del c:\users\username\desktop\blah.txt" has the same effect as "del d:\users\username\desktop\blah.txt", "d:\users\username" is your new user profile location.

    2011-3-26: remove the external program "sleeper.exe", the sleep function now replaced by a small trick.

    2011-8-5: Bug fixed: Windows search under Seven's libraries did not function.

    Due to the side effects that using "FolderLocation" setting in answer file causes (described from this KB article

    ), I decided to write a script with the purpose of implementing redirection of user shell folders .This script only works under Vista/Server2008/win7/R2.

    post-21602-0-52648800-1301394724_thumb.j

    Notes:

    1. This script will totally redirect/move/migrate user/public profile directory to a new location specified, involving ntfs security info, owner, timestamps, attributes.

    2. It currently only supports one-way migration, which means once the original user/public profile(created by system) has been moved to new location, there is no way to move them back.

    3. To avoid unexpected problems, this script only supports migrate the following per-user shell folders within user profile: "
    Desktop
    ", "
    Documents
    ", "
    Music
    ", "
    Pictures
    ", "
    Videos
    ", "
    Favorites
    ", "
    Downloads
    ", "
    Contacts
    ", "
    Links
    ", "
    Saved Game
    ", "
    Searches
    ", and public shell folders within public profile: "
    Documents
    ", "
    Downloads
    ", "
    Music
    ", "
    Pictures
    ", "
    Recorded TV
    ", "
    Videos
    ", "
    Favorites
    ", "
    Libraries
    "(win7), "
    Appdata
    " and other folders are excluded.

    4. To preserve backward compatibility of pre-Vista applications, all the original shell folders are now replaced with junction points that point to their new shell folders location. The entire process is seamless, system and applications are not aware of the changes.

    5. This script is required to run with administrator privilege.

    6. It's highly recommended to make a backup of the entire user profile (and public profile if ) at your first try.

    Usage:

    1. It's recommended to build the same directory structure for your new profile as the original user profile, for example, "d:\users\username" for user profile, or "d:\users\public" for public profile, which holds Documents, Favorties, Pictures, Music, Videos etc. folders in it. If "d:\users\username" or "d:\users\public" does not exist , let the script do the rest, it will create the directory structure automatically(later on you can copy your files back in new location mannually).

    2. For use on a running operating system, close all running applications(especially real-time protection of anti-virus application) to avoid unexpected "access denied" issues, after script finished, restart the computer to make changes take effect.

    3. For use during unattended windows setup, You must invoke the script only from OOBE configuration pass using "
    Microsoft-Windows-Shell-Setup | FirstLogonCommands | SynchronousCommand
    " setting, when user acount has already been created and relative profile settings have been applied in place. To ensure the script runs wiith administrator privilege (elevated command), it's recommended to use this utility called "
    "

    For example:
    hstart /wait /runas moveshl.cmd /u:"d:\users\username" /p:"d:\users\public" /q

    4. For a detailed usage, type
    moveshl.cmd /help
    in command prompt window.

    PS: parameters are case-insensitive, and the sequence does not matter.

    In what circumstance should you use the "/r" parameter:

    - You have changed your system, for example, vista to win7, or win7 rtm to win7 sp1, and you intend to migrate user/public profile to a directory that is created by previous system or owned by a user on previous system.

    - You intend to migrate user/public profile to a directory that does not belong to currently logged on user.

    - You migrate user/public profile to a new location, then you receive "access denied" error when open files within the new location.

    In other words, if the security identifier (Sid) for current user has been changed(even with the same user name), you need to use the "/r" parameter to renew the security info for the files created by previous user, otherwise you will receive "access denied" error when open such files after migration.

    However, using the "/r" parameter will increase the time it takes to process, depending on the file size of the target location,
    so if you are just to re-install the same version of system, and migrate the user/public profile created default by system to a directory owned by the logged on user, you don't need to specify the "/r" parameter.

  2. When use regsvr32 /u "C:\Windows\System32\Macromed\Flash\Flash10a.ocx", it says "DllUnregisterServer in Flash10a.ocx succeeded.", but the addon still isn't uninstalled from IE7, which can be judged from the "Manager Add-Ons" page - the Flash10a.ocx is still there.

    Similar issue exists when use regsvr32 to register an ActiveX dll, successfully registered but the DLL doesn't appear in the "Manager Add-Ons" page, any ideas?

    Edit: The OS Platform is Windows Server 2008 Enterprise, IE ESC is turned off and security levels for all zones are set to default. What's odd is the ActiveX can be installed successfully if let IE7 download and install it.

  3. can u add ape format for playing too?

    i dun use it but i saw a lot ape out there...

    maybe useful to make a perfect winamp

    It will be taken into consideration in the next release.

    For now, you can add the ape format by yourself, just place the ape plugin for winamp into "$OUTDIR\Plugins", then install winamp.

    You can get the APE plugins from http://www.monkeysaudio.com , note that you only need the "in_APE.dll" file.

  4. Couple of observations on IE7 installation, and reinstallation of version 6.0.2900.2180 (version 6 for simplification) of iernonce.dll, on an existing Windows installation:

    First, the file iernonce.dll is not updated until after Windows restarts. After running IE7 install, and before restarting, version 6 of iernonce.dll remains in the %windir%\System32 folder. If you were to overwrite the file prior to a restart, you would accomplish nothing because the IE7 install doesn't complete until the restart has been performed, and version 6 is not replaced by version 7 until this restart.

    Second, the version of iernonce.dll is not updated in the %windir%\System32\dllcache folder, although other IE files in the dllcache folder are updated to their version 7 counterparts. iernonce.dll remains version 6.

    Don't know how this would affect an install of IE7 at T-13 - is it fully installed then? If not, replacing iernonce.dll immediately after installing IE7 may ultimately fail.

    Yes, as you said, iernonce.dll is updated after windows restarts. So if you replace it just after IE7 installfinishes, when windows reboots, the file will reverse to the 7.0 version one. Maybe someone would ask why not install IE7 at T-13 or T-12, and replace iernonce.dll

    at RunonceEx stage? don't forget, you have no chance to see the RunonceEx, coz after first reboot, before RunonceEx launches, iernonce.dll has been changed to version 7.0. Still unreasonable.

    In fact, you have another method to replace iernonce.dll. That is to replace the file IE7 use to update the older iernonce.dll after reboot. So where's the file ?

    Actually, not all of the IE files are updated immediately after IE7 finishes installation, some of the new IE files are renamed to SET**.tmp format and placed under system32 folder, and these new files will be renamed back to the original file name and overwrite the older ones just after windows restart. iernonce.dll is of this kind.

    That's why you replacing iernonce.dll just after IE7 install finishes doesn't work, instead you should replace the specified SET**.tmp file for the iernonce.dll. How to find the .tmp file for iernonce.dll?

    After IE7 install finishes(before restart), run regedit.exe, you can find a value named PendingFileRenameOperations under [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager], scroll down the value table until you find the "!\??\C:\WINDOWS\system32\iernonce.dll", look at the line up before this one, you should find something like "\??\C:\WINDOWS\system32\SET67.tmp" (the SET67.tmp may be differernt from yours), that's it, it is the temp file name for the new iernonce.dll. After windows reboots, this temp file name will be renamed to iernonce.dll. So all you have to do is replace this file with your old iernonce.dll(in my case is 6.0.2900.2180).Since the temp file name is generated dynamically, how to retrieve it correctly? Don't worry , i have written A autoit script for you to do the job. Here is my way of installing IE7:

    1. Use IEAK7 to make a custom copy of IE7 setup package, generally named IE7Setup.exe, extract it with winrar or 7-zip, from the extracted files, you should find a file named IE7-Setup.exe. OK, use /quiet /norestart /update-no /ieak-full: path to current dir with it to install IE7 silently at T-13 or T-12 stage.

    2. Place your older iernonce.dll in the folder along with the filecpy.exe. just run filecpy.exe after IE7 install finishes.

    ------------------------

    Directory Structure:

    post-110389-1167470669_thumb.jpg

    post-110389-1167474184_thumb.jpg

    The filecpy.exe autoit source:

    Opt( 'TrayIconHide', 1 )

    $var = RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager', 'PendingFileRenameOperations')
    If @error Then Exit

    $array = StringSplit($var, @LF)
    If @error Then Exit

    For $i = 1 To $array[0]
    If StringInStr( $array[$i], 'iernonce.dll' ) Then
    $array2 = StringSplit( $array[$i-1], '\' )
    $iernonceTmpName = $array2[$array2[0]]
    If FileExists( @ScriptDir & '\iernonce.dll' ) Then
    FileCopy( @ScriptDir & '\iernonce.dll', @SystemDir & '\' & $iernonceTmpName , 1 )
    EndIf
    ExitLoop
    EndIf
    Next

    Here's my XPlode install code for IE7 at T-12, just for reference.

    <item display="IE7">

    <execute display="Installing IE7 ...">
    <program>#SOURCEDRIVE#\Software\IE7\IE7Setup\IE7-Setup.exe</program>
    <arguments>/quiet /norestart /update-no /ieak-full:#SOURCEDRIVE#\Software\IE7\IE7Setup\</arguments>
    </execute>
    <execute display="Restore iernonce.dll to version 6.0.2900.2180 ...">
    <program>#SOURCEDRIVE#\Software\IE7\IERNONCE6\filecpy.exe</program>
    </execute>
    </item>

    By this way, IE7 install perfectly and doesn't interrupt other apps install at RunonceEx, hope it can help.

    Finally, sorry for my English..

×
×
  • Create New...