Solved

quick dos batch to update files.

Posted on 2016-08-30
3
55 Views
Last Modified: 2016-08-30
I need to a quick dos batch to accomplish the following:

1. if not exist \\server2\share\%username%\appdata\roaming\vlc
mkdir \\server2\share\%username%\appdata\roaming\vlc
copy \\server1\share\vlc\vlc-qt-interface.ini \\server2\share\%username%\appdata\roaming\vlc\vlc-qt-interface.ini /y

2. if exist \\server2\share\%username%\appdata\roaming\vlc
just copy \\server1\share\vlc\vlc-qt-interface.ini \\server2\share\%username%\appdata\roaming\vlc\vlc-qt-interface.ini /y and overwrite the existing file.  

Would some put it together with the right syntax?  

I do not mind if someone can suggest the PS version that does the same.  

Thanks.
0
Comment
Question by:nav2567
3 Comments
 
LVL 83

Accepted Solution

by:
oBdA earned 400 total points
ID: 41776988
set TargetDir=\\server2\share\%username%\appdata\roaming\vlc
if not exist "%TargetDir%" mkdir "%TargetDir%"
copy "\\server1\share\vlc\vlc-qt-interface.ini" "%TargetDir%\vlc-qt-interface.ini" /y

Open in new window

0
 
LVL 52

Assisted Solution

by:Bill Prew
Bill Prew earned 100 total points
ID: 41776989
I think this is what you are trying to doi:

@echo off
setlocal

set DestDir=\\server2\share\%username%\appdata\roaming\vlc
set IniFile=\\server1\share\vlc\vlc-qt-interface.ini

if not exist "%DestDir%" mkdir "%DestDir%"
copy /y "%IniFile%" "%DestDir%" >NUL

Open in new window

~bp
0
 

Author Closing Comment

by:nav2567
ID: 41777003
Thanks.
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now