Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

VBScript File search

Original Message
Name: cobyurl3
Date: October 11, 2007 at 07:54:26 Pacific
Subject: VBScript File search
OS: XP
CPU/Ram: 2.8/1GB
Model/Manufacturer: IBM THinkcentre
Comment:
I need a VBScript to a shortcut on any user's desktop by it's URL or Targetpath only. Different users call the same shortcut different things. we want to find the shortcut and delete it. Anybody have any ideas, thanks.

Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: October 15, 2007 at 18:43:12 Pacific
Subject: VBScript File search
Reply: (edit)
The problem, as I see it, is VBS, which has no way of interacting with shortcuts, outside of creating them. Therefore, we must test the file for the string we're looking for, which may or may not return anything meaningful.
(Note: If this is something on a network drive, leave off the share name and/or the mapped drive letter.)


const sLookFor = "Important Links"
sDesktop = WScript.CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%\Desktop")
Set oFSO = CreateObject("Scripting.FileSystemObject")

For Each file In oFSO.GetFolder(sDesktop).Files
If BCheckFile(file) Then file.Delete
Next

Function BCheckFile(oFile)
BCheckFile = False
Dim sShortcut
sShortcut = oFile.OpenAsTextStream(1, 0).ReadAll _
& oFile.OpenAsTextStream(1, -1).ReadAll
If InStr(1, sShortCut, sLookFor, 1) Then _
BCheckFile = True
End Function


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: VBScript File search

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC