Your independent source for application and desktop virtualization.
Sign in
|
Join
Home
Topics
Blogs
Forums
Training Classes
Events
Books
About Us
Discussion Forums
»
Tech Support Forums
»
Scripting / Automation
»
Changing drive letter in script
Marketplace
Changing drive letter in script, in the Scripting / Automation forum on BrianMadden.com
rated by 0 users
This post has 7 Replies | 0 Followers
Reply
Guest
Posted: 11-10-2005 1:14 PM
rated by 0 users
I'm trying to find what the command would be to change the drive letter in a script. For example if I wanted to change the drive from c: to d: I could type just that. Is there a difference when doing from a script?
| Post Points: 80
Points 20,562
Reply
Rudy Bauer
replied on
11-10-2005 1:22 PM
rated by 0 users
Depends on what scripting language you are using. In a Windows batch file the command would simply be "d:" (without the quotes).
Rudy
| Post Points: 5
Points 1,280
Reply
I.J. de Mes
replied on
11-13-2005 4:32 PM
rated by 0 users
Hi,
you can use the following vbscript.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colVolumes = objWMIService.ExecQuery _
("Select * from Win32_Volume Where Name = 'C:\\'")
For Each objVolume in colVolumes
objVolume.DriveLetter = "D:"
objVolume.Put_
Next
Good luck!
\\Ivan de Mes
| Post Points: 5
Points 87,103
Reply
Jeff Pitsch
replied on
11-13-2005 6:20 PM
rated by 0 users
Yea, I would HIGHLY recommend NOT doing this to a volume drive letter. Your server will crash repeatedly if it comes back up after a reboot at all. Which it won't.
| Post Points: 20
Points 1,345
Reply
Brett Gilmour
replied on
11-13-2005 7:28 PM
rated by 0 users
If you do need to change a drive letter, do it before installing Citrix. Citrix themselves make a utility that does it for you. The file is DriveRemap.exe, you can automate this in a script, like the following:
driveremap /u /drive:M /noreboot
This command will remap the servers drives starting with the first available drive to M: and not display any dialog boxes or require any input.
For more information about this command, check out this link:
http://support.citrix.com/kb/entry.jspa?entryID=1985
Brett Gilmour
| Post Points: 5
Points 1,345
Reply
Brett Gilmour
replied on
11-13-2005 7:35 PM
rated by 0 users
Ok after reading your post again, it looks like I have misunderstood what you are wanting to do. Why do you need to change to the D: for?
If you are wanting to install applications, I would recommend using MSIEXEC /i D:\Filename.MSI /quiet
You dont need to change to D: if you use that method.
You can also use \\server\share instead of using a drive.
Brett Gilmour
| Post Points: 5
Points 1,280
Reply
I.J. de Mes
replied on
11-14-2005 3:31 AM
rated by 0 users
Like Jeff said. Do not use the script on volumes where the OS resides. This script is just an example. You must use the drive remap util from Citrix to accomplish it on a OS contained volume.
\\Ivan de Mes
| Post Points: 5
Points 5
Reply
Jim Smart
replied on
07-24-2008 6:49 AM
rated by 0 users
Folks I have a server 2003 terminal server which has a drive W:. I beleive the last tech remapped drive c to be w: However drive c: is still intact but this drive w: shows as a volume drive. I would like to unmap this drive as it is confusing our users. Any way to dump it would be appreciated. There is nothing really installed on W:
| Post Points: 5
Previous
|
Next
Page 1 of 1 (8 items) |
RSS
Copyright © 1997-2008 The Brian Madden Company, LLC |
Disclosures
|
Privacy
|
Terms of Use
|
Contact Info