MCT Posted December 19, 2004 Posted December 19, 2004 ive got the following reg file..[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies]"NoFileMru"=dword:00000001"NoBackButton"=dword:00000001[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ComDlg32][HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ComDlg32\PlacesBar]"Place0"="G:\\""Place1"="C:\\""Place2"="C:\\Documents and Settings\\Administrator\\Desktop\\Wallpapers""Place3"="C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures"which works, but how can i get a list of all hdds & set them unattended? its probly something simple...i just cant figure it out
maxXPsoft Posted December 19, 2004 Posted December 19, 2004 Modify Placesbar = pretty goodhttp://www.puppypc.com/windows/rt/comdlg_placebar.htmI think this is what you are looking for
MCT Posted December 19, 2004 Author Posted December 19, 2004 i know how 2 create it, but i want to set the harddrives unattended..
what3v3r Posted December 19, 2004 Posted December 19, 2004 you could try copying a text file to the root of every hdd likecopy /y %DVD%\hdd.txt d:\copy /y %DVD%\hdd.txt e:\copy /y %DVD%\hdd.txt f:\...and afterwards you look for it, like:IF EXIST d:\hdd.txt REG ADD......this is similar to the method used to discover the driveletter of the DVD/CD drive.its propably not the best solution, but it should work
MCT Posted December 19, 2004 Author Posted December 19, 2004 i was gonna do that, but i thought.. during unattended install if you have a floppy or other recordable media in the pc, it would copy that file there, thus leaving u stranded
what3v3r Posted December 19, 2004 Posted December 19, 2004 you could exclude the a: and b: drive from the list. but i can see your point.well it was just a thought
nakira Posted December 19, 2004 Posted December 19, 2004 Here is a (messy) suggestionThis vbs will return a list of all fixed drives.'Drives.vbsSet fso = CreateObject("Scripting.FileSystemObject")Set dc = fso.DrivesFor Each d in dc if (d.DriveType = 2) Then ltr = ltr & vbCrLf & d.DriveLetterNextWSCript.Echo ltrA sample.cmd for usage@echo offcscript //nologo drives.vbs>drives.listFOR /F %%i in (drives.list) do echo Maybe use reg add on this line: %%ipause
Tsunami Posted December 19, 2004 Posted December 19, 2004 And here's the not so messy vbs file :Set Shell = CreateObject("WScript.Shell")Set FSO = CreateObject("Scripting.FileSystemObject")I = 0For Each Drive in FSO.Drives If Drive.DriveType = 2 Then Shell.RegWrite "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ComDlg32\PlacesBar\Place" & I, Drive.DriveLetter & ":\" I = I + 1 End IfNextNo external files needed, just run it from anywhere you like Edit: Replaced the double slashes with one slash.
nakira Posted December 19, 2004 Posted December 19, 2004 ROFL of course. *slaps self*I need to wake my brain up.
MCT Posted December 20, 2004 Author Posted December 20, 2004 @Tsunamiyours doesnt work, i havent tested nakira's yet, but with yours it just erases the preset 1s any ideas how 2 fix it since i dont know vbs thanks EDIT: nakiras doesnt work either it adds the value "C:\\" so it doesnt register
nakira Posted December 20, 2004 Posted December 20, 2004 nakiras doesnt work either it adds the value "C:\\" so it doesnt registerEhm, The vbscript and sample.cmd I gave didn't add anything, they only echoed some text along with the drive letter (e.g. C), no ":\\" at all anywhere. Any added would be from your code. Anyway try this cmdfile along with the vbsfile from my earlier post.This seeks the current places, and adds all drive letters as entries from the last existing entry it finds.That is, you already have"Place0"="G:\\""Place1"="C:\\""Place2"="C:\\Documents and Settings\\Administrator\\Desktop\\Wallpapers""Place3"="C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures"So this would add from Place4 onwards for as many drives as you have (with Place4 being C:\ again )I don't know how many PlaceS you want though, you already have 4 and AFAIK only 5 are valid. *shrug*REM Addplaces.cmd@echo offsetlocal ENABLEDELAYEDEXPANSIONset cnt=-2for /f %%i in ('reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\comdlg32\PlacesBar /s') do ( set /A cnt+=1)cscript //nologo drives.vbs>drives.listFOR /F %%i in (drives.list) do ( reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ComDlg32\PlacesBar /v Place!cnt! /d %%i:\ /f set /A cnt+=1)del drives.list
Tsunami Posted December 20, 2004 Posted December 20, 2004 @Tsunamiyours doesnt work, i havent tested nakira's yet, but with yours it just erases the preset 1s any ideas how 2 fix it since i dont know vbs thanks EDIT: nakiras doesnt work either it adds the value "C:\\" so it doesnt registerYes, it replaces the presets, but your reg file does that too. I tested it on my HKCU key, because I disabled the Places bar, but I'll reenable it and see if I can change it so it will add places instead of overwriting them.Edit: Alright, I misunderstood you. I thought you meant it erased the default places, but you meant it wasn't showing any places at all. I just tested it, and apparently you don't need the two slashes in a vbs file. Use one slash and it will work.
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