Reputation: 185
Hi i have a disk whose label is "Local Disk". I am performing some action and formatting that disk ,want to rename that disk label to "Local Disk" but i am getting error in below line because of space in Local and Disk. I writing below code for that
strOutput = ExecuteDiskPartCommand("Format fs=ntfs label=”Local Disk” quick") // Error
strOutput = ExecuteDiskPartCommand("Format fs=ntfs label=”LocalDisk” quick") // No Error
How can i acheive this "Local Disk" in Vbscript?
Upvotes: 0
Views: 193
Reputation: 1
Try this : strOutput = ExecuteDiskPartCommand("Format fs=ntfs label= & Chr(34) & "Local Disk" & Chr(34) & "quick")
Upvotes: 0
Reputation: 634
It looks like you need escaped quotes around "Local Disk":
strOutput = ExecuteDiskPartCommand("Format fs=ntfs label=""Local Disk"" quick")
Plus, I don't think space (alt-32) is allowed: http://msdn.microsoft.com/en-us/library/ms832054.aspx
Upvotes: 1