Tags "file" Result

Set file association from batch file

I want to set file association from a batch file. I want to associate .pdf files with foxitreader. The thing is I have the foxitreader portable edition so it doesn not have any registry key. I have searched but there is no clean explanation of how to do and what syntaxes to use. Solution Using batch, use the following commands: ftype Foxit.Docume

it1352 1 2019-05-09

Rename all files in folder to uppercase with batch

Is there a way to rename all files in a specific folder to uppercase with batch file? I found this code. But it renames files to lowercase. How to modify it to rename to uppercase instead? for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f") Solution @echo off setlocal enableDelayedExpansion pushd c:\some_dir for %%f in (*) do ( s

it1352 0 2019-05-17

File Type - Get Original Extension

How to find file extension if the file has been renamed? Is there any tool are available for this? Example: I have a file "1.doc"; I hope everybody know this is a Word document I just renamed as "1.txt". But the file is a Word document originally; how can I get the original file extension? Solution Of Course You can :) This is the C# code for yo

it1352 2 2019-05-17

How to compare date in Batch script

I have a text file which contains a date (the format would be like 1/1/2015 or 01/01/2015... both formats are acceptable). Now I have to write a batch script which will compare dates. It has to show that the dates 1/1/2015 and 01/01/2015 are the same. How can I do this? Solution This is likely not the most elegant way, but in the interest of g

it1352 2 2020-09-20

Batch files: How to read a file?

How you can read a file (text or binary) from a batch file? There is a way to read it in a binary mode or text mode? Solution You can use the for command: FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do @echo %i %j %k Type for /? at the command prompt. Also, you can parse ini files!

it1352 3 2019-05-17

Batch File to Delete File

Can someone please help me to make a batch file to delete files beginning with the name Stock Level which are .csv files stored in C:\Windows\Temp folder. I would like to test it first to see what it proposes to delete before I make it live so if someone can show may what I need to delete to make it live as well. Thanks very much in advance for y

it1352 1 2020-09-20

Batch: Remove file extension

I have the following batch script from Wikipedia: @echo off for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do ( echo %%f ) pause In the for-loop all files with the extension flv get echoed, but I want the make some actions with the file(s) where I need one time the file without the extension and one time with the extension. How could I ge

it1352 3 2019-05-17

FOR /R - Using set /a [variable] = [variable] %%~zA

I've got a command to loop and set the file size of each file with a specific extension under a directory and all subdirectories: FOR /R "C:\Users" %%G IN (*.*) do set /a size = %size% %%~zG I would like the command to use the %size% %%!zG when looping, but when I run the batch file, the output constantly has "%size%" set to 0. I want to hav

it1352 1 2019-05-09

batch file: list rar file in specific folder and write result into text file

I have a folder and contains some rar files and subfolders. These subfolders contain rar file or subfolder (recursive structure). I want to write a batch file that list all the rar files in this folder tree (full path). The result is written into a text file. Example: Specific folder: --Quest --Quest--1.rar --Quest--2.rar --Quest--Sub--3.rar --Q

it1352 3 2019-05-09

Batch: Remove file extension

I have the following batch script from Wikipedia: @echo off for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do ( echo %%f ) pause In the for-loop all files with the extension flv get echoed, but I want the make some actions with the file(s) where I need one time the file without the extension and one time with the extension. How could I ge

it1352 4 2019-05-09