MSFN Forum: renaming Start Menu shortcuts... - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

renaming Start Menu shortcuts... how to? Rate Topic: -----

#1 User is offline   piXelatedEmpire 

  • nLiten me, nuhi!
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 02-June 05

Posted 24 July 2005 - 12:58 AM

:hello:

I am using cleanup.cmd to move and delete various shortcuts - from an edited script posted on these forums. Here is a snippet of my code:

set AUStart=%AllUsersProfile%\Start Menu\Programs
set UserStart=%UserProfile%\Start Menu\Programs
set UserQL=%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch
set AUDesk=%AllUsersProfile%\Desktop
set UserDesk=%UserProfile%\Desktop

REM :: Make New Folders ::
MD "%AUStart%\Utilities"
MD "%AUStart%\Utilities\Administrative Tools"
MD "%AUStart%\Utilities\Windows System Tools"

REM :: Move/Copy Folders ::
COPY /Y "%AUStart%\Administrative Tools" "%AUStart%\Utilities\Administrative Tools"
MOVE /Y "%AUStart%\Accessories\System Tools\*" "%AUStart%\Utilities\Windows System Tools"
MOVE /Y "%AUStart%\jv16 Powertools\jv16 PowerTools.lnk" "%AUStart%\Utilities\Windows System Tools"

REM :: Move/Copy Shortcuts ::
DEL /Y "%AUStart%\Adobe ImageReady CS.lnk"
DEL /Y "%AUStart%\Adobe Help Center.lnk"
DEL /Y "%AUStart%\Adobe Bridge.lnk"
DEL /Y "%AUStart%\Stop StartupMonitor.lnk"
MOVE /Y "%AUStart%\CCleaner\CCleaner.lnk" "%AUStart%\"
MOVE /Y "%AUStart%\Crimson Editor\Crimson Editor.lnk" "%AUStart%\"
MOVE /Y "%AUStart%\DVD Decrypter\DVD Decrypter.lnk" "%AUStart%\"
MOVE /Y "%AUStart%\Elaborate Bytes\CloneDVD2\CloneDVD2.lnk" "%AUStart%\"
MOVE /Y "%AUStart%\FlashGet\FlashGet.lnk" "%AUStart%\"
MOVE /Y "%AUStart%\Kaspersky Anti-Virus Personal\Kaspersky Anti-Virus Personal.lnk" "%AUStart%\"


My question is, what command would I use to rename specific shortcuts? For example:

MOVE /Y "%AUStart%\Kaspersky Anti-Virus Personal\Kaspersky Anti-Virus Personal.lnk"

what command would I use to rename that to Kaspersky.lnk?


before anyone says anything, I attempted to search, using these search strings:

+renaming +start +menu +shortcuts
+renaming +startmenu +shortcuts
+renaming +shortcuts
+rename +startmenu +shortcuts
+rename +shortcuts

but none of these searches returned anything useful...

thanks for anyones assisstance :yes:


#2 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 24 July 2005 - 02:13 AM

Here try this code I have just shorten the names of the shortscuts
This was done quickly, and I cannot test it.
Green Color Text Can Be Removed From Script
Orange Color Text Is Just A Popup I Used To Test The script Can be removed from script
Red Color Text Are Error Popup Messages Can Be Removed From Script

Quote


Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Act : Set Act = CreateObject("WScript.Shell")
Dim AU_S : AU_S = Act.ExpandEnvironmentStrings("%AllUsersProfile%\Start Menu\Programs")
Dim strComputer : strComputer = "."
Dim F1
'''' Array For Locations
Dim Loc : Loc = Array((AU_S & "\Utilities"),(AU_S & "\Utilities\Administrative Tools"),_
(AU_S & "\Utilities\Windows System Tools"),(AU_S & "\Accessories\System Tools"))
'''' Array For ShortCut Locations
Dim Ren : Ren = Array("%AUStart%\Kaspersky Anti-Virus Personal","%AUStart%\CCleaner","%AUStart%\Crimson Editor",_
"%AUStart%\DVD Decrypter","%AUStart%\Elaborate Bytes\CloneDVD2","%AUStart%\FlashGet")

