Drive / Volume Label
-
murdock01
- Posts: 55
- Joined: 08 Nov 2010 19:35
Drive / Volume Label
Is there a way to read and display the volume label? I cannot seem to find anything for that in the help. I would like to display the volume label for usb drives as tab names, or use for scripting for copying files to certain usb drives. Since I could have multiple usb drives in the system at once, I could use the label as a check.
This would be similar to software like freefilesync being able to sync to certain drives by volume label so as not to be dependent on drive letter (since that could change).
Maybe this could be a new wished for feature / script command!?
Thanks for any help.
This would be similar to software like freefilesync being able to sync to certain drives by volume label so as not to be dependent on drive letter (since that could change).
Maybe this could be a new wished for feature / script command!?
Thanks for any help.
-
highend
- Posts: 14954
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Drive / Volume Label
Possible but not pretty...
look at sc report() in "drives mode"
look at sc report() in "drives mode"
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 66360
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Drive / Volume Label
You mean tabs that point to the root of a drive should optionally display the drive label in the header instead of just the letter?
FAQ | XY News RSS | XY X
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Drive / Volume Label
Don I believe murdock01 would like to be able to read the "label" of the removable drive such that it can be then used in a tab. The tab would be better identified as he said. The "label" would be consistent across computers as well since we know the drive letter can change. See his other post in the script section http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=10628
Thanks,
Ken
If you assign a "label" to the drive in disk management the label is seen across computers. I assigned the label, ""EVERYDAY" to a flash drive on the desktop, put the drive in my laptop and there it was "EVERYDAY". Only played with this for a few minutes last night but I was having no success in using sc report to obtain that label I assigned it was only giving me drive "E:" Is it presently possible to get the actual label in my case "EVERYDAY" using report or some other way? "EVERYDAY" displays in XY's tree just fine. It would be a nice feature in scripting to be able to check for the drive label's existence. By the way, what you stated would be a nice feature as well.I also thought it would be cool to figure out a way to read the drive, or volume, label and have that in the name of the tab. Then when using multiple tabs each one is better identified.
Thanks,
Ken
To see the attached files, you need to log into the forum.
-
Filehero
- Posts: 2731
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: Drive / Volume Label
I join Ken and say this would indeed be a nice and handy option.admin wrote:You mean tabs that point to the root of a drive should optionally display the drive label in the header instead of just the letter?
Cheers,
Filehero
-
highend
- Posts: 14954
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Drive / Volume Label
It can be done via scripting but as I already stated, it's ugly (because it requires you to switch to the "Computer" folder for a split second)...
e.g. via:
Ofc an option (which should be changeable on the fly) that displays labels instead of drive letters (with path) would be much more convenient...
e.g. via:
Code: Select all
$old_path = "<curpath>";
goto "Computer";
$labels = report("{Name}|");
goto $old_path;
$tab_count = tab("get", "count");
foreach ($item, $labels, "|") {
if ($item != "") {
$cur_label = trim(gettoken($item, 1, " ("));
$cur_drive = trim(gettoken($item, 2, " ("), ")");
$i = 1;
while ($i <= $tab_count) {
$cur_tab_caption = tab("get", "caption", $i);
if ($cur_tab_caption LikeI "$cur_drive*") {
tab("rename", "$cur_label", $i);
}
$i++;
}
}
}One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 66360
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Drive / Volume Label
Thanks highend, I didn't have much time, but I was forgetting the label has to come from the "name" column header so we have to go to "Computer" as my own capture displays...as Homer would say, Duh! It would be great to be able to retrieve the label directly without an actual change in the tree.
I'd like to be able to retrieve and distinguish the removable drive "labels" only in some way. It doesn't look I like we could use the results of directly to get the removable drive(s) label only, unless we matchup the results of the above with your code I'm more interested in a general way of singling out the "removable" drive label to be used in any number of ways in scripting.
Edit: Your script works great highend thank you, but like you said it's ugly because of the drive/tree change. To simply get the label of the "removable" drives when we don't currently have a tab for the drives I think I'd have to tweak it to do something like I said above.
Don, yes a new scripting function would be great.
Thanks again,
Ken
I'd like to be able to retrieve and distinguish the removable drive "labels" only in some way. It doesn't look I like we could use the results of
Code: Select all
$Rem_Dr = get("drives", 2), "|");Code: Select all
$labels = report("{Name}|");Edit: Your script works great highend thank you, but like you said it's ugly because of the drive/tree change. To simply get the label of the "removable" drives when we don't currently have a tab for the drives I think I'd have to tweak it to do something like I said above.
Don, yes a new scripting function would be great.
Thanks again,
Ken
-
murdock01
- Posts: 55
- Joined: 08 Nov 2010 19:35
Re: Drive / Volume Label
Thanks Highend I did look into the report function in drives mode.
Then when I run that script with my usb drives in I would see a 'diags', 'firmware', and 'osload' tabs for example, instead of 'f:\', 'g:\', and 'l:\'. Then I could drag and drop files on the correct drive without having to check which drive is which. I could also execute a script say to copy all firmware files to the drive called 'firmware' and the script function would read the drive labels, figure out which drive was the correct drive, and begin the file copy.
Maybe an option that displays the drive label instead of drive letter in all the places you would see the drive letter, like in the breadcrumb for example - just a thought.
I am looking for more of the scripting function.
Thanks all. I am glad some like this idea.
Shawn
I think this would be handy and it looks like others might like this option also.You mean tabs that point to the root of a drive should optionally display the drive label in the header instead of just the letter?
This would be just dandy I think. This would be what I am looking for in my removable drives tabs script - ttp://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=10628So the request is for a new scripting function?
Then when I run that script with my usb drives in I would see a 'diags', 'firmware', and 'osload' tabs for example, instead of 'f:\', 'g:\', and 'l:\'. Then I could drag and drop files on the correct drive without having to check which drive is which. I could also execute a script say to copy all firmware files to the drive called 'firmware' and the script function would read the drive labels, figure out which drive was the correct drive, and begin the file copy.
Maybe an option that displays the drive label instead of drive letter in all the places you would see the drive letter, like in the breadcrumb for example - just a thought.
I am looking for more of the scripting function.
Thanks all. I am glad some like this idea.
Shawn
-
admin
- Site Admin
- Posts: 66360
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
jimmy325
- Posts: 1
- Joined: 18 Nov 2013 05:41
Re: Drive / Volume Label
Thanks highend , your script did some help.
----------------------
Sig removed because of spam. User account banned. Bye.
S.
.
----------------------
Sig removed because of spam. User account banned. Bye.
S.
.
-
Filehero
- Posts: 2731
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: Drive / Volume Label
I realized that the new SC has already been implemented.
What I do not know (can't check now) is wether the drive label/name would also been shown on the corresponding tab now when the drive root is selected?
Sorry if I completely lost track on this issue, Don and the XY crowd is simply to fast sometimes.
Cheers,
Filehero
What I do not know (can't check now) is wether the drive label/name would also been shown on the corresponding tab now when the drive root is selected?
Sorry if I completely lost track on this issue, Don and the XY crowd is simply to fast sometimes.
Cheers,
Filehero
-
Filehero
- Posts: 2731
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: Drive / Volume Label
Hi Don,
would it mean a big deal to optionally make the drive's label shown in tab headers (of course, if it exists and if the tab's current location is the drive root)?
Cheers,
Filehero
would it mean a big deal to optionally make the drive's label shown in tab headers (of course, if it exists and if the tab's current location is the drive root)?
Cheers,
Filehero
-
admin
- Site Admin
- Posts: 66360
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Drive / Volume Label
I could add that to Configuration | Tabs | Tab captions: | Custom...
FAQ | XY News RSS | XY X
-
Filehero
- Posts: 2731
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
XYplorer Beta Club