/build/static/layout/Breadcrumb_cap_w.png

Help removing icon from quick launch

Greetings,

I am trying to remove a lotus notes icon and replace it with a MS outlook icon in the quick launch bar. I will be packaging the command and sending it out through SMS. My issue is that our users do not have rights to their local C: drive, therefore the SMS package will be executed by the local system account which has rights to manipulate files on the C: drive.

Below is my .BAT file but it does not work, probably since the the machine does not know how to get to the current logged on users %appdata% folder. Any suggestions on how to accomplish this?

Thanks...

=========== CURRENT BATCH FILE =============

copy outlook.lnk "%appdata%\microsoft\internet explorer\quick launch\*.*"

cd %appdata%\microsoft\internet explorer\quick launch

del "lotus notes.lnk"

0 Comments   [ + ] Show comments

Answers (6)

Posted by: Garrett 19 years ago
Orange Belt
2
I trimmed this from another script I had laying around. Be sure to read the comments in the Main() function.

scriptVer = "1.0.0.0"

'Checks to make sure the script is running in cscript
If Lcase(Right(Wscript.FullName, 12)) = "\wscript.exe" Then
CreateObject("Wscript.Shell").Run "cscript.exe " & Chr(34) & Wscript.ScriptFullName & Chr(34)
Wscript.Quit
End If

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

strScriptPath = Wscript.ScriptFullName
strScriptName = Wscript.ScriptName
strCurPath = Left(strScriptPath, Len(strScriptPath) - Len(strScriptName))
If Right(strCurPath,1)<>"\" Then strCurPath = strCurPath & "\"

Set objShell = Wscript.CreateObject("Wscript.Shell")
'Set objExplorer = CreateObject("InternetExplorer.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set objNetwork = Wscript.CreateObject("Wscript.Network")


'Displays Info on the script and host
DisplayInfo

'Uncomment to have the script pause at the start
'wscript.stdout.writeline "This will run on all user folders. Do not continue if you are not positively positive you want to do this."
'wscript.stdout.writeline "Press enter to run the script."
'continue = lCase(wscript.stdin.readline)

Main("C:\Documents and Settings")

'Uncomment to have the script pause at the end
'wscript.stdout.writeline "All done! Press Enter to continue."
'continue = lCase(wscript.stdin.readline)
'************************************************************************************
'End of main code body

sub DisplayInfo
wscript.stdout.writeline ""
wscript.stdout.writeline wscript.application & " Build: " & wscript.buildversion
wscript.stdout.writeline wscript.ScriptName & " Build: " & scriptVer
wscript.stdout.writeline "Working Directory " & strCurPath
wscript.stdout.writeline ""
end sub

Sub Log(message)
if len(message) > 65 then
strWrapped = right(message,len(message) - 65)
newmessage = left(message, 65) & VbCrLf & vbTab & strWrapped
else
newmessage = message
end if
wscript.stdout.writeline newMessage
End Sub

Sub Main(ByVal strDirectory) '"C:\Documents and Settings"
' 1) Enumerate all users in documents and settings
Set objFolder = objFSO.GetFolder(strDirectory)
Set colSubFolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
If instr(1, objSubfolder.name,"Default", vbTextCompare) Or _
instr(1, objSubfolder.name,"LocalService", vbTextCompare) Or _
instr(1, objSubfolder.name,"NetworkService", vbTextCompare) Then
'You can skip accounts that have not logged on interactively
'instr(1, objSubfolder.name,"LocalAccount1", vbTextCompare) Or _
'instr(1, objSubfolder.name,"SMSAccount1", vbTextCompare) Or _
Log("Skipping: '" & objSubfolder.name & "'")
Else
Log("Searching: '" & objSubfolder.path & "'")
DeleteTheLink(objSubfolder.path)
End If
Next
End Sub

Sub DeleteTheLink(ByVal strDirectory)
If objFSO.FolderExists(strDirectory & "\Application Data\Microsoft\Internet Explorer\Quick Launch") Then
if objFSO.FileExists(strDirectory & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Notes.lnk") then
objFSO.DeleteFile(strDirectory & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Notes.lnk")
Log("Deleting: '" & strDirectory & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Notes.lnk")
end if
End If
End Sub
Posted by: Garrett 19 years ago
Orange Belt
0
Can you roll out the "Remove Notes Icon" portion of the package by logon script? Since users have rights to thier "C:\Documents and Settings\<USERNAME>\Application Data\Microsoft\Internet Explorer\Quick Launch" your logon script can do the cleanup for ya.
Posted by: bsieloff 19 years ago
Senior Yellow Belt
0
I won't be able to do this by login script... too much politics! Is there a way I could scan all of "Documents and Settings" for the "lotus Notes.lnk" file and delete it?
Posted by: bsieloff 19 years ago
Senior Yellow Belt
0
Garrett..

Simply AWSOME!

Thanks a million.

-Bob
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
0
ORIGINAL: bsieloff

Garrett..

Simply AWSOME!

Thanks a million.

-Bob


Yet you haven't rated his post??[;)]
Posted by: Garrett 19 years ago
Orange Belt
0
You’re welcome Bob.

The original script is quite a bit larger, I had to convert any shortcuts referencing 'G:' to reference 'S:\<Their Site>\Shared'. It only took me a couple minutes to trim this section out for you.

Cheers,
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