midiboy Posted July 9, 2004 Posted July 9, 2004 Hi guys !I am trying to automate the creation of user shell folder so I created the following batch files:1. if not exist "D:\%USERNAME%" md "D:\%USERNAME%"if not exist "D:\%USERNAME%\Eigene Bilder" md "D:\%USERNAME%\Eigene Bilder"if not exist "D:\%USERNAME%\Eigene Videos" md "D:\%USERNAME%\Eigene Videos"if not exist "D:\%USERNAME%\Eigene Musik" md "D:\%USERNAME%\Eigene Musik"if not exist "D:\%USERNAME%\Favoriten" md "D:\%USERNAME%\Favoriten"if not exist "D:\%USERNAME%\Outlook" md "D:\%USERNAME%\Outlook"2.[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]"Favorites"="D:\\%USERNAME%\\Favoriten""Personal"="D:\\%USERNAME%""My Pictures"="D:\\%USERNAME%\\Eigene Bilder""My Music"="D:\\%USERNAME%\\Eigene Musik""My Video"="D:\\%USERNAME%\\Eigene Videos"I am calling those at the beginning of my runonceex files. I don´t know yet if those work correctly because when I tested on my virtual machine drive D was not yet formatted.Now my idea is the following: Would it be possible to let Windows check at this stage during the setup if D: is formatted yet and if it is to do the above and if it is not, to first make a quick format with NTFS and then do the above ??This of course should be safe, because if there are data on D. already it should not reformat the drive ! Any ideas ?Thanks for your helpAlex
GreenMachine Posted July 9, 2004 Posted July 9, 2004 I believe an unformatted disk is not assigned a drive letter on install. If this is the case, you would need to see if there is a drive D:, if it is a hard disk or CD (possible with various tools, or in the registry, or by trying to write a test file to the CD), possibly re-arrange the drive letters (possible with MOUNTVOL in XP), and call FORMAT if needed.Well ... you asked for ideas!
midiboy Posted July 9, 2004 Author Posted July 9, 2004 Hi GreenMachine!Thank you for your answer ! I believe an unformatted disk is not assigned a drive letter on install.That is not true unfortunately. If a partition is created during the first stage of Windows setup, it will be assigned a drive letter but will not be formatted. Writing a test file and then checking if the file exists would be a possibility but there may be a "cleaner" way to check if the driver is formatted or not, because if the drive is indeed a CDROM formatting would obviously fail.Also I just found out that the above registry tweak to create shell folders ( which I found out by monitoring registry changes while making those changes with TweakUI ) does not work at all. The folders still point to the default Shell folders in %USERPROFIL%Any idea why this tweak does not work ? Possibly because of the use of the environment variable %USERNAME% ?Thanks,Alex
GreenMachine Posted July 9, 2004 Posted July 9, 2004 OK ...Most of that can be scripted. I do it with Windows Command Script (.CMD) files, because I'm that way ...I do not have a non-formatted disk on hand, so I cannot test, but if there is indeed a drive letter, then I seem to remember that the output of a DIR command on an unformatted drive is "File Not Found". You could redirect that output to a text file, and examine that file with the FIND or FINDSTR command. Personally, I don't see anything wrong with trying to format a CD drive: it will error out and go on it's way.As for your directories, I do something similar AFTER setup, and I update the "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]" key, not the "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]". That works fine for me. There is nothing im my code that prevents doing this BEFORE setup completes, but in this way, the Administrator does not have the redirected directories. I also have %USERNAME% in the registry after I finish, which is needed unless you want all users to share files, which I don't think is the case.So, the short answer is that it is all doable, though it might require a bit of coding and experimenting.Haertzlichen Glueckwuensch!
midiboy Posted July 10, 2004 Author Posted July 10, 2004 Haertzlichen Glueckwuensch!Hey GreenMachine! Close enough ! It´s actually "Herzlichen Glueckwunsch"! By the way, at least momentarily I have given up on the whole idea of automating shell folder creation for each new user. I have played around for days now trying to get this to work but it does not.No matter if I change "User Shell Folders", "Shell Folders" or both in the registry, right clicking "My documents" on the desktop still shows the old wrong path to the User Profile on C. Also since I have an expert on HKCU settings here ( read through most of your great webste! ) I have one more question unrelated to the topic of this thread. Maybe you have some tipps up your sleeve ! I am loading almost all of my regtweaks during the T13, T12 stage so it affects the default user Profile. However, some settings will not work this way. Most prominent are some visualeffects settings, screensaver settings, audio settings etc.So my solution is to reload the same registry tweaks upon first creation of the actual user profile (I am adding a self destructing batch file to the Autostart folder of the Default user Profile during Setup )This does work but the settings actually only work the second time the user logs on (seems logical).So my short question to this somewhat long introduction is:Is there a way around this ? Either by making the settings work right from the start by changing the default user profile or making them work at the first start of the newly created user profile ?Anyway, thanks for your help !Alex
GreenMachine Posted July 11, 2004 Posted July 11, 2004 Haertzlichen Glueckwuensch!Hey GreenMachine! Close enough ! It´s actually "Herzlichen Glueckwunsch"! Strange: Ein Haertz fuer Kinder, but Hertzlichen Glueckwunsch. Damned Umlauts ... Still, I know how to count (Ein Bier, Zwo Bier, Drei Bier ... )As for tweaks not taking, I never understood this. I have many tweaks applied from SVCPACK.INF (CMDLINES.TXT would also work), and no problem making them "stick". This includes various "visual" settings: Details View in Explorer, ShowHidden, Status Bar, and more.However, if that really does not work for you, I would suggest doing what I suggested previoulsy: Upon first logon as the Administrator, load the Default User's Hive, apply the registry settings, and then unload the Hive. The Administrator Account will NOT have the tweaks, but all subsequent users will. This would look something like this:REG LOAD HKU\TempHive "%SYSTEMDRIVE%\Documents and Settings\Default User\NTUSER.DAT" REG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "Desktop" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Desktop" /F REG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "Favorites" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Favorite" /F REG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "My Pictures" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Pictures" /F REG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "Personal" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Document" /F REG UNLOAD HKU\TempHive(Cut and paste into a text file for proper line wraps.)
midiboy Posted July 11, 2004 Author Posted July 11, 2004 Strange: Ein Haertz fuer Kinder, but Hertzlichen Glueckwunsch. Damned Umlauts ... Still, I know how to count (Ein Bier, Zwo Bier, Drei Bier ... )Well, actually you have that wrong ! It is "Ein Herz fuer Kinder" and "Herzlichen Glueckwunsch" ... so both times just a "z" and no Umlaut or "tz" ! But I am glad you can order Bier .. so at least you won´t starve in Germany or Austria! Ok, back to my problem ...You are a genius ... this method worked for getting the User Shell Folders to stick, but unfortunately it did not work for my the few visual settings that do not stick. Since I have no experience in creating this I simply copied from your example and adjusted the obvious like "REG_DWORD" etc.But apart from the User Shell Folders nothing else worked. I know I am asking a lot but could you maybe have a look at my file below and tell me if something very obvious is wrong with it ?Thank you very much !my regadd.cmd:@ECHO OFFREG LOAD HKU\TempHive "%PROFILES%\Default User\NTUSER.DAT"REG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "Desktop" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Desktop" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "Favorites" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Favoriten" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "My Pictures" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Eigene Bilder" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "Personal" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "My Music" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Eigene Musik" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /V "My Video" /T REG_EXPAND_SZ /D "D:\%%USERNAME%%\Eigene Videos" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /V "VisualFXSetting" /T REG_DWORD /D "3" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow" /V "DefaultValue" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing" /V "DefaultValue" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect" /V "DefaultValue" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow" /V "DefaultValue" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewWatermark" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewWatermark" /V "DefaultValue" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation" /V "DefaultValue" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade" /V "DefaultValue" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations" /V "DefaultValue" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation" /V "DefaultApplied" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation" /V "DefaultValue" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\WebView" /V "DefaultApplied" /T REG_DWORD /D "1" /FREG ADD "HKU\TempHive\Control Panel\Desktop" /V "ScreenSaveActive" /T REG_SZ /D "0" /FREG ADD "HKU\TempHive\Control Panel\Desktop" /V "SmoothScroll" /T REG_DWORD /D "0" /FREG ADD "HKU\TempHive\Control Panel\Desktop" /V "UserPreferencesMask" /T REG_BINARY /D "b0,00,03,80" /FREG ADD "HKU\TempHive\Control Panel\Desktop\WindowMetrics" /V "MinAnimate" /T REG_SZ /D "0" /FREG ADD "HKU\TempHive\Control Panel\Desktop\WindowMetrics" /V "Shell Icon BPP" /T REG_SZ /D "16" /FREG ADD "HKU\TempHive\AppEvents\Schemes" /V "@" /T REG_SZ /D ".None" /FREG UNLOAD HKU\TempHiveexit
GreenMachine Posted July 11, 2004 Posted July 11, 2004 Now I remember, it wasn't only the Umlauts, it was that "Z" and "TZ" thing, too. (Ich hab's schon wieder upgef*cked!)Sorry, right now I am packing my bags, but I will test a bit next week if you are still interested.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now