?
Solved

Batch Programming Help

Posted on 2009-05-14
3
Medium Priority
?
205 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

800 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