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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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"
Answered 11/29/2010 by: murali.bhat
Purple Belt

Please log in to comment
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.
Answered 11/29/2010 by: VBScab
Red Belt

Please log in to comment
0
script is prompting error FIle Not found at objFSo.MoveFile i have used environment variable %allusersprofile% and not success
Answered 11/29/2010 by: mayur_mak
Senior Purple Belt

Please log in to comment
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
Answered 11/29/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
&murali

Still not renaming???
Answered 11/29/2010 by: mayur_mak
Senior Purple Belt

Please log in to comment
0
Can you tell me what error are you getting? Did you check that the path mentined is correct?
Answered 11/29/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
@murali i Got it

Thanx

regards mayur
Answered 11/29/2010 by: mayur_mak
Senior Purple Belt

Please log in to comment
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
Answered 11/29/2010 by: mayur_mak
Senior Purple Belt

Please log in to comment
0
Replace the path of the shortcut in the FileExists and MoveFile code.
Answered 11/29/2010 by: murali.bhat
Purple Belt

Please log in to comment
0
@ murali

The Script running but permision denied error is thrown at Movefile

thanx

regrds
mayur
Answered 11/29/2010 by: mayur_mak
Senior Purple Belt

Please log in to comment
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?
Answered 11/30/2010 by: VBScab
Red Belt

Please log in to comment
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.
Answered 11/30/2010 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
Why use a vbscript?
I guess you can modify it in the .rsp file.
Answered 12/02/2010 by: PackDep
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity