?
Solved

Deleting start button menu links from VBA

Posted on 2004-11-24
4
Medium Priority
?
214 Views
Last Modified: 2010-04-17
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.
0
Comment
Question by:Peborgh
  • 2
4 Comments
 
LVL 22

Expert Comment

by:cookre
ID: 12668451
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.
0
 

Author Comment

by:Peborgh
ID: 12668528
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.
0
 
LVL 11

Accepted Solution

by:
pratap_r earned 750 total points
ID: 12676154
Peborgh.. you missed the .lnk extension at the end of the file :-)

eg,
         Kill "C:\windows\start menu\programs\Counselog ADMIN.lnk"
         Kill "C:\windows\start menu\programs\Counselog DATA.lnk"

what cookre meant was to check if the file actually exists and not set to readonly

Have Fun!
Pratap
0
 

Author Comment

by:Peborgh
ID: 12676181
pratap,

I have just discovered this .lnk business for myself!

Tthanks anyway.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Progress
Loops Section Overview

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question