Hi, I'm just throwing this one out there for advise. I have around 200 workstations that have a web url on the all users desktop or users favorites and I need to change the web address. I have a modified URL to replace the offending file but how do I get it out there. 

I thought maybe there might be a way to script, search c$ for any instances of the file "example.url" and replace with a new file. 

I have SCCM 2012, I've modified the software inventory to identify the organisations workstations with the url but its in several locations on many of the pc's, i've created a collection for the job.

Any advise on a method to execute change would be much appreciated

W

 

1 Comment   [ + ] Show Comment

Comments

  • You may wish to investigate my File Control HTA which can be found on Source Forge. It was built as a QAD means to get configuration files copied to lots of PCs but it morphed into a more general-purpose tool.
Please log in to comment

Community Chosen Answer

2

You can start with the delete script from http://www.itninja.com/question/vbscript-to-search-for-and-delete-file to get rid of the old.url, run this from an msi as custom action and create the new url in a later action. 

Answered 09/18/2013 by: EVEEN
Green Belt

  • This content is currently hidden from public view.
    Reason: Removed by member request
    For more information, visit our FAQ's.
Please log in to comment

Answers

0

It'd be easier to use your login script and run two command lines, one for each location to check.

"If exist 'oldX' xcopy 'newX' 'Location' /v/y"

Answered 09/19/2013 by: vjaneczko
Seventh Degree Black Belt

Please log in to comment
0

Thanks for the advise. What I forgot to mention was that i had a mixture of Windows XP Pro SP3 clients and Windows 7 SP1 clients.

In my origional plan I created an sccm package which simply copied the below script 'replace.cmd' and 'example.url' to the root of the c: drive, I would run the 'replace.cmd' script which searchs the c: drive for example.url and replaces it with the newly copied one on the root. After the process completes i del the 'replace.cmd' and 'example.url' from the root. replace.cmd script looks like this;

_________________________________________________________________

for /F "tokens=*" %%P in ('dir /b /s "example.url"') do copy /Y .\"example.url" "%%P"

del /Q c:\example.url

del /Q c:\fileupdate.cmd

_________________________________________________________________

This package worked fine for XP machines but I found while testing that on Windows7 PC's with our current UAC it prompted me for elevated privileges even with local admin. 

So in the end I created a small sccm task sequence with Run Command Line, I added the package. For the command line I ran it as follows

cmd /c replace.cmd example.url

I ticked 'Run the step as the following account' and used my Domain Admin account.

Suppressed task sequence notification and deployed successfully.

Thanks again for the advise, N

 

Answered 09/20/2013 by: sonik777
Orange Senior Belt

  • What I've used....
    if exist c:\users\%username%\desktop\reporting\issoreportingde.fp7 copy /y issoreportingde.fp7 c:\users\%username%\desktop\reporting\issoreportingde.fp7

    Add the file as a dependency and run as logged in user otherwise the variable won't work properly.
Please log in to comment
Answer this question or Comment on this question for clarity