Peborgh
asked on
Deleting start button menu links from VBA
The VBA code (within an Access app) I use to delete start button menu items/links to an application that has become redundant:
"
' by this point I have found out which OS we are talking about in strOS...
Select Case strOS
Case "98"
''' MsgBox "found win9X os, so delete shortcut from %windir%\start menu"
Kill "C:\windows\start menu\programs\Counselog ADMIN"
Kill "C:\windows\start menu\programs\Counselog DATA"
Case "Mi"
''' MsgBox "found WinME os"
Kill "C:\windows\start menu\programs\Counselog ADMIN"
Kill "C:\windows\start menu\programs\Counselog DATA"
Case "XP"
''' MsgBox "found Win2k / XP os"
Kill "C:\documents and settings\" & currentUser & "\start menu\programs\Counselog DATA"
Kill "C:\documents and settings\" & currentUser & "\start menu\programs\Counselog ADMIN"
Case Else
MsgBox "found no compatible OS"
End Select
"
... unfortunately this results in 'file not found' at least in the Win ME case. The path as far as I can decide is correct...
Any ideas?
Many thanks.
"
' by this point I have found out which OS we are talking about in strOS...
Select Case strOS
Case "98"
''' MsgBox "found win9X os, so delete shortcut from %windir%\start menu"
Kill "C:\windows\start menu\programs\Counselog ADMIN"
Kill "C:\windows\start menu\programs\Counselog DATA"
Case "Mi"
''' MsgBox "found WinME os"
Kill "C:\windows\start menu\programs\Counselog ADMIN"
Kill "C:\windows\start menu\programs\Counselog DATA"
Case "XP"
''' MsgBox "found Win2k / XP os"
Kill "C:\documents and settings\" & currentUser & "\start menu\programs\Counselog DATA"
Kill "C:\documents and settings\" & currentUser & "\start menu\programs\Counselog ADMIN"
Case Else
MsgBox "found no compatible OS"
End Select
"
... unfortunately this results in 'file not found' at least in the Win ME case. The path as far as I can decide is correct...
Any ideas?
Many thanks.
Presuming that's the right path for ME and the files are there and deletable, I'd double check to make sure ME is being identified correctly.
ASKER
It is. It's the frist thing I checked...
What's this about being deletable. This is ME and it has no security anyone would recognise.
Think on. Thanks.
What's this about being deletable. This is ME and it has no security anyone would recognise.
Think on. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
pratap,
I have just discovered this .lnk business for myself!
Tthanks anyway.
I have just discovered this .lnk business for myself!
Tthanks anyway.