Search found 4506 matches

by aGerman
28 Feb 2010 18:10
Forum: DOS Batch Forum
Topic: How to make a BAT to edit a string inside a test file?
Replies: 3
Views: 5571

Re: How to make a BAT to edit a string inside a test file?

You could try beginning your code with

Code: Select all

@echo off &setlocal ENABLEEXTENSIONS

also for your other thread.
But surely you need cmd.exe and afaik it's available on Win NT and higher versions.

Regards
aGerman
by aGerman
28 Feb 2010 16:20
Forum: DOS Batch Forum
Topic: Need help writing a batch file for mencoder
Replies: 3
Views: 5707

Re: Need help writing a batch file for mencoder

No idea. Maybe could be something like that: @echo off &setlocal set "root=%~dp0" for /f "delims=" %%a in ('dir /a-d /b /s "*.mpg"') do set "fullname=%%a" &set "filepath=%%~dpa" &set "ext=%%~xa" &call :process echo finished ...
by aGerman
28 Feb 2010 15:52
Forum: DOS Batch Forum
Topic: Struggling with variables
Replies: 3
Views: 5211

Re: Struggling with variables

Try this line:

CALL SET "SITEURL=%%URL%SITETOADD%%%"

Regards
aGerman
by aGerman
28 Feb 2010 15:38
Forum: DOS Batch Forum
Topic: neep help with call command within the batch file
Replies: 4
Views: 6069

Re: neep help with call command within the batch file

Your bat2.bat could contain something like that:

Code: Select all

@echo off
if not "%~1"=="" goto %~1
...
:starthere
...



The call in bat1.bat could be:

Code: Select all

@echo off
...
call bat2.bat starthere
...


Regards
aGerman
by aGerman
28 Feb 2010 15:09
Forum: DOS Batch Forum
Topic: How to make a BAT to edit a string inside a test file?
Replies: 3
Views: 5571

Re: How to make a BAT to edit a string inside a test file?

@echo off &setlocal set file=test.txt set replacevar=%%editme%% type nul>"temp.txt" for /f "delims=: tokens=1*" %%a in ('findstr /n /r /c:"^" "%file%"') do set "line=%%b" &call :process move "temp.txt" "%file%" goto :eof ...
by aGerman
26 Feb 2010 07:02
Forum: DOS Batch Forum
Topic: Just for fun - cmd animation
Replies: 3
Views: 24853

Re: Just for fun - cmd animation

You need a 3rd party app. You could write your own VBScript using batch. @echo off &setlocal :: write the script set "sleep=%temp%\sleep.vbs" >%sleep% echo WScript.Sleep WScript.Arguments(0) echo START :: call the script with milli seconds as the parameter %sleep% 200 echo END pause No...
by aGerman
26 Feb 2010 06:45
Forum: DOS Batch Forum
Topic: Need help writing a batch file for mencoder
Replies: 3
Views: 5707

Re: Need help writing a batch file for mencoder

I don't know how mencoder works (btw. have no time to figure out). This short code shows you how to find the files and how to create the new name. I'm sure you are able to replace the ECHO-part with the mencoder line the right way. @echo off &setlocal set "root=%~dp0" for /f "deli...
by aGerman
25 Feb 2010 14:24
Forum: DOS Batch Forum
Topic: parameters from txt file ?
Replies: 1
Views: 3243

Re: parameters from txt file ?

You could try this:

Code: Select all

@echo off
set /p var=<plik.txt
call set var=%var%
echo %var%


Regards
aGerman
by aGerman
23 Feb 2010 13:00
Forum: DOS Batch Forum
Topic: Determine Windows Version a batch file is running within?
Replies: 2
Views: 4549

Re: Determine Windows Version a batch file is running within?

This should work: @echo off &setlocal REM if older than XP then reg.exe is unknown if exist "%SystemRoot%\system32\reg.exe" ( REM read the "ProductName" key for /f "tokens=3 delims= " %%a in ('reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /...
by aGerman
20 Feb 2010 21:41
Forum: DOS Batch Forum
Topic: For /f command help
Replies: 2
Views: 4392

Re: For /f command help

One of this 2 lines should work for you:

Code: Select all

for /f "usebackq delims=" %%a in ("%userprofile%\Desktop\whatever.ini") do %%a
for /f "usebackq delims=" %%a in ("%userprofile%\Desktop\whatever.ini") do "%%a"
by aGerman
13 Feb 2010 07:36
Forum: DOS Batch Forum
Topic: On Exit Do Command
Replies: 18
Views: 18340

Re: On Exit Do Command

But still with some more research . . .! No way using native batch. 1)Bist du auf deutchland? Ja, ich bin aus Deutschland ... ... that's not a secret. Have a look (to my username and) the location line under my username. 2)Come to a good forum i am visiting ... If I would find some interesting post...
by aGerman
12 Feb 2010 17:40
Forum: DOS Batch Forum
Topic: On Exit Do Command
Replies: 18
Views: 18340

Re: On Exit Do Command

This beep is a warning of the choice command. Because only the keys behind the /C: switch are allowed.

But you are able to generate a beep using the echo command with ASCII character 07.
copy/paste:

Code: Select all

@echo off
:beep
cls
echo 
ping -n 2 localhost>nul
goto beep


Regards
aGerman
by aGerman
12 Feb 2010 16:26
Forum: DOS Batch Forum
Topic: On Exit Do Command
Replies: 18
Views: 18340

Re: On Exit Do Command

BAT Beginner wrote:But i was wondering, how to you make sounds like you did with the keyboard batch?

I'm wondering why you can hear a sound :?:
by aGerman
12 Feb 2010 13:14
Forum: DOS Batch Forum
Topic: On Exit Do Command
Replies: 18
Views: 18340

Re: On Exit Do Command

Stergioss you're a joker Okay, I've got it to work: @echo off TITLE Keyboard Simulator MODE CON cols=41 lines=6 set ERRL=0 :a SET q1= SET q2= SET w1= SET w2= SET e1= SET e2= SET r1= SET r2= SET t1= SET t2= SET y1= SET y2= SET u1= SET u2= SET i1= SET i2= SET o1= SET o2= SET p1= SET p2= SET a1= SET a...