• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1832
  • Last Modified:

VBScript - Change .URL target recursively

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.

1 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

in2ative1Author Commented:
Yup... this is what I was looking for.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now