Jump to content
Sign in to follow this  
RedSoxGeek

Rename Folder as ComputerName

Recommended Posts

RedSoxGeek

Dim $computername = @computername DirCreate("C:\NewFolder\config\computername") $FolderOld = "C:\NewFolder\config\computername"0 $FolderNew = $computername DirMove($FolderOld, $computername)

Hello All,

I am trying to create a script that will create a folder and then rename that folder as the client computer name. Then what I would lke to do is have the folder become a toolbar on the taskbar so the end user will always know their computer name. The first problem that I need to get by is how to rename the folder that is created as the computer name. I can't see away to make that happen. I am sure it is possible but I can't seem to make it happen.

Then is someone is feeling really ambitious and helpful maybe we could put our heads together and figure out a way to make a new toolbar. I would like to automate this because I would like to get this sent out to a couple of hundred computers.

Thanks

RSG

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
RedSoxGeek
Ya that is way simpler and exactly what I wanted to happen. Thank you… I tried something similar to that before but I think I forgot the &. Again thanks…

Share this post


Link to post
Share on other sites
Fire

DirCreate(@HomeDrive&"\testfolder")
Sleep(500)
RunWait("cmd.exe /c rename " & @HomeDrive&"\testfolder " & "%computername%",@WindowsDir,@SW_HIDE)
Run("cmd.exe /c " & "START /MIN " & @HomeDrive&"\"&"%computername%",@HomeDrive,@SW_HIDE)


[size="5"] [/size]

Share this post


Link to post
Share on other sites
RedSoxGeek

Another great example... Thank you both, they both work perfect and is what I was trying to do. Now for the hard part, making the folder name appear on the taskbar (creating a new toolbar).

Share this post


Link to post
Share on other sites
sb1920alk

If your goal is to have users quickly identify their computer name, you could set HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\LocalizedString to %computername%. Then instead of "My Computer", My Computer will be their computer name.

It's not a toolbar, but...

Share this post


Link to post
Share on other sites
playlet

---

Edited by playlet

Share this post


Link to post
Share on other sites
RedSoxGeek

Thank you for the responses…

@sb1920alk – I am actually already implementing that reg key actually, I have it so that “My Computer” shows up as <username> on <computername> which is nice and very handy. But what I would like is to have the help desk people simply say to the end user “on the bottom right hand corner of your screen near the clock your computer name should be display”. This way the computer name will be in a number of various places and easy for both my people and the end users to find their computer name. I am trying to make it as bullet proof as possible. Thank you for your suggestion and I may be able to do something further with it…

@playlet – I will look into that, that may work or by placing it somewhere else on the desktop. I just found that it can be done manually by right click the task bar, going to toolbars, creating new toolbar and then pointing the new toolbar to the folder. This would be the ideal solution because it will always be in the same place and if we want/need we can put files and .exe’s in the folder for our quick access and use.

Share this post


Link to post
Share on other sites
sb1920alk

...just being thorough. http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx

Share this post


Link to post
Share on other sites
RedSoxGeek

I have seen that, but I would rather the end user not have that much information at their fingertips. In my experience the more they know the more they can break. Plus I would like this displayed on everyone’s computers at all times. Again the nice thing about the toolbar is that we can put files, scripts, exe's, etc. in there that we can use for working on end users computers. Again a great suggestion and I will again look into it.

Share this post


Link to post
Share on other sites
sb1920alk

Well, you can customize it so it doesn't show all of the information. If you do plan to deploy it, I would probably put it and the configuration file in netlogon, and call it from the logon script.

... Again the nice thing about the toolbar is that we can put files, scripts, exe's, etc. in there that we can use for working on end users computers. ...

...so, the end users will be clicking on the toolbar to open the folder, or launch a script or exe? I'm not sure what you mean here.

Share this post


Link to post
Share on other sites
RedSoxGeek

...so, the end users will be clicking on the toolbar to open the folder, or launch a script or exe? I'm not sure what you mean here.

What I meant was that the help desk people can use that toolbar/folder for quick access to the scripts ect. that they use on a regular basis. The end user will have no access to it because it will be for admins only and/or password protected. All the end user will see is the computer name and if they try to access the quick launch then they will be asked for a password or admin credentials. I have not nailed down all the specifics yet, I am still trying to see if it is possible. I know I can do it manually, but that is a pain to do for a couple of hundred computers. I suppose I could have my people do it when they are logged in but again it would be a pain and they are busy enough as it is.

Share this post


Link to post
Share on other sites
sb1920alk

What I meant was that the help desk people can use that toolbar/folder for quick access to the scripts ect. that they use on a regular basis. The end user will have no access to it because it will be for admins only and/or password protected. All the end user will see is the computer name and if they try to access the quick launch then they will be asked for a password or admin credentials. I have not nailed down all the specifics yet, I am still trying to see if it is possible. I know I can do it manually, but that is a pain to do for a couple of hundred computers. I suppose I could have my people do it when they are logged in but again it would be a pain and they are busy enough as it is.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop\TaskbarWinXP, I think is what you're looking for, but it's ugly. I'm pretty sure changes you set artificially will be lost when the user logs off. You can set it in a startup script that loops through each user's hive and imports a template from a reg file you make from a reference machine...I guess.

Also consider editing your Default User settings to include this.

Share this post


Link to post
Share on other sites
RedSoxGeek

I will look at that, thank you...

Share this post


Link to post
Share on other sites
RedSoxGeek

#cs ---------------------------------------------------------------------------- 

AutoIt Version: 3.3.4.0
Author: myName 
Script Function:
        Template AutoIt script. 

#ce ---------------------------------------------------------------------------- 

; Script Start - Add your code below here 

DirCreate(@HomeDrive & "\config" & @ComputerName)

WinMinimizeAll() 
ControlClick("", "Running Applications", "CLASS:ToolBarWindow32: INSTANCE:2]", "Right") 
Send("T") 
Send("N") 
Send("{TAB}") 
Send("C:\config\%computername%") 
Send("{ENTER}")

I think I have this figured out, or at least how to do what I want it to do. I can do this with the mouse/keyboard but what is happening is the right click control command is not seeing that as the active window to send the keystrokes to. Does anyone know how to get around that? It sees the desktop as the active window and everything goes haywire. This is not the ideal solution but it will accomplish the end goal.

Share this post


Link to post
Share on other sites
ElliotT

Know this was a long time ago but did you ever figure out how to do this? Would love to do this for my clients

Share this post


Link to post
Share on other sites
gruntydatsun

Have you tried BGINFO? It adds a square with customisable information to the desktop background image. Admin tools can be kept in a folder well out of the sight of normal users and will save you phone calls about the "shortcut the hackers left behind that I cant access".

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  

×