Search found 3287 matches

by aGerman
10 Dec 2018 11:34
Forum: DOS Batch Forum
Topic: How to pass Yes automatically in a batch script?
Replies: 3
Views: 41

Re: How to pass Yes automatically in a batch script?

That's a typical XY question. You don't need to pass Yes but you have to pass /Q as the help for DEL states.

Steffen
by aGerman
09 Dec 2018 11:15
Forum: DOS Batch Forum
Topic: Burn ISO to USB command
Replies: 4
Views: 33

Re: Burn ISO to USB command

As to what I've read in the internet, beginning with Windows 7 isoburn.exe is on board.

Code: Select all

isoburn /Q D: "C:\somewhere\foo.iso"
... where D: represents the drive to burn the image. Not sure what requirements your USB drive has to meet though.

Steffen
by aGerman
08 Dec 2018 10:59
Forum: DOS Batch Forum
Topic: Complicated batch file... at least for me. Help Needed
Replies: 1
Views: 47

Re: Complicated batch file... at least for me. Help Needed

Code: Select all

for /f "delims=" %%i in ('dir /ad /b /s "reports"') do copy "%%i\*.*" ".\"
Just a guess though.

Steffen
by aGerman
08 Dec 2018 10:47
Forum: DOS Batch Forum
Topic: A new tool to save and restore the console font
Replies: 1
Views: 70

Re: A new tool to save and restore the console font

That's neat, Jean-François :) Any help at finding a reliable way to get available font sizes for all versions of Windows is welcome! I don't care about old Windows versions anymore. But I think the only way to work around is a code switch depending on the current Windows version. Two functions that ...
by aGerman
04 Dec 2018 12:47
Forum: DOS Batch Forum
Topic: Remove characters from text file
Replies: 4
Views: 87

Re: Remove characters from text file

Your task should still work with pure Batch as long as the line lengths don't exceed 1021 characters. @echo off &setlocal set "txt=test.txt" setlocal EnableDelayedExpansion <"!txt!" >"!txt!.~tmp" ( for /f %%i in ('type "!txt!"^|find /c /v ""') do for /l %%j in (1 1 %%i) do ( set "ln=" &set /p "ln=" ...
by aGerman
04 Dec 2018 12:44
Forum: DOS Batch Forum
Topic: Script Uninstall via MSIEXEC by ProductCode
Replies: 2
Views: 51

Re: Script Uninstall via MSIEXEC by ProductCode

Try that: @echo off &setlocal for /f "delims=" %%i in ('2^>nul wmic product where "name='ASUS GiftBox Serviceq'" get IdentifyingNumber /value') do for /f "tokens=2 delims==" %%j in ("%%i") do ( MSIEXEC /x %%j /qb REBOOT="ReallySuppress" PASSWORD=password123 ) Unlike your crossposting which is tagged...
by aGerman
28 Nov 2018 15:32
Forum: DOS Batch Forum
Topic: How to create an UTF-8 file (instead of UCS-2 Little Endian)?
Replies: 3
Views: 80

Re: How to create an UTF-8 file (instead of UCS-2 Little Endian)?

I'm absolutely sure we have several threads with examples of how to write the BOM. Everyone has the possibility to search for UTF-8 in the forum. Nevermind. @echo off >nul chcp 1252 set "x=åéøü" <nul >"utf8test.txt" set /p "=" >nul chcp 65001 >>"utf8test.txt" echo %x% Still dependent on the encod...
by aGerman
28 Nov 2018 11:37
Forum: DOS Batch Forum
Topic: License
Replies: 2
Views: 67

Re: License

This is called "Public Domain".

Steffen
by aGerman
28 Nov 2018 11:34
Forum: DOS Batch Forum
Topic: How to create an UTF-8 file (instead of UCS-2 Little Endian)?
Replies: 3
Views: 80

Re: How to create an UTF-8 file (instead of UCS-2 Little Endian)?

then myfile.txt will always be created as UCS-2 Little Endian based file Serioulsly? I can't believe that. It's definitely not the default behavior. How can I tell the DOS batch execution to create an UTF-8 file instead? The Windows has kind of UTF-8 support. It's rather bad though. @echo off >nul ...
by aGerman
27 Nov 2018 14:07
Forum: DOS Batch Forum
Topic: How to export your public IP address to a text file?
Replies: 13
Views: 1822

Re: How to export your public IP address to a text file?

Does it require to have Java installed though? No. JScript is the Microsoft implementation of ECMAScript (commonly known as its MIME type JavaScript). On Windows it works also as stand-alone in the WSH runtime environment. Neither of them has anything to do with Java (which is a programming languag...
by aGerman
20 Nov 2018 11:27
Forum: DOS Batch Forum
Topic: How To Concatenate a String/Character
Replies: 3
Views: 81

Re: How To Concatenate a String/Character

Oh I forgot. But note that FOR variables are case sensitive. %i ist not the same as %I.

Steffen
by aGerman
20 Nov 2018 11:25
Forum: DOS Batch Forum
Topic: FOR Loop using Variable in Array Name
Replies: 2
Views: 82

Re: FOR Loop using Variable in Array Name

You're trying to expand variables %IMAGELIST_PERSON_% and %G%. That's the reason why it doesn't work. Turn on delayed variable expansion. @echo off &setlocal SET IMAGELISTE_PERSON_1=1 3 5 SET IMAGELISTE_PERSON_2=1 2 4 setlocal EnableDelayedExpansion FOR /L %%G IN (1,1,2) DO ( FOR %%A IN (!IMAGELISTE...
by aGerman
20 Nov 2018 11:10
Forum: DOS Batch Forum
Topic: Post-Backup Batch File to Rename Backup FIles
Replies: 1
Views: 42

Re: Post-Backup Batch File to Rename Backup FIles

Code: Select all

if exist "Archive*.tib" (
  REM rename ...
)
Note that you have to prepare your hr variable beforehand.

Steffen
by aGerman
20 Nov 2018 11:02
Forum: DOS Batch Forum
Topic: How To Concatenate a String/Character
Replies: 3
Views: 81

Re: How To Concatenate a String/Character

Code: Select all

(for /f "delims=" %i in ('dir *.* /s /b /a-d') do @echo %i)>"warren.sql"
Double the percent signs (%i to %%i) if you want to use it in a Batch script.

Steffen
by aGerman
20 Nov 2018 10:57
Forum: DOS Batch Forum
Topic: Problems with variables ...
Replies: 4
Views: 115

Re: Problems with variables ...

Try

Code: Select all

call set "csvchoice_ini=%%f"
Steffen