Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Batch file not removing old icon when installing

23 Sep 2013   #1

Windows 7 64bit
 
 
Batch file not removing old icon when installing

My batch files keep creating a duplicate icon when they are ran. Instead of replacing the existing icon it just adds another one to my desktop. How can I fix this? Here is what one of my files look like:

ECHO OFF
@echo "Waiting for Position Matrix to shut down"
c:
cd\
mkdir databases
C:
cd\databases
del Inventory_mgr.mdb
o:
CD\WWP Shared\Databases
ECHO ON
echo "PLEASE WAIT WHILE FILES ARE BEING COPIED!!!"
echo "This box will close upon completion!!!!"
ECHO OFF
copy Inventory_mgr.mdb C:\databases
copy FREE3OF9.ttf c:\databases
CD\WWP Shared\Databases\icons
Copy Inventory_mgr.ico c:\databases
CD\WWP Shared\Databases\shortcuts
copy Inventory_mgr.lnk c:\databases
rem *******************************************
rem Window 7 fix
c:
cd\
cd databases
copy Inventory_mgr.lnk %userprofile%\Desktop
rem *****************************************
rem windows xp
c:
cd \
cd documents and settings
cd all users
cd desktop
copy c:\databases\Inventory_mgr.lnk
C:\databases\Inventory_mgr.mdb

rem ************************************************




I have also posted this same request at http://forums.windowsforum.org/index...howtopic=51332

My System SpecsSystem Spec
.

24 Sep 2013   #2

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64 Ubuntu 12.04 LTS Tri-Boot
 
 

Code:
rem *******************************************
rem Window 7 fix
c:
cd\
cd databases
copy Inventory_mgr.lnk %userprofile%\Desktop
rem *****************************************
rem windows xp
c:
cd \
cd documents and settings
cd all users
cd desktop
copy c:\databases\Inventory_mgr.lnk
C:\databases\Inventory_mgr.mdb

rem ************************************************
Your code appears to purposely create two shortcuts to the desktop.
My System SpecsSystem Spec
Reply

 Batch file not removing old icon when installing





Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:54 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33