Sign in to follow this  
Followers 0
zamboni128

Rename "My Computer" icon label

4 posts in this topic

I'm trying to write a script that will change the label on the desktop computer icon to the computer name. The following vbs script works and i'm trying to convert it to autoit.

---VBS---

Dim objShell

Dim objFolder

Dim objFolderItem

Const MY_COMPUTER = &H11&

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_COMPUTER)

Set objFolderItem = objFolder.Self

objFolderItem.Name = "test"

---VBS---

I've researched and tried the following autoit script but it does not work on windows 7 because of registry permissions (?)

RegWrite ("HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "LocalizedString", "REG_SZ", "test")

Can anyone help me convert the VBS script to AutoIT?

Thanks in advance

Share this post


Link to post
Share on other sites



It's simple as we can use objects too :x All you need to do is change the syntax slightly.

Global Const $MY_COMPUTER = 0x11

Local $objShell = ObjCreate("Shell.Application")
Local $objFolder = $objShell.Namespace($MY_COMPUTER)
Local $objFolderItem = $objFolder.Self
$objFolderItem.Name = "Test Computer"

Share this post


Link to post
Share on other sites

Thank you very much for the information and fast reply.

Share this post


Link to post
Share on other sites

It's simple as we can use objects too :x All you need to do is change the syntax slightly.

Global Const $MY_COMPUTER = 0x11

Local $objShell = ObjCreate("Shell.Application")
Local $objFolder = $objShell.Namespace($MY_COMPUTER)
Local $objFolderItem = $objFolder.Self
$objFolderItem.Name = "Test Computer"

Is there a place i can look at that will tell me all the methods available for an object?

Another-words, how do I know i can use .Self as a method for the above object?

This is probably a basic question so thanks for your patience.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0