Search found 146 matches

by trebor68
08 Aug 2011 04:26
Forum: DOS Batch Forum
Topic: Creating files with subfolders after reading from a list
Replies: 6
Views: 5773

Re: Creating files with subfolders after reading from a list

In the XP version is this possible with the command "MD" the complete path with one command.
MD drive:\folder1\folder2\folder3
Example:

Code: Select all

MD C:\Test\dos\picture\


If that not running please insert the command in the batch file:

Code: Select all

SETLOCAL ENABLEEXTENSIONS
by trebor68
06 Aug 2011 08:25
Forum: DOS Batch Forum
Topic: Creating files with subfolders after reading from a list
Replies: 6
Views: 5773

Re: Creating files with subfolders after reading from a list

Here the simple code to do that. @echo off for /f "tokens=*" %%f in (filelist.txt) do ( echo == %%f == if not exist "%%~dpf" md "%%~dpf" if not exist "%%~dpnxf%%" echo This is a test file.>>"%%~dpnxf" ) The file "filelist.txt" with the comp...
by trebor68
03 Aug 2011 01:21
Forum: DOS Batch Forum
Topic: DOS: Open Text File and have the Cursor @ the End of File
Replies: 2
Views: 3922

Re: DOS: Open Text File and have the Cursor @ the End of Fil

The code that you write will have two command in one row. command 1: start filename.txt command 2: goto :eof Command 1 will open the file filename.txt with the text editor (standard: notepad). Command 2 will go to the end of the batch (bat-file or cmd-file). The program notepad have not a option, th...
by trebor68
27 Jul 2011 05:48
Forum: DOS Batch Forum
Topic: Dos Script for Directory Timestamps
Replies: 2
Views: 3335

Re: Dos Script for Directory Timestamps

In the Example are two option of "/t". Only the last option will used the DIR command. option "/t:c" for timestamp "create" option "/t:a" for timestamp "last access" option "/t:w" for timestamp "last writing" When using the option...
by trebor68
26 Jul 2011 08:14
Forum: DOS Batch Forum
Topic: Save a list of files and subfolders
Replies: 2
Views: 3275

Re: Save a list of files and subfolders

If you only would have a list of the files use the following code: dir /s /b TEST\*.txt The option "/s" for any subfolder and the option "/b" only list the file name. In the Example is "TEST" a subfolder in this folder and "*.txt" the files. In your Example: D...
by trebor68
09 Jul 2011 15:50
Forum: DOS Batch Forum
Topic: Problem with delayed expansion of FOR /F options
Replies: 6
Views: 5714

Re: Problem with delayed expansion of FOR /F options

In the posting I can see that the parameter "eol" and "delims" will have the same character " " (space). With the parameter "delims" separated the tokens. The first signs are all delimeter, so can not match the first letter the parameter "eol". Pleas...
by trebor68
09 Jul 2011 07:49
Forum: DOS Batch Forum
Topic: DOSKEY
Replies: 16
Views: 16049

Re: DOSKEY

The only one thing that can DOSKEY is simulated the inputs from keyboard. With the following batch can you see that is not only can start command with DOSKEY. Start this file from the command line. step 1: Please start the batch and press only the key "Enter" when is comming the first inpu...
by trebor68
05 Jul 2011 14:49
Forum: DOS Batch Forum
Topic: DOSKEY
Replies: 16
Views: 16049

Re: DOSKEY

@ Cleptography The awnser to your question is following code: If you have saved the code from your question in the file "TEXT.TXT". DOSKEY /MACROFILE=TEST.TXT The same file as a pure batch file. @echo off rem I changed the file so that it is a pure batch file. :: goto end rem *************...
by trebor68
05 Jul 2011 04:15
Forum: DOS Batch Forum
Topic: DOSKEY
Replies: 16
Views: 16049

Re: DOSKEY

The macro that is definated with DOSKEY is only a command (or more). But here is the diffence between the macros and batch files. All macros can you definated in only one batch file. The same commands are can you also definated in different batch files with the name of the macro. You can display/sav...
by trebor68
05 Jul 2011 00:38
Forum: DOS Batch Forum
Topic: Calculator code wont work
Replies: 3
Views: 4080

Re: Calculator code wont work

In the code of BatMaster is definated only the variable "n1" for the input. But in the row with the calculation are the variable "1n" and "2n" that not definated. Here the correct code: @echo off SET INPUT= ECHO Make a choice SET /P n1=1st number: set /p sym=symbol(+*/-...
by trebor68
03 Jul 2011 00:51
Forum: DOS Batch Forum
Topic: Batch file command not working as hoped
Replies: 2
Views: 4025

Re: Batch file command not working as hoped

The info file 'info.txt' will have this following row (here in German environment): File date/time = 29.06.2011 / 12:36:41 I think that is in the English environment: File date/time = 29/06/2011 / 12:36:41 When you use the 'FOR' command with the value "delims=/" than are following value in...