Function MakeYourFolders
For Each StrMD In Loc
If Not Fso.FolderExist(StrMD) Then  Fso.CreateFolder(StrMD) End If
Next
End Function

Function AdmCopy
F1 =(AU_S & "\Administrative Tools")
If Fso.FolderExists(Loc(0)) Then
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.name='" & F1 & "'} Where " & "ResultClass = CIM_DataFile")
For Each objFile In FileList
Name = objFile.Name
Act.Popup "The File Path And Name" & vbCrLf & Name,7,"Test 001", 0 + 64 
Fso.CopyFile(F1),(Loc(2))
Next
Else
Act.Popup "Error In The Copy File" & vbCrLf & F1 & vbCrLf & "To Here" & vbCrLf & Loc(2), 10, 0 + 64
End If
End Function

Function SysTools
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set FileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.name='" & Loc(3) & "'} Where " & "ResultClass = CIM_DataFile")
For Each objFile In FileList
Name = objFile.Name
Act.Popup "The File Path And Name" & vbCrLf & Name & Vbcrlf & "Test Location 2 " & vbCrLf & Loc(2),7,"Test 002", 0 + 64
Fso.MoveFile(Name),(Loc(2))
  Next   
End Function

Function Jv16
Dim F1 : F1 =(AU_S & "\jv16 Powertools\jv16 PowerTools.lnk")
If Fso.FileExists(F1) Then
Fso.MoveFile(F1),(Loc(2))
Else
Act.Popup "Error In The Copy File" & vbCrLf & F1 & vbCrLf & "To Here" & vbCrLf & Loc(2), 10, 0 + 64
End If
End Function

Function DelShortCuts
Dim Garbage : Garbage = Array(AU_S & "\Adobe ImageReady CS.lnk",AU_S & "\Adobe Help Center.lnk",
AU_S & "%AUStart%\Adobe Bridge.lnk",AU_S & "%AUStart%\Stop StartupMonitor.lnk")
For Each StrD In Garbage
If Fso.FileExists(StrD) Then Fso.DeleteFile(StrD) End If
Next
End Function

