Solved

quick dos batch to update files.

Posted on 2016-08-30
3
50 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 82

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 51

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

16 Experts available now in Live!

Get 1:1 Help Now