Flux rss
Search : in
By : Relevance Date Username
Statut : Not resolved

Batch file to determine latest file

georgiebest678, on Monday 5 May 2008 à 14:07:36
Hello,



I find myself in the position of needing a batch file to do a specific task for a menu system I am making. What I need is this:

I have a c:\windows directory that has files such as autoexec.001, autoexec.002, etc.

I want the batch file to determine the latest file (like autoexec.003) and copy it to c:\ as autoexec.bat.

any help would be great. not working with vb or anything on this, just plain old DOS.

Thanks!
Configuration: Windows XP
Internet Explorer 6.0
Reply to georgiebest678  Report this message to moderators Go to last message

1


  • 1
    This message seems useful, vote!
  • Ce message ne vous semble pas utile, votez !
  • Report this message to moderators
bobgure, on Monday 5 May 2008 à 14:42:56
Hai


:: --- BATCH SCRIPT START ---
@echo off
setlocal
set source=c:\windows
set destdir=c:\
pushd "%source%"
for /f "tokens=*" %%a in ('dir autoexec.* /b /a-d /o:e 2^>NUL') do (set lfile=%%a)
echo copying "%source%\%lfile%" to "%destdir%" As autoexec.bat
copy /y "%source%\%lfile%" "%destdir%\autoexec.bat"
::--- BATCH SCRIPT END---
Reply to bobgure

2


  • This message seems useful, vote!
  • Report this message to moderators
 ed, on Monday 7 July 2008 à 15:25:20
This is excellent!

Works like a charm, I used an edited version to copy the most recent backup to my offsite restore container.
Reply to ed

Résultats pour Batch file to determine latest file

Batch file name(s) in memory? os Xp Hello, How would I go about writing a batch file to copy all the file names in a folder...just the file names not the files and then rename them to something standard like "video1.avi", "video2.avi",etc. THEN when I'm ready rename them to the... en.kioskea.net/forum/affich-1618-batch-file-name-s-in-memory-os-xp
Telnet script or batch file (Solved) Hello, I want to build a script or a batch file that I can set to run on a daily basis that will telnet to a device and then send commands to it. Basically it would need to telnet and then run a command and exit out of the device. I was thinking I... en.kioskea.net/forum/affich-4262-telnet-script-or-batch-file
Help with Loop in batch File using input from (Solved) Hi Together I try to scan some PCs remotely and do want to automize this task. I created a batch file doing a good job, however, it scans only one pc and then I do need to change the target system name. I now want to create a comma seperated list,... en.kioskea.net/forum/affich-15768-help-with-loop-in-batch-file-using-input-from

Résultats pour Batch file to determine latest file

How to determine your operating systems ?how to determine your operating systems ? There are many Operating System available and it is quite difficult to depict due to its similarity and quite small differences. The easiest way to know what windows operate on your computer is to... en.kioskea.net/faq/sujet-484-how-to-determine-your-operating-systems
Create and Open a RAR fileCreate and Open a RAR file How to create a RAR file How to open a RAR file RAR is an archive file format that is used during data compression, error recovery and file spanning. RAR is the acronym for Roshal Archive, inspired by the... en.kioskea.net/faq/sujet-143-create-and-open-a-rar-file
How to read and create a BIN and CUE file?How to read and create a BIN and CUE file? What is a BIN file? How to create BIN and CUE files How to burn BIN and CUE files How to read/convert BIN and CUE files What is a BIN file? A BIN and CUE file together create a binary... en.kioskea.net/faq/sujet-264-how-to-read-and-create-a-bin-and-cue-file

Résultats pour Batch file to determine latest file

DOS commands in a batch fileHello, I'm after a batch file that will press a button. I have used " rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl" to successfully display/access Internet Options. Now how to select the General tab ? [ set the focus to General Tab ?] and... en.kioskea.net/forum/affich-4105-dos-commands-in-a-batch-file
Batch file for one current date in text fileHello, I need a batch file to get the current date and time of my computer and put it in a text file every time I run it.But I need the most current date&time to replace the previous within the same text file, so that my file can have only one record,... en.kioskea.net/forum/affich-16514-batch-file-for-one-current-date-in-text-file

Résultats pour Batch file to determine latest file

Download Instant File Name SearchAlthough mode searches already exist on Windows, sometimes more definite tools for specific tasks are needed. Instant Name Search Goes off search files by name on your computer or on a network instantly. It supports the Boolean operators (AND,or,... en.kioskea.net/telecharger/telecharger-630-instant-file-name-search

Résultats pour Batch file to determine latest file

Operating systems - Files A file is a suite of binary information, i.e. a suite from 0 to 1. This file may be stored in order to keep a record of this information. A text file is a file comprising characters stored in the form of octets. This file is saved on the hard drive... en.kioskea.net/systemes/fichier.php3