06-18-2010, 09:03 PM
hi Saket,
i am still in confusion.
This is my code. Let me know where i am going wrong.
it always shows General run error.. or something else sometimes.. on the
Set objEMIService.. or else i get error @ for each line..
This is very important as i am stuck with work.
moreover Start Menu is just a folder. what if there is a filefolder and in that a shortcut exists and i need to look for that shortcut? how can i find out.
This there any other way to search and just need to confirm that the file exists. This is 1 small requirement to check if the shortcut exists.
thanks
i am still in confusion.
This is my code. Let me know where i am going wrong.
Code:
Dim objItem, strComputer,objWMIService,ColItems
strComputer="."
strFolder="C:\Documents and Settings\All Users\Start Menu"
[b]Set objWMIService = GetObject("winmgmts:\\" &strComputer&" \root\cimv2")[/b]
Set ColItems= ObjWMIService.ExecQuery(" Select * from Cim_DataFile Where Path ='"&strFolder&"' AND Name='Winzip'")
For Each objItem in ColItems
If objitem.FileName = "WinZip" then
msgbox "Shortcut Exists"
end if
Next
it always shows General run error.. or something else sometimes.. on the
Set objEMIService.. or else i get error @ for each line..
This is very important as i am stuck with work.
moreover Start Menu is just a folder. what if there is a filefolder and in that a shortcut exists and i need to look for that shortcut? how can i find out.
This there any other way to search and just need to confirm that the file exists. This is 1 small requirement to check if the shortcut exists.
thanks