/build/static/layout/Breadcrumb_cap_w.png

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

0 Comments   [ + ] Show comments

Answers (13)

Posted by: murali.bhat 13 years ago
Purple Belt
0
Use this code:

objFSO.MoveFile "C:\Documents and Settings\All Users\Start Menu\Programs\oracle - oracle11gClient.lnk" , "C:\Documents and Settings\All Users\Start Menu\Programs\oracle11g.lnk"
Posted by: anonymous_9363 13 years ago
Red Belt
0
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.
Posted by: mayur_mak 13 years ago
Senior Purple Belt
0
script is prompting error FIle Not found at objFSo.MoveFile i have used environment variable %allusersprofile% and not success
Posted by: murali.bhat 13 years ago
Purple Belt
0
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
Posted by: mayur_mak 13 years ago
Senior Purple Belt
0
&murali

Still not renaming???
Posted by: murali.bhat 13 years ago
Purple Belt
0
Can you tell me what error are you getting? Did you check that the path mentined is correct?
Posted by: mayur_mak 13 years ago
Senior Purple Belt
0
@murali i Got it

Thanx

regards mayur
Posted by: mayur_mak 13 years ago
Senior Purple Belt
0
Hi,

I need the script to run in windows 7 64-bit where the shortcut is in all usersprofile(programdata).the script is workin fine in win XP.

Thanx in advance
regards
mayur
Posted by: murali.bhat 13 years ago
Purple Belt
0
Replace the path of the shortcut in the FileExists and MoveFile code.
Posted by: mayur_mak 13 years ago
Senior Purple Belt
0
@ murali

The Script running but permision denied error is thrown at Movefile

thanx

regrds
mayur
Posted by: anonymous_9363 13 years ago
Red Belt
0
- 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?
Posted by: aogilmor 13 years ago
9th Degree Black Belt
0
LOL VB I was gonna jump in yesterday but I figured it ain't worth it. that's the kind of stuff I figured out quite a while ago and did NOT clutter up appdeploy with when i was a newb.
Posted by: PackDep 13 years ago
Senior Yellow Belt
0
Why use a vbscript?
I guess you can modify it in the .rsp file.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