VBScript - Change .URL target recursively

Posted on 2007-10-02
Last Modified: 2008-01-09
From a VBS login script I need to be able to walk the user's file system and change the location of an Internet shortcut from one website to another based on what the existing shortcut target is. We are moving an application from one server to another and several hundred desktops have these shortcuts all over the place (desktop, start menu, favorites folder).

I'm fairly good with VBS and I'm not asking you to write the code for me. A few links would be helpful enough.

Question by:in2ative1
    LVL 9

    Accepted Solution

    you could use wmi

    strComputer = "." ' .= current computer
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colFiles = objWMIService. _
        ExecQuery("Select * From CIM_DataFile where FileName = 'Test' and Extension ="txt" and Drive ='C:')

    For Each objFile in colFiles
    'do what you need here

    see link

    see Find File Information at

    Author Comment

    Yup... this is what I was looking for.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    A short article about problems I had with the new location API and permissions in Marshmallow
    Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now