vbscript to rename shortcut file in allusersprofile\startmenu\programs
hi,
i need a vbscript to rename a file in allusersprofile\startmenu\program\oracle - oracle11gClient to allusersprofile\startmenu\program\oracle11g.
Thanx in advance
regards
Mayur
i need a vbscript to rename a file in allusersprofile\startmenu\program\oracle - oracle11gClient to allusersprofile\startmenu\program\oracle11g.
Thanx in advance
regards
Mayur
0 Comments
[ + ] Show comments
Answers (13)
Please log in to answer
Posted by:
murali.bhat
14 years ago
Posted by:
anonymous_9363
14 years ago
Then:
- use the correct forum http://www.appdeploy.com/messageboards/tt.asp?forumid=6
- find out how to detect the OS and/or use environment variables, to avoid hard-coding the user/allusers profile location. That way, your script is portable and relatively future-proof.
- if, as I suspect, this script is to be run in an MSI, learn how to locate shortcuts properly without resorting to messy kludges.
- use the correct forum http://www.appdeploy.com/messageboards/tt.asp?forumid=6
- find out how to detect the OS and/or use environment variables, to avoid hard-coding the user/allusers profile location. That way, your script is portable and relatively future-proof.
- if, as I suspect, this script is to be run in an MSI, learn how to locate shortcuts properly without resorting to messy kludges.
Posted by:
mayur_mak
14 years ago
Posted by:
murali.bhat
14 years ago
Try this:
Option Explicit
Dim objShell, objFSO, strAllUsersProfile
Set objShell = CreateObject("Wscript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strAllUsersProfile = objShell.ExpandEnvironmentStrings("%allusersprofile%")
If objFSO.FileExists(trim(strAllUsersProfile & "\Start Menu\Programs\oracle - oracle11gClient.lnk")) then
objFSO.MoveFile strAllUsersProfile & "\Start Menu\Programs\oracle - oracle11gClient.lnk", strAllUsersProfile & "\Start Menu\Programs\oracle11g.lnk"
End If
Set objShell = Nothing
Set objFSO = Nothing
Option Explicit
Dim objShell, objFSO, strAllUsersProfile
Set objShell = CreateObject("Wscript.shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strAllUsersProfile = objShell.ExpandEnvironmentStrings("%allusersprofile%")
If objFSO.FileExists(trim(strAllUsersProfile & "\Start Menu\Programs\oracle - oracle11gClient.lnk")) then
objFSO.MoveFile strAllUsersProfile & "\Start Menu\Programs\oracle - oracle11gClient.lnk", strAllUsersProfile & "\Start Menu\Programs\oracle11g.lnk"
End If
Set objShell = Nothing
Set objFSO = Nothing
Posted by:
murali.bhat
14 years ago
Posted by:
mayur_mak
14 years ago
Posted by:
murali.bhat
14 years ago
Posted by:
mayur_mak
14 years ago
Posted by:
anonymous_9363
14 years ago
- You haven't mentioned them, but I'm sure there must be many, many other parts of your job which we could perform for you. Why not list them out and see who volunteers?
- Do the job like a packager and use the MoveFile table instead of hacking like an amateur. I would post a link to the relevant page in MSDN but [huge leap of faith] I presume you can use Google?
- Do the job like a packager and use the MoveFile table instead of hacking like an amateur. I would post a link to the relevant page in MSDN but [huge leap of faith] I presume you can use Google?
Posted by:
aogilmor
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.