Search found 10 matches

by dizze
06 Jun 2008 07:48
Forum: DOS Batch Forum
Topic: Put date in filename
Replies: 1
Views: 4049

hey,

Something like:

Code: Select all

@echo off
for /f "tokens=1,2,3 delims=/" %%a in ('echo %date%') do set foo=%%c %%b %%a
for %%a in (*.*) do ren "%%a" "%foo% - %%a"


Would append the date to the start of all files in the dir it is executed in.
by dizze
05 Jun 2008 08:36
Forum: DOS Batch Forum
Topic: Can I minimize a batch window from inside the batch file?
Replies: 3
Views: 10522

you can use

Code: Select all

start /min cmd /c your-batch-file.bat


to run your batch file minimised.

Dizz-E
by dizze
05 Jun 2008 08:31
Forum: DOS Batch Forum
Topic: Check if key exists
Replies: 2
Views: 4767

Hi,

If you want to hide all the output from your first example do:

Code: Select all

reg query HKEY_CLASSES_ROOT\.php 1>nul 2>nul
if errorlevel 1 echo not found


1> redirects stdout
2> redirects stderr which is what the output of reg is in this case.

Dizz-E
by dizze
14 Nov 2006 10:16
Forum: DOS Batch Forum
Topic: incrementing within a loop
Replies: 7
Views: 10187

oops, obvious typo

set FILEID=0
set /a FILEID=%FILEID% + 1

DOH!
by dizze
14 Nov 2006 09:38
Forum: DOS Batch Forum
Topic: incrementing within a loop
Replies: 7
Views: 10187

Yes,

but the command to execute would be:

set /a %FILEID%=%FILEID% + 1
by dizze
14 Nov 2006 06:18
Forum: DOS Batch Forum
Topic: forking commands
Replies: 6
Views: 14077

I would use seperate files for the report on each server, then type them all into one once they have all finished executing. To use the example: ==Multi.bat== @echo off del results.txt for /f "tokens=1 skip=3 delims=\ " %%a in ('net view') do (start d:\temp\foo.bat %%a) type *.output >>results.txt =...
by dizze
14 Nov 2006 05:46
Forum: DOS Batch Forum
Topic: forking commands
Replies: 6
Views: 14077

More or less yes. Something like the following would work: ==Multi.bat== @echo off for /f "tokens=1 skip=3 delims=\ " %%a in ('net view') do (start d:\temp\foo.bat %%a) ==End Multi.bat== ==foo.bat== echo this is %1 >%1.txt exit ==end foo.bat== Note: 1) Use start rather than call. 2) Specify the full...
by dizze
17 Jul 2006 09:39
Forum: DOS Batch Forum
Topic: double expansion of variables
Replies: 2
Views: 7046

Sucess!

Thanks DosItHelp :D ,

That works perfectly, i can now get rid of my tempory file hack.

Dizz-E
by dizze
12 Jul 2006 07:54
Forum: DOS Batch Forum
Topic: double expansion of variables
Replies: 2
Views: 7046

double expansion of variables

Hello, Is it possible to echo the value of a variable when the name of the variable is itself a variable. I have (stripping other nonsence) :loop set cols=0 set /a c%cols%=%random% set /a cols=%cols%+1 if cols==10 (goto :wherever) else (goto :loop) And i want to be able to echo whatever %random% is ...