Function ShortCutRename
If Fso.FolderExists(Ren(0)) Then
Fso.MoveFile(Ren(0) & "\Kaspersky Anti-Virus Personal.lnk"),(AU_S & "\K_AV_P.lnk")
End If
If Fso.FolderExists(Ren(1)) Then
Fso.MoveFile(Ren(1) & "\CCleaner.lnk"),(AU_S & "\CC.lnk")
End If
If Fso.FolderExists(Ren(2)) Then
Fso.MoveFile(Ren(2) & "\Crimson Editor.lnk"),(AU_S & "\CEditor.lnk")
End If
If Fso.FolderExists(Ren(3)) Then
Fso.MoveFile(Ren(3) & "\DVD Decrypter.lnk"),(AU_S & "\DVD.lnk")
End If
If Fso.FolderExists(Ren(4)) Then
Fso.MoveFile(Ren(4) & "\CloneDVD2.lnk"),(AU_S & "\CDVD2.lnk")
End If
If Fso.FolderExists(Ren(5)) Then
Fso.MoveFile(Ren(5) & "\FlashGet.lnk"),(AU_S & "\FGet.lnk")
End If
End Function
'''' Start The Functions
MakeYourFolders
AdmCopy
SysTools
Jv16
ShortCutRename


This post has been edited by gunsmokingman: 24 July 2005 - 04:19 AM


#3 User is offline   piXelatedEmpire 

  • nLiten me, nuhi!
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 02-June 05

Posted 24 July 2005 - 05:13 AM

Interesting, I've never seen that kid of script (relatively new to unattended installs), thanks...

what kind of script is this? I was kinda hoping there was some sort of command I could use with my existing cleanup.cmd...

This post has been edited by piXelatedEmpire: 24 July 2005 - 05:15 AM


#4 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 24 July 2005 - 06:19 AM

It A Vbs Script, Saves the script as AllUserClean.vbs
Then add this to your cleanup.cmd

start wscript.exe YOUR-PATH-TO-THE-SCRIPT\AllUserClean.vbs

#5 User is offline   Achdine 

  • Junior
  • Pip
  • Group: Members
  • Posts: 97
  • Joined: 11-May 05

Posted 24 July 2005 - 07:37 AM

This is probably a bit simpler ;)
MOVE /Y "%AUStart%\Kaspersky Anti-Virus Personal\Kaspersky Anti-Virus Personal.lnk" "%AUStart%\Kaspersky.lnk"


#6 User is offline   piXelatedEmpire 

  • nLiten me, nuhi!
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 02-June 05

Posted 24 July 2005 - 07:38 AM

thanks again gunsmokingman, but i wish to do this using my exisiting script.

I suppose my question should be is there a RENAME command?

for example:
RENAME /Y "%AUStart%\Kaspersky Anti-Virus Personal.lnk" "%AUStart%\Kaspersky.lnk"


would this work?

#7 User is offline   Achdine 

  • Junior
  • Pip
  • Group: Members
  • Posts: 97
  • Joined: 11-May 05

Posted 24 July 2005 - 07:46 AM

You missed my first post; I assume we were typing at the same time. But to answer your second question, yes, there is a rename command.

Quote

C:\Documents and Settings\Achdine>rename /?
Renames a file or files.

RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.

Note that you cannot specify a new drive or path for your destination file.


The easiest way to find out if a command exists is to type "<commandname> /?" at the command line, instead of posting a topic about it.

#8 User is offline   piXelatedEmpire 

  • nLiten me, nuhi!
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 02-June 05

Posted 24 July 2005 - 07:48 AM

Achdine, on Jul 24 2005, 11:37 PM, said:

This is probably a bit simpler ;)
MOVE /Y "%AUStart%\Kaspersky Anti-Virus Personal\Kaspersky Anti-Virus Personal.lnk" "%AUStart%\Kaspersky.lnk"

Exactly what I wanted to know... thanks :thumbup

#9 User is offline   piXelatedEmpire 

  • nLiten me, nuhi!
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 02-June 05

Posted 24 July 2005 - 07:50 AM

Achdine, on Jul 24 2005, 11:46 PM, said:

You missed my first post; I assume we were typing at the same time.


Yeah I was.

Achdine, on Jul 24 2005, 11:46 PM, said:

The easiest way to find out if a command exists is to type "<commandname> /?" at the command line, instead of posting a topic about it.


well I did not know one could do this. My apologies.

But thanks for your assistance all the same.

This post has been edited by piXelatedEmpire: 24 July 2005 - 07:51 AM


#10 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 24 July 2005 - 07:53 AM

REN (or RENAME) <drive:>\<path>\filename1 filename2
You cannot however, specify a new drive or path for filename2.

Therefore in your case, I would suggest you use
MOVE <drive:>\<path>\filename1 <drive:>\<path>\filename2
as already stated by Achdine

Note also that in most of our systems the prompting for confirmation in batch files is suppressed therefore negating the requirement to use the /Y switch on the move, copy and delete commands.

#11 User is offline   piXelatedEmpire 

  • nLiten me, nuhi!
  • PipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 02-June 05

Posted 24 July 2005 - 08:18 AM

Yzöwl, on Jul 24 2005, 11:53 PM, said:

Note also that in most of our systems the prompting for confirmation in batch files is suppressed therefore negating the requirement to use the /Y switch on the move, copy and delete commands.

thanks for the tip Yzowl :yes:

#12 User is offline   war59312 

  • Will's Blog
  • PipPipPipPipPip
  • Group: Members
  • Posts: 922
  • Joined: 07-June 02

Posted 24 July 2005 - 08:42 PM

And xcopy. ;)

#13 User is offline   Cybertronic 

  • Junior
  • Pip
  • Group: Members
  • Posts: 79
  • Joined: 28-January 04

Posted 25 July 2005 - 05:38 AM

Is there such a command that hides the Startup folder on the Start Menu? :)

This post has been edited by Cybertronic: 25 July 2005 - 05:39 AM


#14 User is offline   Dahi 

  • Member
  • PipPip
  • Group: Members
  • Posts: 146
  • Joined: 25-November 03

Posted 25 July 2005 - 09:01 AM

This will hide the Startup folder if you have "Do not show hidden iles and folders" selected in Explorer.
attrib +H "%UserProfile%\Start Menu\Programs\Startup"


#15 User is offline   Cybertronic 

  • Junior
  • Pip
  • Group: Members
  • Posts: 79
  • Joined: 28-January 04

Posted 25 July 2005 - 09:06 AM

Thanks, it worked :thumbup

This post has been edited by Cybertronic: 25 July 2005 - 07:10 PM


#16 User is offline   JasonGW 

  • Member
  • PipPip
  • Group: Members
  • Posts: 216
  • Joined: 05-August 04

Posted 10 August 2005 - 09:13 AM

I've tried to use the original script posted in this thread, following the syntax and making a few customizations. The goal of the customizations is to create start menu folders that mirror the category names of my WPI installs (that works fine) and then organize the folders and files created by installers into those category folders (which doesn't work at all).

Here is my script. Any ideas why this won't work? Thanks in advance!

Jason
set AUStart=%AllUsersProfile%\Start Menu\Programs
set UserStart=%UserProfile%\Start Menu\Programs
set UserQL=%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch
set AUDesk=%AllUsersProfile%\Desktop
set UserDesk=%UserProfile%\Desktop

REM :: Make New Folders ::
MD "%AUStart%\Art Software"
MD "%AUStart%\Gaming Utilities"
MD "%AUStart%\Internet"
MD "%AUStart%\Media Editing & Ripping"
MD "%AUStart%\Media Playback"
MD "%AUStart%\Security"
MD "%AUStart%\Utilities"

REM :: Move/Copy Folders ::

REM :: ART SOFTWARE ::
MOVE "%AUStart%\@icon Sushi\" "%AUStart%\Art Software\Icon Sushi\"
MOVE "%AUStart%\Inkscape\" "%AUStart%\Art Software\Inkscape\"
MOVE "%UserStart%\Blender Foundation\" "%AUStart%\Art Software\Blender3D\"

REM :: GAMING UTILITIES ::

REM :: INTERNET ::
MOVE "%AUStart%\Mozilla Firefox" "%AUStart%\Internet\Firefox"
MOVE "%AUStart%\Flashpeak BlazeFTP\" "%AUStart%\Internet\BlazeFTP"
MOVE "%AUStart%\FileZilla\" "%AUStart%\Internet\FileZilla FTP"

REM :: MEDIA PLAYBACK ::
MOVE "%AUStart%\Media Portal\" "%AUStart%\Media Playback\Media Portal\"
MOVE "%UserStart%\Winamp\" "%AUStart%\Media Playback\Winamp\"
MOVE "%UserStart%\DBPowerAmp\" "%AUStart%\Media Playback\DBPowerAmp Player\"

REM :: MEDIA EDITING & RIPPING ::
MOVE "%AUStart%\D.I.K.O\" "%AUStart%\Media Editing & Ripping\DIKO\"
MOVE "%AUStart%\DVD Shrink\" "%AUStart%\Media Editing & Ripping\DVD Shrink\"
MOVE "%AUStart%\CDBurnerXP 3\" "%AUStart%\Media Editing & Ripping\CDBurnerXP\"
MOVE "%AUStart%\Nero\" "%AUStart%\Media Editing & Ripping\Nero\"
MOVE "%UserStart%\DBPowerAmp Music Converter\" "%AUStart%\Media Editing & Ripping\DBPowerAmp Music Converter\"
MOVE "%UserStart%\DVD Decrypter\" "%AUStart%\Media Editing & Ripping\DVD Decrypter\"

REM :: SECURITY ::
MOVE "%AUStart%\Spybot - Search & Destroy\" "%AUStart%\Security\Spybot\"
MOVE "%AUStart%\Lavasoft Ad-Aware SE Personal\" "%AUStart%\Security\Ad-Aware\"
MOVE "%AUStart%\SpywareBlaster\" "%AUStart%\Security\SpywareBlaster\"
MOVE "%AUStart%\Sygate Personal Firewall\" "%AUStart%\Security\Sygate Firewall\"
MOVE "%AUStart%\Zone Labs\" "%AUStart%\Security\ZoneAlarm Firewall\"
MOVE "%UserStart%\Kerio\" "%AUStart%\Security\Kerio Firewall\"

REM :: UTILITIES ::
COPY "%AUStart%\Administrative Tools\*.*" "%AUStart%\Utilities\Administrative Tools\"
MOVE "%AUStart%\Accessories\System Tools\*" "%AUStart%\Utilities\System Tools\"
MOVE "%AUStart%\Desktop Sidebar\" "%AUStart%\Utilities\Desktop Sidebar\"
MOVE "%UserStart%\RivaTuner v2.0 RC 15.6\" "%AUStart%\Utilities\RivaTuner\"
MOVE "%UserStart%\7-Zip\" "%AUStart%\Utilities\7-Zip\"
MOVE "%UserStart%\XPize\" "%AUStart%\Utilities\XPize\"

REM :: Move/Copy Shortcuts ::

REM :: ART SOFTWARE SHORTCUTS ::
REM MOVE /Y "%AUStart%\Adobe ImageReady CS.lnk" "%AUStart%\Art Software\"
REM MOVE /Y "%AUStart%\Adobe Help Center.lnk" "%AUStart%\Art Software\"
REM MOVE /Y "%AUStart%\Adobe Bridge.lnk" "%AUStart%\Art Software\"
REM MOVE /Y "%AUStart%\Paint.Net.lnk" "%AUStart%\Art Software\"

REM :: GAMING UTILITIES SHORTCUTS ::

REM :: INTERNET SHORTCUTS ::
MOVE /Y "%UserStart%\Internet Explorer.lnk" "%AUStart%\Internet\Internet Explorer.lnk"

REM :: MEDIA EDITING & RIPPING SHORTCUTS ::
REM MOVE /Y "%AUStart%\Audacity.lnk" "%AUStart%\Media Editing & Ripping\"

REM :: MEDIA PLAYBACK SHORTCUTS ::
REM MOVE /Y "%UserStart%\Windows Media Player.lnk" "%AUStart%\Media Playback\"

REM :: SECURITY SHORTCUTS ::

REM :: UTILITIES SHORTCUTS ::
MOVE /Y "%AUStart%\Adobe Reader 7.0.2.lnk" "%AUStart%\Utilities\Adobe Reader 7.0.2.lnk"


REM :: Cleanup Desktop Icons ::
DEL "%AUDesk%\*.*"
DEL "%UserDesk%\*.*"
DEL "%systemroot%\*.bmp"
DEL "%systemroot%\system32\dllcache\*.*"
DEL "%systemroot%\system32\*.scr"

DEL "%AUStart%\Set Program Access and Defaults.lnk"
DEL "%AUStart%\Windows Catalog.lnk"
REGEDIT /S "%systemdrive%\install\regtweaks.reg"


#17 User is offline   Achdine 

  • Junior
  • Pip
  • Group: Members
  • Posts: 97
  • Joined: 11-May 05

Posted 10 August 2005 - 09:49 AM

Jason, you have a \ after most of the folders in your batch file (example)
MOVE "%AUStart%\Inkscape\" "%AUStart%\Art Software\Inkscape\"
Those final backslashes after Inkscape tell it to look inside the folder instead of at the folder. If you remove them then it will move the Inkscape folder. Also, you only need to include the foldername a second time if you are renaming it.
This example should be written
MOVE "%AUStart%\Inkscape" "%AUStart%\Art Software\"
Just change all the instances of this and make sure that you're moving it from the right folder (%AUStart% or %UserStart%).



On a side-note, I keep meaning to try Inkscape. Has it worked well for you?

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy