Batch file gurus: how to copy don't miss it that files between parallel folder by using UNC paths trees
The problem: you have two directories structures identical, a source and a target. (Let's say \\srchost\srcfolder and c:\destfolder.) The goal: using a batch file in Windows XP, browse to the source folders and add all files to the destination tree that do not already exist there. We are not concerned with the dates, only if the file exists.
The Replace command has a parameter /a which will do that to a single file, but it will not browse.
Using the command ForFiles to browse directories and pass them to replace does not work because it does not support UNC paths.
Winds with the command For being... infernal. Here is some of the best I have to this day, in the form of a batch file called with the paths of the src and dest as parameters:
Set srcpath = % ~ f1
the value destpath = % ~ f2
for/r % srcpath % (.) DO)
Set tmpsrc = %% ~ fi
Set tmpdest = % destpath
otherwise! tmpsrc! is % srcpath % set tmpdest = call! tmpdest! tmpsrc: % % = srcpath!
replace/a! tmpsrc! \ *. * « ! tmpdest! »
)
I think we can all agree this is really obnoxious, especially because it works only if you start the shell with the V switch: WE.
This turns into an unhealthy obsession for me. I wanted a simple batch file solution to this since, oh, around 1990. Surely, there must be a better way! Can someone enlighten me?
And just at the head of some obvious answers:
1. No, I don't have the option to install just
2. do not forget that it must work with the UNC paths, so ForFiles is out. Thank you for your ideas! I really sleep better if there is a healthy way to run this seemlingly simple task. -Roy Robocopy with . /XF looks like a possibility. "Roy Feague" wrote in the new message: * e-mail address is removed from the privacy... * The problem: you have two directories structures identical, a source and a target. (Let's say \\srchost\srcfolder and c:\destfolder.) The goal: using a batch file in Windows XP, browse to the source folders and add all files to the destination tree that do not already exist there. We are not concerned with the dates, only if the file exists. The Replace command has a parameter /a which will do that to a single file, but it will not browse. Using the command ForFiles to browse directories and pass them to replace does not work because it does not support UNC paths. Winds with the command For being... infernal. Here is some of the best I have to this day, in the form of a batch file called with the paths of the src and dest as parameters: Set srcpath = % ~ f1 This turns into an unhealthy obsession for me. I wanted a simple batch file solution to this since, oh, around 1990. Surely, there must be a better way! Can someone enlighten me? And just at the head of some obvious answers: 1. No, I don't have the option to install just Tags: Windows In bulk to rename files in a folder by using the DOS command line or a batch file. Can someone help with this problem, please? I remember seeing the DOS command line to do a mass renaming of files in a folder or a batch file. for example, vacation photos are all in the format DSC00001.jpg to DSC001234 and I want to change it to something like, say, Rome0001.jpg to Rome1234.jpg. Old timer I don't know my key code or how locate it how can I get a code key that I have no credit or debit or money Hi John,. You can follow the steps in the link below to check if the operating system you are using is enabled or not. How to tell if Windows 7 is activated? http://Windows.Microsoft.com/en-in/Windows7/how-can-i-tell-if-Windows-7-is-activated The steps in the link will help you activate Windows 7, but you must have a product key. If you do not, you need to buy it. Activate Windows 7 on this computer http://Windows.Microsoft.com/en-in/Windows7/activate-Windows-7-on-this-computer Do not hesitate to write to us in case if you have any questions. We will be happy to help you. How to COPY a BACKUP as the... CONTROLFILE can be used for the OPEN database I create a document such as a "How To" to move a position for a Junior DBA controlfile. But it seems that I'm the Junior because I am facing the following... Action plan: Move/rename a Controlfile Version of the database: 11.2.0.3 Controlfiles moving of: / goldengate/ORCL/ORADATA /. TO: / GoldenGate/ORCL/controlfile Step 1: Set up environment variables $> export ORACLE_SID = ORCL1 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- $> echo $ORACLE_SID ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORCL1 $> export ORACLE_BASE = / u01/app/oracle ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- $> echo $ORACLE_BASE ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- / u01/app/Oracle $> export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.3/dbhome_1 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- $ echo $ORACLE_HOME ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /U01/app/Oracle/product/11.2.0.3/dbhome_1 Step 2: Check control_files parameter $> echo "see THE PARAMETER control_files | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- VALUE OF TYPE NAME ------------------------------------ ----------- ------------------------------ control_files string/goldengate/ORCL/ORADATA/control ol01. CTL, / goldengate/ORCL/ORA DATA/control02.ctl Step 3: Closing the open database $> echo 'SHUTDOWN IMMEDIATE'; | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The database is closed. The database is dismounted. ORACLE instance stops. Step 4: Editing of the database $> echo "STARTUP MOUNT"; | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORACLE instance started. Total System Global Area 4275781632 bytes Bytes of size 2235208 fixed 822084792 variable size bytes 3439329280 of database buffers bytes Redo buffers 12132352 bytes Mounted database. Step 5: Creating a copy of the current controlfile $> echo "AS BACKUP COPY CURRENT CONTROLFILE FORMAT ' / goldengate/ORCL/CONTROLFILE/control01.copy.ctl'; ' | RMAN target / nocatalog ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Recovery Manager: release 11.2.0.3.0 - Production Fri Oct 22 17:03:27 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID = 1420762587, is not open) using the control file of the target instead of recovery catalog database RMAN > From 22 October 15 backup allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID = 58 type of device = DISK channel ORA_DISK_1: from data file copy copy the current control file tag name=/goldengate/ORCL/CONTROLFILE/control01.copy.ctl output file = RECID = 1 STAMP = 893783011 TAG20151022T170329 channel ORA_DISK_1: datafile copy complete, duration: 00:00:03 Backup finished at 22 October 15 RMAN > Complete recovery manager. Step 6: Change of parameter control_files $> echo "ALTER SYSTEM SET control_files='/goldengate/ORCL/CONTROLFILE/control01.copy.ctl' SCOPE = SPFILE;" | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Modified system. Step 7: Closing of the mounted database $> echo 'SHUTDOWN IMMEDIATE'; | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORA-01109: database is not open The database is dismounted. ORACLE instance stops. Step 8: Installation of the database $> echo "STARTUP MOUNT"; | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORACLE instance started. Total System Global Area 4275781632 bytes Bytes of size 2235208 fixed 822084792 variable size bytes 3439329280 of database buffers bytes Redo buffers 12132352 bytes Mounted database. Step 9: Check control_files parameter $> echo "see THE PARAMETER control_files | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- VALUE OF TYPE NAME ------------------------------------ ----------- ------------------------------ control_files string/goldengate/ORCL/CONTROLFILE/c ontrol01. Copy.CTL Step 10: Open the mounted database $> echo "ALTER DATABASE OPEN"; | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ALTER DATABASE OPEN * ERROR on line 1: ORA-01589: must use RESETLOGS or NORESETLOGS option of database open $> echo "ALTER DATABASE OPEN NORESETLOGS"; | sqlplus-s "virtue sysdba". ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ALTER DATABASE OPEN NORESETLOGS * ERROR on line 1: ORA-01610: recovery using BACKUP CONTROLFILE option must be Then... $> sqlplus/nolog ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- SQL * more: Production release 11.2.0.3.0 the game Oct 22 17:14:43 2015 Copyright (c) 1982, 2011, Oracle. All rights reserved. SQL > CONNECT sysdba virtue ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Connected. SQL > RECOVER DATABASE with the HELP of BACKUP CONTROLFILE until CANCEL; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORA-00279: change 621941 September at 22/10/2015 16:57:33 needed to screw 1 ORA-00289: suggestion: /U01/app/Oracle/product/11.2.0.3/dbhome_1/DBS/arch1_11_892981851.dbf ORA-00280: change 621941 thread 1 is in sequence #11 Specify the log: {< RET > = suggested |} Filename | AUTO | CANCEL} Cancel ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Cancelled media recovery. SQL > ALTER DATABASE OPEN; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ALTER DATABASE OPEN * ERROR on line 1: ORA-01589: must use RESETLOGS or NORESETLOGS option of database open Issues related to the: What am I misunderstanding? BACKUP COPY THAT isn't really a COPY. Why I can't use the 'copy' of the controlfile created by RMAN? Note: If I just copy the controlfile to the new location when the database shuts down everything works fine. Thanks in advance. Juan M It is also mentioned in https://docs.oracle.com/cd/E11882_01/server.112/e25494/control.htm#ADMIN11288 How do I get my printer so that I stop my neighbors to use my wireless printer to print? I am on a wireless secured with 5 other apartments and a person has been recently able to access and print from my wireless printer. On the printer itself, I can't find where I put a code encryption or security of the printer. So, I hope that someone could walk me through how to set up so that the printer is secure. It's a HP Officejet 6500. In fact, it's quite possible. Simply adjust the security settings on the printer to do this. Just for printers and devices, right click on the unit, open the properties of the printer and on the 'Security' tab, you can restrict users on the same network. This should allow you to control your printer with a little more discretion. Happy holidays! Find a specific PDF file between sheets of link using DW? Have a question from Dreamweaver/link. We map in PDF format in our library. I am trying to track down a specific PDF file of our binding sheets (check it's there). Is there a way to do more looking at the code in the sheet of each link file in Dreamweaver?... maybe indexed somehow, then the search index? The simple way to do this is to open search and replace (on the edit or Ctrl + F / Cmd + F). Use the following settings: Click Find all. The results will be displayed in a panel at the bottom of the screen. Windows 7 x 64 envy 700-109cb - don't miss you that 2 drivers This forum is fantastic! Thank you HP Experts! I was able to install W7 and locate most of the drivers for this card mother IPM87-MP. Could you please help to locate the 2 drivers I'm missing? Network controller The drivers for this device are not installed. (Code 28) PCI\VEN_14E4 & DEV_43B1 & SUBSYS_2154103C & REV_03 BCM20702A0 The drivers for this device are not installed. (Code 28) USB\VID_0A5C & PID_21FB & REV_0112 Thanks in advance for any help you can give. Doug I'm starting to lose hope on this one. I'll pull out all the stops here and go to other websites of PC support. Try this Bluetooth driver for laptop Lenovo. http://support.Lenovo.com/en_US/downloads/detail.page?docid=DS029104 the system I use is vista. the internet is bell sympatico. Does that mean that you are using Windows Mail, which is the e-mail provided in Windows Vista program or you are using an e-mail program provided by your service provider Internet, Bell? If it is Windows Mail, try this: http://www.ehow.com/how_5984806_recover-e_mails-windows-mail-vista.html I can't for the life of find me where the setting is to disable the Outlook plugins. More precisely, it must disable sending and the track that appears on the Ribbon home Outlook after installation. In the features Panel. 1) If packing everything at the same time, use the same DRMParameters instance whenever you call MediaEncrypter.encryptContent (). Everything packed using the exact the same DRMParameters object will be associated with the same license. 2) If the contents of package at different times, but who want to have all the content associated with the same license, you must use V2KeyParameters.setContentEncryptionKey (). The first time you compress a piece of content, you would use ContentEncryptionKey.generate () to generate a new key/license ID. To use the same key/license for the content later, you need to store the info in ContentEncryptionKey, so you can later pass in values for the new content. The content of the package at different times using the same license, you must implement the following: Media conditioned to steps 3 and 7 should now be protected using the same license. Cannot create a daily backups from a batch file xcopy & too many parameters. I'm trying to create a simple daily to the top of a batch file. Put quotation marks around the file name with spaces included, so:
I would also put a space before the second pass, but I don't know if it's absolutely necessary: / s/d How to copy and paste from Thunderbird. Hello I know that this may seem obvious, but my question is not how to copy / paste because I know that orders. The problem is that whenever I have copy and paste all the texts that it sticks adds an extra space in it, so I need to go and remove the space, so it would be normal and not double spacing. I tried searching all possible options, but could not find any way for texts get pasted correctly. Any help would be appreciated! Open Tools/Options/Advanced/general/Config. Editor and double-click the preference layout.word_select.eat_space_to_next_word to activate it false. http://KB.mozillazine.org/layout.word_select.eat_space_to_next_word Same thing for Firefox, if you wish. Give permission to the domain users to replace the file in the folder created by domain admin We have a domain controller in our network. also we have the domain users and domain administrator. We create a batch file that copies a file to the folder by using a script to the server policy when users open a session input/output. However if the admin area access system cant use overwrite file in the folder. We want to give permission to the domain users to replace the file in the folder created by the domain administrator. Hello The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums. Hope the information is useful. Access to folders and files on your computer using the UNC path in another area We have two different fields in our society (let's say the domain A and domain B) and are under the same subnet. Since some colleagues need to access the files in both sides, What we had planned is to their PC to join A domain and create a user account in domain B. When they need to access domain B to domain A PC files, they simply type in the unc path and Enter the credentials of their domain user account B. Now the situation is, when the user types in their identification of the B domain user account information, it always displays in Windows security: Connection failure: unknown username or bad password I wonder - is this due to the feature win CredSSP 7, as the CredSSP will affect Remote Desktop that cause similar unless problem shut down us by editing the default.rdp. Anyone know CredSSP is the cause of this problem? Or is it caused by another issue & no work around for it? Hello Frederik, I have already made to precede the user name with the domain name but always this error. Why I think that it is related to CredSSP is because I got the same error when I use remote control for PC B of the domain A PC. While the issue of distance is resolved by changing default.RDP with notepad, adding, [enablecredsspsupport:i:0] at the end. So, I wonder the problem of file also caused by CredSSP. How can batch files - I copy files from subfolders II have a directory with several folders that contain pictures, documents, etc... I need a batch file which will look through all these aand only copy files .doc to a specific folder. Now there are hundreds of these files that need to be addressed through, so I really don't want og manually, would be nice if someone could help me here Duplicate file names... If you assume that there is not -> These assumptions are generally bad. is it easy to code? -> Easy to code but hard to understand, unless you're an expert. Notice that the script fails when it encounters some "poison characters" such as brackets or double quotes. If you have one of these in your file names or folder, then a different approach is required. off @echo One month free for the hometelefones and mobile. To date, I received an E-mail from you, sayes I can get a month free call by SKYPE homefones and mobile. To call homefones, yes it works, but not mobile. To do this, I have to buy credits. What's wrong? where we found all the duration of the call to ios 9.2 How we found all the durtions call in 9.2.1 ios iphone 6 Camera driver not found on Satellite A200-130 Vista In my new Satellite A200-130 (with built-in 1.3 m camera), impossible to find any software/driver of the camera installed.It presents Chicony USB 2.0 Camera in the device driver > imaging devices, but can't find the software anywhere shortcut in the Re: Satellite Pro A300-1EA - difficulties in upgrading the BIOS Hello I tried to update BIOS on my new Satellite Pro A300-1EA (PSAG9E-001001EN), requested by Tempro, since version 1.50 to 1.90. The system has completely frozen during the BIOS flash, after waiting for an hour, I decided to turn the power off and p Locate the hard drive on old PCU How can I find the hard drive on my old s (2007) PKU Dell so I can trash (for security reasons) until I put it the dumpster garbage? THX for your answer.
the value destpath = % ~ f2
for/r % srcpath % (.) DO)
Set tmpsrc = %% ~ fi
Set tmpdest = % destpath
otherwise! tmpsrc! is % srcpath % set tmpdest = call! tmpdest! tmpsrc: % % = srcpath!
replace/a! tmpsrc! \ *. * « ! tmpdest! »
)
I think we can all agree this is really obnoxious, especially because it works only if you start the shell with the V switch: WE.
2. do not forget that it must work with the UNC paths, so ForFiles is out.
Thank you for your ideas! I really sleep better if there is a healthy way to run this seemlingly simple task.
-RoySimilar Questions
Create additional Copies, rename and move the control files
PCI\VEN_14E4 & DEV_43B1 & SUBSYS_2154103C
PCI\VEN_14E4 & DEV_43B1 & CC_028000
PCI\VEN_14E4 & DEV_43B1 & CC_0280
USB\VID_0A5C & PID_21FB
Set SourceFolder = C:\Users\JohnDoe
Define TargetFolder = D:\MyDocs
for /F "delims =" % in ('dir /s /b /ad "% SourceFolder%\*.*" ') do)
If there are some "%%a\*.doc" xcopy.exe/y "%%a\*.doc*" "% TargetFolder%\". »
)Maybe you are looking for