Prayder Posted September 23, 2013 Report Share Posted September 23, 2013 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 databasesC:cd\databasesdel Inventory_mgr.mdbo:CD\WWP Shared\DatabasesECHO ONecho "PLEASE WAIT WHILE FILES ARE BEING COPIED!!!"echo "This box will close upon completion!!!!"ECHO OFFcopy Inventory_mgr.mdb C:\databasescopy FREE3OF9.ttf c:\databasesCD\WWP Shared\Databases\iconsCopy Inventory_mgr.ico c:\databasesCD\WWP Shared\Databases\shortcutscopy Inventory_mgr.lnk c:\databasesrem *******************************************rem Window 7 fixc:cd\cd databasescopy Inventory_mgr.lnk %userprofile%\Desktoprem *****************************************rem windows xpc:cd \cd documents and settingscd all userscd desktopcopy c:\databases\Inventory_mgr.lnkC:\databases\Inventory_mgr.mdb rem ************************************************ Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted September 24, 2013 Report Share Posted September 24, 2013 Yes, that's exactly what your batch file does. In fact, it seems to add two copies to your desktop; one to your desktop, and one to All Users desktop. Quote Link to comment Share on other sites More sharing options...
Prayder Posted September 24, 2013 Author Report Share Posted September 24, 2013 ok..... So I removed everything below the windows 7 fix but still though when I run it... it still adds an additional icon instead of replacing the icon... How can I resolve that? Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted September 25, 2013 Report Share Posted September 25, 2013 Maybe delete the old one before you copy the new shortcut? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.