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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Help with Batch File

Reply to Message Icon

Name: Shaadow
Date: June 9, 2006 at 12:19:10 Pacific
OS: XP pro
CPU/Ram: varies
Product: 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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: June 9, 2006 at 19:14:40 Pacific
Reply:

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



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Help with Batch File

Need help with batch file www.computing.net/answers/programming/need-help-with-batch-file/9707.html

Help with batch file (FOR /R) www.computing.net/answers/programming/help-with-batch-file-for-r-/14521.html

Help with Batch files www.computing.net/answers/programming/help-with-batch-files/12927.html