_TAC_ Posted July 25, 2004 Share Posted July 25, 2004 hello,i'm looking for something likehttp://www.microsoft.com/technet/community...s/scrdfs72.mspx-------------------Change the Drive Letter of a VolumeDescriptionChanges the drive letter of volume D to Q. If you modify this script to change the drive letter of a volume other than D, note that the volume name in the WQL query must include both the colon ( and two forward slashes (\\). Thus drive C would look like this: C:\\. When specifying the new drive letter, however, you only have to include the colon (in the sample script, Q:).Supported PlatformsWindows Server 2003 : YesWindows XP : NoWindows 2000 : NoWindows NT 4.0 :NoScript CodestrComputer = "."Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume Where Name = 'D:\\'")For Each objVolume in colVolumes objVolume.DriveLetter = "Q:" objVolume.Put_Next-------------------The problem is that the "Win32_Volume" class doesn't exist under xp.I need something that chances the driveletter for the dvd-rom to z: and the driveletter for the dvd-rw to m: during unattended setup.thx for help Link to comment Share on other sites More sharing options...
Ausmith1 Posted July 25, 2004 Share Posted July 25, 2004 Try using diskpart. DiskPart is part of the Win2K Server Resource Kit and the Win2K Professional Resource Kit. (Microsoft includes DiskPart as a core utility in Windows Server 2003 and Windows XP.)diskpart /s CD-ROM.script > diskpart.LogREM Select the CD-ROM DriveSELECT VOLUME 0REM And reset it's drive letter to Z:ASSIGN LETTER=ZREM Scan the disks to see the new volumesRESCANEXITSee also:http://www.microsoft.com/resources/documen...s/diskpart.mspxhttp://support.microsoft.com/default.aspx?kbid=300415 Link to comment Share on other sites More sharing options...
PaulD_ixbt Posted July 26, 2004 Share Posted July 26, 2004 F:->Z:----swap_letter.cmd----mountvol F: /L >%temp%\guid.txtmountvol F: /Dfor /f %%i in (%temp%\guid.txt) do mountvol Z: %%idel /q %temp%\guid.txt-------- Link to comment Share on other sites More sharing options...
_TAC_ Posted July 26, 2004 Author Share Posted July 26, 2004 thx for the fast help.@Ausmith1 : diskpart looks not very easy to use@PaulD_ixbt : Your solution is exactly what i am searching for. I can also map my usb-card reader to a path with your script.----My configuration:The cd/dvd-drive is allways the first drive, the cd/dvd-writer is the second one (sec. contr.). Two harddisks are linked at the other controller (pri. contr.).In one System i have a promise pci controller with the boot harddisk and the data harddisk (pri master + sec. master) and the dvd-drive/dvd-writer are on the onboard one (pri. master + sec. master). The usb-card reader is - of course - at the usb port.harddisk 1 --> C: D:harddisk 2 --> E: F:DVD-Rom --> G: (should be Z:)DVD-Writer --> H: (should be M:)USB-Card Reader --> I: J: K: L: (should be mapped to subdirectorys on d:\usb-card\ ) D:\usb-card>dir /b 1-cf 2-md 3-sm 4-sd D:\usb-card>(very stupid work to do it by hand each time after a new installation)Now my next question: how can i reconize the "right" drive for each drive letter? Link to comment Share on other sites More sharing options...
tewk_dawg Posted July 29, 2004 Share Posted July 29, 2004 Why does this not work in a batch file, yet works line by line in DOS window.I get "f was unexpected at this time."I simply want to rename my cdrom to Z when all is said and done.--start of batch file---for /f "Tokens=3" %f in ('"echo list volume|diskpart|find /i "rom""') do set cdrom=%fmountvol %cdrom%: /L >%temp%\guid.txtmountvol %cdrom%: /Dfor /f %i in (%temp%\guid.txt) do mountvol Z: %idel /q %temp%\guid.txt--end of batch file---On a different subject:Does anyone know how I can put a timer on my version of Windows XP to expire after a certain amount of days. I've thought about a scheduled task that simply renames the password for the local admin account, but it seems to simple and easily detected, I was wondering if this has been discussed before anywhere? Link to comment Share on other sites More sharing options...
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