Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

quick dos batch to update files.

Posted on 2016-08-30
3
Medium Priority
?
100 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
[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
3 Comments
 
LVL 85

Accepted Solution

by:
oBdA earned 1600 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 58

Assisted Solution

by:Bill Prew
Bill Prew earned 400 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

636 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