Computing.Net > Forums > Programming > Help with Batch File

Help with Batch File

Reply to Message Icon

Original Message
Name: Shaadow
Date: June 9, 2006 at 12:19:10 Pacific
Subject: Help with Batch File
OS: XP pro
CPU/Ram: varies
Model/Manufacturer: Dell
Comment:

Just curious is there a way to search for a file (could be multiple on the pc) called test.lnk and replace it with the file test2.lnk?

where test2.lnk is located at \\servername\dir\test2.lnk.

And test.lnk may be in more than one place on the PC?

If not or if its too complicated no worries just started writing batch files and was curious about whether or not this is possible.

Thanks in advanced


Report Offensive Message For Removal

Response Number 1
Name: Mechanix2Go
Date: June 9, 2006 at 19:14:40 Pacific
Subject: Help with Batch File
Reply: (edit)

Try this:

::== replink.bat

@echo off
dir /s/b/a-d c:\test.lnk > linklist
for /f "tokens=*" %%T in (linklist) do (
echo copy \\servername\dir\test2.lnk "%%T"
)

:: DONE



=====================================
If at first you don't succeed, you're about average.

M2



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: Help with Batch File

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software