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
prayder

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
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

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




Similar help and support threads
Thread Forum
removing batch file from registry
recently I ran Mamu's add icons to system batch file for mame icons. I wasn't satified with the results so I was going to do a system restore. Then I learned system restore was turned off "which I turn off when I defrag then turn back on when completed". Now I can't figuere out how to remove it....
Software
How to run a batch file at logoff & some batch scripting help please
Hiya, I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups. Two questions: 1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd...
Backup and Restore
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
Batch file icon blank
Whenever I run a batch file, the icon in the taskbar is blank/default.http://i.imgur.com/UKyGi.png Is there any way to make it so it's the cmd.exe icon?
General Discussion
batch file open file for program in the startup folder
I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the...
General Discussion
How to create a batch file that will move files based on the file type
How to create a batch file that will move files based on the file type? My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...
General Discussion


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:05.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App