Search found 3577 matches

by aGerman
01 Mar 2010 08:41
Forum: DOS Batch Forum
Topic: neep help with call command within the batch file
Replies: 4
Views: 2641

Re: neep help with call command within the batch file

Have you saved the first code as bat2.bat in the same folder as bat1.bat? What's your OS? Try without the CALL command (only bat2.bat starthere).
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: 2505

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: 2851

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: 2377

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: 2641

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: 2505

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: 5996

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: 2851

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: 1508

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: 2126

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: 2129

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: 6981

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: 6981

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: 6981

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 :?: