DOS Batch - Forfiles - Deleting Specific File Extensions

Sep 19, 2011

I've reviewed several different examples of how forfiles works. To set the stage, I need to automatically remove files with a file extension of .0 followed by numbers that increment and these files would be 7 days or older. Unfortunately, none of the examples or forfiles /? usage explains how to specify what I need done to file extensions that end with .0xxxxx

Here is what I have so far:

Code: echo on
rem Remove stats-bin.0* files older than 7 days
forfiles /p "c:Program FilesMySQLMySQL Server 4.1data" /m stats-bin.0* /c "cmd /c del /Q @file /d -7
rem pause Within the data directory, there are stats-bin.index files, stats.0XXXXX files and others. The goal here is to only remove those files that begin with stats-bin.<numbers>

Currently, this script isn't doing anything. Trying to troubleshoot what I'm doing wrong here. If anyone has another forum they frequent for Windows script

View 1 Replies


ADVERTISEMENT

Associate File Extensions With Batch Files

Feb 2, 2012

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.

View 2 Replies View Related

Program To Batch Remove .bak File Extensions?

Sep 3, 2011

I used an Mp3 renaming program which I know cant remember and I stopped it midway through as I didnt know if it was doing what I wanted, I had set it up to remove numbers from the beginning of files, and it added a .bak extension to almost all of my files and now I need to get them off. I have since removed the program before I noticed that and I was wondering if anyone knew of a program or script that would allow me to batch remove the extensions.

View 2 Replies View Related

Create A Batch File That Runs 3 Other Batch Files

Jul 1, 2011

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).

View 1 Replies View Related

Can Sort Recycle Bin On File Extensions So Can Easily Find File

Apr 24, 2011

Can I sort the recycle bin on file extensions so I can easily find a file?

View 3 Replies View Related

Opening .car File Extensions?

Jul 5, 2012

I am rinning Windows 7 x64 home premium and I have been cleaning out my old cd'sI have an old win95 generations deluxe genealogy cd which will not setup in any mode on this computer. there is an social security death index set of 2 cds and I do not want to pitch it. I can mount and view it/them but not use them. The internals of the isos/cds are in .car file extensions and I cannot open these archives as I can not find a car archive r that will run on Windows 7 x64. and no 7zip or winrar or winzip will not open them. they are essentially they are text converted to database and compressed. does anyone know how to get these open so I can either use them or recreate them in another database program.

View 3 Replies View Related

Searching For File Extensions Other Than Ones Specified?

Jun 29, 2011

Using Windows 7, is there any way to search for files that have different extensions than ones specified in a search query?I have a bunch of directories and subdirectories and I only want two specific extensions to remain in all those directories. The others I want to review and then delete.

View 1 Replies View Related

How To Re-assign File Extensions To New Application

Apr 16, 2012

Since WinXP I have a problem when I want to re-assign a file extension to another application (=the program which should be used when double clicking on a certain file in WinExplorer).This problem appears particularly when the old, current application is NOT existing any more! [code] So again is there a real easy way/tool of re-assigning file extension to new programs regardless of what crap stuff is currently existing in Registry for that file extension?

View 8 Replies View Related

File Extensions - Hide Or Show

Aug 27, 2012

How to Hide or Show Known File Type Extensions in Windows 7 ?

View 0 Replies View Related

Why The "ftype" Command Doesn't Display All File Types Associated With File Extensions

Jun 19, 2011

I was wondering why the "ftype" command doesn't display all file types associated with file extensions.For example if I execute "assoc", some of the output is

.txt=txtfile
...
.RDP=RDP.File
When I execute the "ftype" I find an entry for "txtfile" as per below but not for "RDP".file
txtfile=%SystemRoot%system32NOTEPAD.EXE %1

Note: .RDP files are remote desktop files and are opened with %windir%system32mstsc.exe

View 1 Replies View Related

Add File Extensions To Show/hide List?

May 31, 2012

I have file extension .sfk that I'd like to have the files hidden by default. I can manually hide each file, but that'd take forever. I'd like it to be hidden by the "Don't show hidden files, folders, or drives" option. I'm completely blanking on this whole thing so I'm not even able to word it properly to search

View 4 Replies View Related

Search Drives For Multiple File Extensions

Aug 10, 2009

I've made the move (fresh install on new HDD) from XP to Win7RC x64 (I never gave Vista a look) and I want to scan my old HDD partitions for *.xls;*.doc;*.dwg;*.jpg etc to make sure I haven't missed any old files which were not saved in the right place.

The two partitions are mounted as F: and G:

In XP once you'd turned off the animated dog and chosen the advanced option, you could set "all of part of the filename" to "*.xls;*.doc;*.dwg;*.jpg" and "look in" to "f:;g:". It was a so easy

I can't seem to get Windows 7 to search for more than one file extension, let alone multiple drives as well. Is there an advanced search option which I've missed?

View 5 Replies View Related

Create A Batch File That Will Move Files Based On The File Type?

Oct 30, 2010

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

View 4 Replies View Related

Batch File In Windows 7?

Aug 21, 2011

Can someone show what a batch file would look like for use in Win7?Secondly the method for writing same batch file please.I want copy a file or files to the desktop before shutting down or rebooting and secondly copy same file/files to their original location after booting.

View 2 Replies View Related

Run Batch File As Administrator?

Mar 10, 2011

How could I run a batch file as an administrator without any user involvement. I just want when the file is clicked on to start running as an admin because it is copying files in the Programs directory and cannot do it without administrator privileges.

I have this... runas /noprofile /useran-SlateDan cmd but that requires me to have to type my password, and also just opens up a new shell and does not actually elevate the shell that it ran in.

View 11 Replies View Related

How To Uninstall A Batch File

May 27, 2011

To cut a long story short, I decided to try out a demo for a games which is coming out, and a friend gave me the file (it's a FREE demo mind you) and I didn't really like the game so I want to uninstall. How do I go about that?When I installed the game at first, it installed via one of those command prompt boxes.

View 3 Replies View Related

Batch File Renaming Possible?

May 4, 2010

is it possible to batch file name in Windows 7?

I have many videos and music that needs renaming often but i'm wary of 3rd party apps. I use to use rename-it! back when i had vista and xp but it hasn't been updated for Windows 7

View 9 Replies View Related

Batch File To .exe In Windows 7?

Sep 15, 2010

How can I convert a batch file (script) into .exe file in Windows 7?

View 4 Replies View Related

Tried To Run Batch File And Get No Results?

Oct 29, 2010

I tried to run this simple copy batch file and get no results. copy "c:aquariumaqrabases*.*" "N:"

View 4 Replies View Related

How To Always Run Batch File As Administrator

Mar 16, 2011

I've made a batch file, but i don't know how to make it to always run as administartor. In .bat's file properties the option "always run as administartor" is grayed out. I have to right click it and then choose "run as administartor" from context menu. But i don't want to do it every time because it's annoying, is there any way to make run as admin if option is grayed out in properties?

View 1 Replies View Related

Creating Batch File?

Nov 23, 2011

I have 2 files that are in the same directory which I want to start one after the other.I have created a simple batch file like this which opens 2 files at the same time. ExampleStart Server.exeStart Game.exeIs it possible to leave say a 10 second gap between opening the Server.exe and Game.exe? Also is it possible to quit Server.exe when I exit Game.exe?

View 2 Replies View Related

Convert Csv To Xls With Batch File?

Nov 8, 2012

I am looking to convert cvs files to xls with a batch file.

View 3 Replies View Related

Batch File To .exe Converter?

Dec 22, 2012

is there a simple program that converts batch file to .exe file? I found this: Bat To Exe Converter - CNET Download.com But some users say its virus/malware. Can someone confirm that or give a diffrent link?

View 2 Replies View Related

How To Get Batch File Run Daily

Mar 17, 2011

hei hava batch file that shutdowns my windows 7 pc at certain time everyday. (night). how can i get this to run daily. currently it runs on the day i "excute the batch file". for certain reason, i don't want to use the "Schedule Task" to do this.

View 11 Replies View Related

Batch File To Log In To SharePoint?

Jul 25, 2012

I am looking for a batch file to log in to SharePoint web site which has credentialsNot sure on how to pas the credentials using Batch file

View 3 Replies View Related

Change A Lot Of Icons With A Batch File?

Nov 24, 2012

I've got this folder. In this folder are 643 sub-folders. I want to change the icon of all of those folders quickly, because doing it manually would be horrible.
Each folder has to have it's own icon. Not all the same one.

Currently the .ico's are in a folder with all the exact same name as the folders they need to be matched with. (if I sort by name, they'll all be in the exact same order, if that helps anything)

example: Mainfolder/A/ needs to have icon "A.ico"

So I've been kinda searching around and it seems things like this can (or not) be done with a batch file, and the desktop.ini. Or something..

View 2 Replies View Related

Batch File To Run MMC As A Different Domain User?

Oct 27, 2010

I have a batch file that I used on XP to run an MMC that I created for common management tasks. In the MMC I have the ability to run regedit as a root forest domain privileged user (for remote system registry editing), password resets (using AD) remote computer management, and several web links for common sites the team uses. I did this so it was all in one place and it worked awesome in Win XP. When I run the batch file it reports that the directory could not be found.[CODE]

I have verified that runas is in the same place as in XP, as well as MMC. I have run the batch file with elevate access as well as run the command prompt with elevated access (in fact that was copied from an elevated command prompt). The account I'm running it on has admin rights on the box, though UAC is set, I own both the account this was run from and the "root forest" privileged account, this account is NOT a domain admin.This is all being done on Win 7 Pro in a large enterprise domain environmentthis batch file worked and still works on Win XP in the same environment.

View 4 Replies View Related

Batch File Error Windows 7 X64

Nov 17, 2010

Tried writing a batch file to open a few programs I use together regularly, but which I don't want all the time on startup.I've tried:

start �Maxivista� /d �C:Program FilesMaxiVista Pro ServerMaxiVistaAll.exe"
start �Netbeans� /d "R:Program FilesNetBeans 6.9.1in
etbeans.exe"
start �OfficeTime� /d "C:Program Files (x86)OfficeTimeOfficeTime.exe"
Start "WampServer" /d "R:wampwampmanager.exe"

[code]....

I've tried setting it to run as Admin, but the check-box is greyed out....

View 5 Replies View Related

Batch File To Start A Service?

Jan 15, 2011

if servicename is running, do nothing.if servicename is not running, then start servicename, then record the date and time.based on my search [COLOR=blue ! important][COLOR=blue ! important]online[/COLOR][/COLOR], here is what I have so far.

[code]...

It looks like that the If statement is not working. Every time I run this batch file, it runs through all the command lines.and I got a error message said the service is already running.

View 6 Replies View Related

How To Run Net Logon Batch File Silently

Feb 28, 2012

I have a few different batch files setup to map drives depending what state the user is in that runs upon logon...I am wanting to make it silent, because users tend to close out of it sometimes before it has been completed. Or at least run it minimized?It is ran from active directory...I would create a script, but I would have to change each user in active directory

View 1 Replies View Related

Editing Services With Batch File

Oct 16, 2011

Is there a way to make a batch file that will automatically change Services? My main goal here is to 1 click edit all the services I change from disable,automatic, and delayed. I use the same settings for the entire family that I am tech support for so it makes life easier.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved