Page 1 of 1
show virtual machine name on desktop?
Posted: 12. Oct 2010, 12:55
by UncleBoarder
Is there a way to display the virtual machine name on the desktop? Like SysInternals BgInfo.
Re: show virtual machine name on desktop?
Posted: 12. Oct 2010, 13:17
by mpack
How would you change the desktop appearance normally? Do that.
Re: show virtual machine name on desktop?
Posted: 12. Oct 2010, 14:06
by Martin
You could use
'VBoxManage guestproperty set <vm name> vmname <vmname>'
to set a guestproperty variable and then read it out for BGINFO using
'VBoxControl guestproperty get vmname'
Re: show virtual machine name on desktop?
Posted: 14. Oct 2010, 05:10
by UncleBoarder
Great idea Martin!! It's perfect, I can add it to my clone script.
Do you happen to have a little more info on how to convert VBoxControl into something BGINFO understands?
Re: show virtual machine name on desktop?
Posted: 16. Oct 2010, 14:51
by Sasquatch
The command returns the string that you put in earlier on the Host side. If BGinfo can't work with command outputs, then you need to somehow get it into a variable or something and deal it that way. The information is all here, all you need to do is get the BGinfo manual or instructions or whatever and get down and testing things.
Re: show virtual machine name on desktop?
Posted: 16. Oct 2010, 17:46
by UncleBoarder
Yeah I know, and that's what I've been doing. But the things BGinfo understands are things I've never used, like VBscript and WMI. I tried setting an environment variable but the VM has to be running which I don't want. So that's why I'm asking for assistance. I'm working on it on my end but when you have to learn a new language just to accomplish one task, it seems more reasonable to leverage your resources and ask for a little help from the experts.
From Google I did manage to write a VBscript that works from DOS but it doesn't work from BGinfo.
Code: Select all
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "%comspec% /k vboxcontrol -nologo guestproperty get vmname"
Wscript.Quit
Re: show virtual machine name on desktop?
Posted: 18. Oct 2010, 10:43
by Martin
It's too long since I last scripted Bginfo, but don't you need an 'echo' statement to send the information to the screen?