Search found 560 matches

by miskox
02 Aug 2010 06:58
Forum: DOS Batch Forum
Topic: Need help with a Script
Replies: 1
Views: 3089

Re: Need help with a Script

Code: Select all

if "%a%"=="1" goto Background
if "%a%"=="2" goto Script
if "%a%"=="3" goto Quit


Saso
by miskox
02 Aug 2010 06:55
Forum: DOS Batch Forum
Topic: Get only first row for each file
Replies: 10
Views: 13907

Re: Get only first row for each file

@echo off set /a tmpmatch=0 for /f "delims=" %%i in (a.a) do call :0 "%%i" echo.%outstr% goto :EOF :0 if "%tmpmatch%"=="0" set "outstr=%~1" && set /a tmpmatch=1 goto :EOF File a.a is your input .txt file. Line echo.%outstr% displays a string...
by miskox
30 Jul 2010 13:01
Forum: DOS Batch Forum
Topic: Opening a file in a different folder
Replies: 16
Views: 13714

Re: Opening a file in a different folder

I would suggest you do this: echo on pushd bin if /i "%classname%"=="BeerSong" ( >"%dp~0%classname%.txt" 2>&1 java %classname% start "" "%dp~0%classname%.txt" pause ) else ( java %classname% pause ) popd pause This should wait everywhere. And whe...
by miskox
30 Jul 2010 07:52
Forum: DOS Batch Forum
Topic: Removing quotes...
Replies: 12
Views: 11375

Re: Removing quotes...

Thanks, aGerman.

I used this:

Code: Select all

set "y=%~1"


This does exactly what I want.

Thanks again.
Saso
by miskox
26 Jul 2010 05:57
Forum: DOS Batch Forum
Topic: In line command (Processus startup postponed)
Replies: 3
Views: 4805

Re: In line command (Processus startup postponed)

Code: Select all

@sleep 60 && D:\PM10\DEBUG\START D:\PM10\DEBUG\CEMeasAvg.exe 127.0.0.1 D:\PM10\Ce_LHC8.txt


Is this it?

Saso
by miskox
26 Jul 2010 04:35
Forum: DOS Batch Forum
Topic: [TIP] Checking for open/locked files.
Replies: 0
Views: 4315

[TIP] Checking for open/locked files.

I was reading this http://www.dostips.com/DtTipsXCopy.php and there is something about locked files.

Another method which I am using is a move command:

Code: Select all

move /y a.a a.a >nul 2>nul


returns ERRORLEVEL 1 if file is locked, 0 if not locked.

Saso
by miskox
26 Jul 2010 04:32
Forum: DOS Batch Forum
Topic: Removing quotes...
Replies: 12
Views: 11375

Removing quotes...

I have a string:

Code: Select all

set tmpstring="String with ^^ character"


Question: how to remove quotes but ^^ should remain there. If I use %~ then one ^ gets removed.

Thanks,
Saso
by miskox
26 Jul 2010 04:27
Forum: DOS Batch Forum
Topic: echo <FF> (to screen or a file)
Replies: 7
Views: 8591

Re: echo <FF> (to screen or a file)

Thanks Jeb. I did check that - but I admit - too complex for me. For now there is no solution.
This problem does not have a highest priority at the moment.

Thanks,
Saso
by miskox
26 Jul 2010 04:26
Forum: DOS Batch Forum
Topic: I want to create a batch file (.bat) that changes [file name
Replies: 4
Views: 6080

Re: I want to create a batch file (.bat) that changes [file

I agree with phillid.

aGerman was not doing anything wrong. He just warns against the 'file locked' conflict.

Saso
by miskox
22 Jul 2010 07:59
Forum: DOS Batch Forum
Topic: echo <FF> (to screen or a file)
Replies: 7
Views: 8591

echo <FF> (to screen or a file)

Hi all, I would like to echo a FORMFEED control code to a screen (or a file). echo X* causes me problems because NOTEPAD does not like x0C (wants to save a file in Unicode). If I save it as ANSI I get a plus (+) sign. * replace X with an ALT+12 on the numeric keypad so you get a FORMFEED control cod...
by miskox
19 Jul 2010 03:19
Forum: DOS Batch Forum
Topic: Randomly generated file names
Replies: 4
Views: 5332

Re: Randomly generated file names

Replace

Code: Select all

set "oldname=<oldname.txt"


with

Code: Select all

FOR /F %%i IN (oldname.txt) DO set oldname=%%i


Saso
by miskox
12 Jul 2010 06:34
Forum: DOS Batch Forum
Topic: Detecting same file size and deleting
Replies: 6
Views: 6445

Re: Detecting same file size and deleting

I would suggest using fc /b file1 file2 >nul 2>nul for this. I have a batch file for finding .pdf files from different (sub)folders and I compare them with .pdf files that are located in ONE folder only. But files in (sub)folders have different filenames than the one in ONE folder. I make a list of ...
by miskox
01 Jul 2010 01:08
Forum: DOS Batch Forum
Topic: How to pickup null value in variable
Replies: 3
Views: 4879

Re: How to pickup null value in variable

aGerman always supplies complete answers. Maybe in one line you need this:

Code: Select all

if "%input%"=="" echo Empty string entered.


Hope this helps.

Saso
by miskox
30 Jun 2010 00:36
Forum: DOS Batch Forum
Topic: BEWARE OF SPAM
Replies: 3
Views: 4932

Re: BEWARE OF SPAM

I hope Admin will do something about this. Phpbb forums are easy to hack (according to google searches).

The problem is that it is very easy to steal passwords from all of us.

It is never good to read such posts.

Saso
by miskox
29 Jun 2010 15:32
Forum: DOS Batch Forum
Topic: BEWARE OF SPAM
Replies: 3
Views: 4932

BEWARE OF SPAM

As you can see this forum got hacked (see user ReteddyOdor).

Admin, please take appropriate actions.

Saso