Advertisement

02.04.2008 at 08:59AM PST, ID: 23135345
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Moving Files between Client & Server with Windows Batch File Logic

Asked by heatfan07 in Windows Batch Scripting, Scripting Languages, Shell Scripting

Tags:

I need to conditionally move a folder containing settings (files) for a client/server app from a server down to a client machine.  Right now, I have a batch file written and in production that will create the necessary directory structure on the client where the setting files need to be placed and will also xcopy the files down to the client from the server.

Now, to further automate the process, I need an Experts' help to show me how to apply LOGIC onto the batch file.  I need the batch file to:

(1) Check the network location for the files:

Inside of my current batch file, I am using the Windows %username% variable to direct the file copy.  So therefore, on my server, I am placing the settings inside of a folder named based on the username.  For example, user John Smith has all of his settings inside of a folder named "jsmith" which is on a network share.  My user logs in and can run the batch file because Windows will go out and look for that folder on the network based on the value of %username% taken from the presently logged in user.

WHAT I NEED HELP WITH is to learn how to make the batch file check the network location automatically.  These settings files are being placed onto the network location manually by myself, which is part of my process.  I am placing the files there if I need to move someone.  If I have placed the settings files inside of the user's folder, then I need the batch file to create the directory structure and copy them over (which is already written).  However, IF the files are not there, I need the batch file to exit.

Below is the content of my batch file so far.  You can see based on the above description that it needs LOGIC to check for these files on the network share:

c:
cd "c:\documents and settings\%username%\local settings\application data"
mkdir lotus
cd lotus
mkdir notes
cd notes
mkdir data
cd data
xcopy "\\server\share\Notes Moves\%username%" /h/i/q/r/y/s/e

Thanks in advance for your help.  If I can get this working correctly, it will save me a tremendous amount of time and energy.Start Free Trial
 
Keywords: Moving Files between Client & Server …
 
Loading Advertisement...
 
[+][-]02.04.2008 at 09:12AM PST, ID: 20816146

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows Batch Scripting, Scripting Languages, Shell Scripting
Tags: Windows Batch
Sign Up Now!
Solution Provided By: oBdA
Participating Experts: 2
Solution Grade: A
 
 
[+][-]02.04.2008 at 09:18AM PST, ID: 20816187

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.04.2008 at 10:04AM PST, ID: 20816538

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628