Search found 6 matches

by ralfs_k
09 Mar 2012 05:35
Forum: DOS Batch Forum
Topic: batch write file name in file
Replies: 8
Views: 9318

Re: batch write file name in file

tested and working!
by ralfs_k
08 Mar 2012 05:02
Forum: DOS Batch Forum
Topic: batch write file name in file
Replies: 8
Views: 9318

Re: batch write file name in file

foxidrive tnx

Code: Select all

@echo off
for /f "delims=" %%G in ('dir /b "*.txt"') do echo %%~nG>>"%%G"

works great but how to add that line at the top of file not end?
by ralfs_k
07 Mar 2012 11:53
Forum: DOS Batch Forum
Topic: batch write file name in file
Replies: 8
Views: 9318

batch write file name in file

i have ~20000 files with different names how do i echo file name inside a file?
for example if file is called 10008992.txt then is should contain text 10008992 and so on...
any ideas?
by ralfs_k
04 Mar 2012 11:52
Forum: DOS Batch Forum
Topic: batch to restart pc using TASKKILL and SHUTDOWN
Replies: 3
Views: 4233

Re: batch to restart pc using TASKKILL and SHUTDOWN

not sure on what os you use it but in windows 7 alt+u does nothing for me... anyway is there a way to kill all processes but not batch itself? assigned title to batch file using TITLE KILLALL then taskkill /F /FI "USERNAME eq testuser" /FI "WINDOWTITLE ne KILLALL" /FI "IMAGE...
by ralfs_k
04 Mar 2012 11:15
Forum: DOS Batch Forum
Topic: batch to restart pc using TASKKILL and SHUTDOWN
Replies: 3
Views: 4233

batch to restart pc using TASKKILL and SHUTDOWN

hi i need to restart pc realy fast using batch any ides? i tried this taskkill /F /FI "USERNAME eq testuser" shutdown /f /r -t 00 but shutdown doesn't work after all tasks are killed any ides? I tried also: taskkill /F /FI "USERNAME eq testuser" /IF "IMAGENAME ne cmd.exe&quo...
by ralfs_k
24 Feb 2012 04:23
Forum: DOS Batch Forum
Topic: problems with FINDSTR in multiline search
Replies: 4
Views: 6468

problems with FINDSTR in multiline search

hi I need to create batch file that searches in text file following string: 012345; ; ; ; but this doesn't work! setlocal set LF=^ setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in ('dir/b *.txt') do ( findstr /r /i "[0-9]*!LF!;!LF!;!LF!;!LF!;" < %%a > nul if not ...