Solved

Batch Programming Help

Posted on 2009-05-14
3
204 Views
Last Modified: 2012-05-07
Hello Experts,
I need a little assistance with this batch file I am writing.  I need to copy some files into local users profiles.  Some of them have different versions of software loaded on there PC.   The batch file I created adds directories to the local PC.  I only want to copy the files not add to the directory.  Can someone assist on what I am doing wrong?

I was hoping to have one batch file for all users so they do not need to know what version they are running.

Thanks in advance for any help you can provide.
Bob

@ECHO off
CLS
ECHO Shape File update in Progress.
ECHO.
xcopy "Y:\AutoDesk\SETTINGS\SH650.*" "%userprofile%\Application Data\Autodesk\DWG TrueView 2010\R7\enu\Support" /D/Y/I
xcopy "Y:\AutoDesk\SETTINGS\SH650.*" "%userprofile%\Application Data\Autodesk\DWG TrueView 2009\R6\enu\Support" /D/Y/I
ECHO.
ECHO Backup of Shape File's is Complete.
Pause

Open in new window

0
Comment
Question by:RobertStamm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Shift-3 earned 250 total points
ID: 24387160
You can use the IF command to determine whether to copy the files.


@ECHO off
CLS
ECHO Shape File update in Progress.
ECHO.
if exist "%appdata%\Autodesk\DWG TrueView 2010\R7\enu\Support" (
 xcopy "Y:\AutoDesk\SETTINGS\SH650.*" "%appdata%\Autodesk\DWG TrueView 2010\R7\enu\Support\" /D /C /H /R /Y
)
 
if exist "%appdata%\Autodesk\DWG TrueView 2009\R6\enu\Support" (
 xcopy "Y:\AutoDesk\SETTINGS\SH650.*" "%appdata%\Autodesk\DWG TrueView 2009\R6\enu\Support\" /D /C /H /R /Y
)
ECHO.
ECHO Backup of Shape Files is Complete.
Pause

Open in new window

0
 

Author Comment

by:RobertStamm
ID: 24387218
Great.  I am obviously a rookie at this.

Thanks for your help.
Bob
0
 

Author Closing Comment

by:RobertStamm
ID: 31581561
Thanks again.
0

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question