Trying To Use Batch Code To Parse And Archive Log Files
Nov 10, 2011
I have a quick question about compressing a bunch of log files that have specific years at the end of their file names.[code When the above is executed, it looks for an "archives" folder. If it's not there, it tries to create it as a place to store the yearly ZIP archives (notice the years are in bold in the above list of example files). Beyond that, it just goes through steps of reading the file names and parsing the name itself if and only if they're of type *.log. As you can see, I'm still working on this but wanted to understand why "ECHO is off." keeps repeated during runtime... I thought I had it set to OFF. It has me stumped.
I need to read several .txt files and search them for a specific string, lets say "key1" and "key2." If the file has key1, then it needs to be moved into directory1. If the file has key2, then it needs to be moved to directory2. There's no telling ahead of time what line the string is going to be on, so I'm guessing I could use "Find" to search for the key? Then how do I loop through all the files, read them, then sort them into the different directories?
I am trying to create a batch file that runs 3 other batch files. Right now, it works fine using the call command on each other batch file. However, these other batch files take awhile to run. and so the entire process takes a very long time, since each "sub" batch file is run only after the previous one is finished.I was wondering if there is a command or way to start a batch file fro the top-level batch file, then go on and start the next batch file before the previous one is finished. In other words, I want the sub batch files to run in parallel in the background. (similar to the '&' in Unix).
I am making regular backups - both the image backup and the file sets using Windows 7 Backup program. No problems with that.
But, I periodically would like to copy the image backup to a portable drive. I plan to take this portable drive offsite to a secure location - I call it my archive.
Is this possible? What files must I copy? Do I have to maintain a certain directory structure or naming convention in case I have to use the archived copy to restore (assume a bare metal restoration)?
I thought I could just copy the VHD files (boot and system) but the image backup has other directories and files and I just don't understand their purpose.
I need to copy these files rather than running the backup over again to this portable archive device. I have multiple computers and it is impractical for me to physically access each computer to re-run an image backup to the same archive device.
My archive device is a regular USB/eSata HDD and I don't plan to put VSS on it.
So I'm trying to make a personal shortcut on my computer to change a password using the shiftkeys .exe (C:WindowsSystem32sethc.exe) which can be done from setup.I'm looking to design this because I frequently deal with friends and family who have forgotten passwords, as well as my purchasing used computers.I want to automate the process, but I've hit a problem, which is making the batch file remove itself.I have a .exe file replace sethc.exe, with sethc.exe renamed to sethc.exe.I'm using the following lines Code: del sethc.exeren sethc2.exe sethc.exedel %0 The batch file deletes itself successfully (del %0), but it's completely failing at the removal of the .exe and the renaming. I've tried changing the targeting, checking the syntax, but as far as I can tell, everything checks out, yet it still fails.
I have searched all over the Internet looking for how to associate certain extensions with certain programs using a .bat file... but no luck. I have spent about two hours experimenting. I'm able to do this from the command prompt: Code: ASSOC .cpp=C++_Source_Code FTYPE C++_Source_Code=E:Notepad2.exe %0 I created a small hi.cpp file to test this. It works perfectly. The command line is E:Notepad2.exe E:hi.cpp just like it should be.
However, doing the same thing from within a batch file yields the command line E:Notepad2.exe E:assoc.bat which opens my batch file when i double-click on hi.cpp... Is it even possible to perform this association from within a batch file? I have a LOT of different file types to register, and i don't want to spend 20 minutes every time i log on associating these extensions by hand.
I recently got a new laptop running Win 7 Pro 64-bit and as part of my initial third-party software installations I inadvertently overwrote the 'Path' environment variable (instead of appending to it). I subsequently tried adding c:windowssystem32; to it but don't know if this is doing anything. I have not managed to find any definitive information on what the Path ev should be on a new Windows 7 64-bit install.The thing is I loaded a batch process which I had on another Win 7 (32-bit) system but when I key the bat filename in cmd.exe (without the extension or double-click it) I get this error:"The syntax of the command is incorrect."If I key the bat filename with the extension, it runs but then stops because it seems not to recognize another program which the bat file calls even though I have the Path ev set for that program.
My temporary folder has been have batch files created in it every 15 seconds or so. My mouse is the arrow with the busy circle at 2'oclock of it constantly, so something is running. I checked my processes and they seemed to all be normal. I updated everything including windows.net 4 so I don't know what else to try.
It is Windows 7 64bit Home i3 Processor w/ 4gb RAM
And the batch files all have been 6 digits numbers increasing in numbers so it would be like 178521 and the next one would be 178762 etc. There are two conhost.exe running.
I was thinking today about how all the time people need to copy/paste text links they find on the internet.I know there are many extensions that add the functionality of parsing text links, but shouldn't this be a feature automatically implemented in most current browsers?I can't think of any good reason not to have this option available, since I'm sure millions of people each day need to tediously copy/paste the addresses of sites they find in these all-text areas of the internet
I require a batch file or free utility that i can redistribute from my web site to other users, (gamers) that will copy the contents of a directory inside their game to a new location and re-name the directory at the same time. Something like this; Copy "GenesisVehicleruck diesel4tonbaker"to "GenesisVehicleruckdiesel4tonbutcher".The batch file needs to be run without the need for a command line box being opened, that is, if the user can double click on it or run it with a 'right click' that would be great. Problem there is, I maybe need an exe file not a batch file. The other part of the problem is that the folder to be copied may or may not be in the same location on every PC that runs the file. It may be the case that the 4tonbaker folder is on; [code] and I require the end user to have no need to know, just for the directory to be copied and renamed when and where it is found.If possible I then want the batch file to perform a second task. I want to distribute a folder, lets say it is 4tonbutcher and in that folder there are files lets say doc1.txt, doc2.txt and doc3.txt.On any given users PC 4tonbaker has these same named files but the content is different to the ones in my folder 4tonbutcher, I want to update the newly created folder, 4tonbutcher with the new txt files I distribute.
So, User downloads a folder called 4tonbutcher from my site.Batch file copies and renames a folder from a location on the users PC, "Genesis Vehiclesruckdiesel4tonbaker" to "Genesis Vehiclesruckdiesel4tonbutcher".Batch file copies doc1.txt, doc2.txt and doc3.txt from the downloaded folder to the newly created folder 4tonbutcher.
I just downloaded all of the Google Web Fonts and they were each downloaded into their respected folders, so instead of clicking on folder after folder and right clicking after right clicking and finally installing each and every font;
How can I create a command prompt (batch) file so the prompt can search the main folder where all the font folders are, grab any and all TrueType Font files and move or copy them into another single folder?
I'm trying to do a clean install of Windows 7 Ultimate on a Sony Vaio AR41s via a DVD that I burned (slowest speed, was very careful about that) but upon starting the installation I get the error message: Windows cannot parse the unattend answer file's <DiskConfiguration> setting After closing this dialog box the laptop reboots and starts the process from scratch.The Vaio has nothing on it as far as I'm aware (No OS found etc...) so I'm pretty sure this is as clean a install as I could do.
I am trying to move user directories when doing a clean install of windows Pro. During the OOBE boot, I get this error: Windows could not parse or process unattend answer file [C:WindowsPantherunattend.xml] for pass [oobe]. The setting specified in the error file cannot be applied. The error was detected while processing settings for component [Microsoft-Windows-Shell-Setup]. Here is the answer file(product key X'ed out):
I have a folder with around 2000 files in it. I want to be able to copy certain files from this folder (normally around 40) and place them in a brand new folder, I want to be able to do this with nothing more than a txt file that has all the file names I need copying in it with every file name on a separate line.I receive around 10 new txt files each day so you can imagine how tedious it is searching through 2000 files, picking out the 40 I need, times a day everyday.To make things even more complicated, the txt files I receive don't always have the correct file names in them, maybe there's a misspelling or a word or two missing for some of the names. That's ok when I'm going through picking out the files I need to copy myself because I can normally tell which file is being requested, but I can't see it being so easy for a program or whatever to do, I'm guessing it'll need to have a search feature where it picks out the most likely file.I'd like it to be as automated as possible. I receive the txt file, make sure each file name is on a separate line then a program or script or whatever goes out and picks out the files (or most likely files for the name's that aren't exact matches) and copies them into a brand new folder (which I'd like to be the same name as the text file it's using to choose the files).
How to create a batch file that will move files based on the file type?My Requirement : I need a batch file to copy all .doc files in all my HardDisk to aremovable disk say (Z: drive) . Can anyone make it possible using a batch file
i'm having a problem with my windows 7. when i'm downloading a rar file the icon of the archive isn't there. when i''d click the open with the archive can't be seen there.... what will i download to see the archive icon and i can now download anything and extract anything...
Several months ago I got a new laptop with Win 7 Pro SP1 64bit. I have done numerous backups on this machine but I've noticed that the file attribute 'archive bit' (a) is not being reset as it was on Win XP. (NOTE: backups were full backups not incremental or differential. Does Win 7 treat file attribute bits differently than XP? I also have noticed that 7 displays various attribute bits that were not used in XP; where is there a description of all attribute bits?
I use a backup software called Macrium Reflect and they have an option for splitting your backup archive. I have a split archive that I have stored over multiple hard drives (because it is a very large file), but I cannot open the archive unless the archives are all in one folder. Is there some way to make a "virtual directory" or network drive so that I can use these files as if they are in the same folder, even though they are on different drives?
My daughter's XP laptop crashed (trashed hard disk that I doubt we can rescue much data from) and so we got her a Windows 7 computer. Unless we can rescue much of the old data from crashed XP, she's pretty much starting off empty. Except that today I discovered on an external hard drive the "Easy Transfer" of her account from 15 months ago, from a computer she shared at that time, that was used to "port her up" on the XP laptop. So in theory, this "Easy Transfer" archive should have all of her data and files from 15 months ago.
But although the archive looks like regular Windows folders and files, on closer examination, it's not. For example, I know there are jpg and .doc files, plenty of them, in the mix, yet all I see is lots of shortcuts to such files. Is there a way, without running Windows Easy Transfer (I don't want to mess with her now running and configured Windows 7 laptop), to turn the Easy Transfer archive into a source from which I could copy over selected files and folders onto her new machine?
I'm trying to UNINSTALL programs that I have not used for a long time. I can't find those in Control Panel -> Uninstall Programs & Features, but I found it in C:Windows folder. When i tried to Run the Uninstall Application I'm prompted with: INVALID START MODE: ARCHIVE FILENAME
the programs i'm trying to uninstall were scanned with rootkits by Avast! antivirus
I want to copy my pictures to an external hard drive. When I load digital pictures to "my pictures"on my computer, it also copies them to my ext. hard drive. Should I delete a picture from "my pictures" it also deletes the picture from my ext. hard drive. I want to keep the ext. hard drive pictures safe no matter what I do with the pictures on my computer "my pictures." Any one have an idea how I can do that.
I have been using DVD-RAM discs for many years to store/archive pictures and other data and have never encountered any problems with them. Recommendations I have seen on the web state that this format is the most robust and reliable DVD format for data storage and that DVD-RAM discs should have a lifetime of 30 years if stored in the right conditions. I recently purchased a new Sony Vaio 'all-in-one' PC with Windows 7 64 Bit OS and I have been very pleased with it.
One of the reasons that I chose this PC was because the optical drive spec included read/write for DVD-RAM discs. I tested this facility straight away and it appeared to work perfectly with new DVD-RAM discs BUT when I put in some of my older DVD-RAM archive discs, Windows Explorer shows them to be empty, although a few of the discs it was able to read OK. I have a lot of DVD-RAM archives but fortunately, I still have an old XP (SP3) laptop which can read the discs.
So, I am in the process of copying all the archived data onto a 1TB Toshiba USB drive from where the new Sony Vaio can access the 'missing' files. The question in my mind is whether there is a fundamental incompatibility between older DVD-RAM discs and Windows 7 64 bit or whether the problem lies with outdated drivers, different formatting of older DVD-RAM discs or some other reasons. I also need to decide whether to continue archiving onto DVD-RAM discs.
I have a user who has accidentally deleted one of her sub-folders in the Archive folder. Is there any way to recover this? I saw nothing in the Tools Menu > Recover Deleted Items.. area and there is nothing in the trash bin.
I have noticed that a number of videos in my archive have disappeared. It is not a high percentage of the videos, just one here and there. Diagnostics show nothing wrong with the storage drive, nor anything else that I can think of. At first I thought it must have been due to me accidentally deleting a file, or not really having saved it as I thought that I had, but I now know that is not the case. I'm accustomed to what usually happens when a file becomes corrupted, it just becomes unusable, but still remains visible to the file manager and other programs, but I'm wondering if it might totally disappear?