Does TNSPING return different %errorlevel% values depending on whether it succeeded or failed?
Regards
aGerman
Search found 4506 matches
- 01 Sep 2011 11:40
- Forum: DOS Batch Forum
- Topic: Batch script with condition?
- Replies: 3
- Views: 4423
- 01 Sep 2011 11:28
- Forum: DOS Batch Forum
- Topic: Renaming multiple files within folder(s)
- Replies: 10
- Views: 7287
Re: Renaming multiple files within folder(s)
Is it always a combination of space|hyphen|space that separates the group from the song title? Can you make sure that this combination exists only once in a file name?
Regards
aGerman
Regards
aGerman
- 01 Sep 2011 11:18
- Forum: DOS Batch Forum
- Topic: Reading values from Windows registry
- Replies: 2
- Views: 3322
Re: Reading values from Windows registry
It's tricky since M$ removed the tab characters and replaced them by a few space characters in Vista and Win7. I checked this key on my Win7 machine and found that: - all data types are REG_EXPAND_SZ - the value names contain max. two words That code works for me @echo off &setlocal enabledelaye...
- 31 Aug 2011 10:37
- Forum: DOS Batch Forum
- Topic: how to copy a file in all of directory and subdirectories?
- Replies: 1
- Views: 2367
Re: how to copy a file in all of directory and subdirectorie
Try that:
Regards
aGerman
Code: Select all
for /f "delims=" %%a in ('dir /ad /b /s D:\') do copy "c:\file.txt" "%%a\"
Regards
aGerman
- 28 Aug 2011 17:46
- Forum: DOS Batch Forum
- Topic: Script directory url
- Replies: 4
- Views: 4314
Re: Script directory url
You're absolutely right, Dave. But ... there is a SHIFT command. Nothing protects you from a wrong result if you're doing the right things in wrong order
Regards
aGerman
Code: Select all
@echo off
:: some code
shift
echo %~dp0
pause
Regards
aGerman
- 28 Aug 2011 17:24
- Forum: DOS Batch Forum
- Topic: Words from a phrase into Variables
- Replies: 9
- Views: 11071
Re: Words from a phrase into Variables
It's because you didn't process the variables in the batch file (insert your ECHO commands into the batch code and it would work). Delete " &setlocal enableextensions" to preserve the variables for the calling command prompt. I'm virtually certain you're working with "enabled exte...
- 28 Aug 2011 15:47
- Forum: DOS Batch Forum
- Topic: Words from a phrase into Variables
- Replies: 9
- Views: 11071
Re: Words from a phrase into Variables
Everyone uses "for"... What else? It's the best way I can think. Anyway, where are the a and the b variables? Why a and b? If "phrase" has mor than 26 words you can't handle it. !k used %word#0%, %word#1%, ... instead. In %word% you can find the number of words. If your "ph...
- 25 Aug 2011 14:20
- Forum: DOS Batch Forum
- Topic: how to save value of a data in regedit in a variable?
- Replies: 3
- Views: 3736
Re: how to save value of a data in regedit in a variable?
Try that:
Regards
aGerman
Code: Select all
@echo off &setlocal
for /f "tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Eset\ESET Security\CurrentVersion\Info" /v "InstallDir"') do set "data=%%b"
echo %data%
pause
Regards
aGerman
- 25 Aug 2011 13:23
- Forum: DOS Batch Forum
- Topic: how to save value of a data in regedit in a variable?
- Replies: 3
- Views: 3736
Re: how to save value of a data in regedit in a variable?
What is the name of the value where you want to save the data (or is it the "no name" default value which exists in each key)?
Regards
aGerman
Regards
aGerman
- 25 Aug 2011 13:16
- Forum: DOS Batch Forum
- Topic: I can't figure it out
- Replies: 1
- Views: 2474
Re: I can't figure it out
Not sure, but try something like that: @echo off &setlocal for /l %%a in (0) do ( for /f %%b in ('dir /a-d /b *.zip 2^>nul') do call :processZip "%%b" ) :processZip echo Do something with %~1 goto :eof for /l %%a in (0) do (... results in an infinite loop. Regards aGerman
- 21 Aug 2011 12:40
- Forum: DOS Batch Forum
- Topic: Batch file in which is almost everything you need
- Replies: 3
- Views: 3077
Re: Batch file in which is almost everything you need
Don't get me wrong, it was only the way how you shared your code (enclosed into an installer container, need to download another file to get access, calling of a few websites etc.). More than enough stuff to remove your link... If you want help feel free to post your source code (enclosed in code ta...
- 21 Aug 2011 09:29
- Forum: DOS Batch Forum
- Topic: Batch file in which is almost everything you need
- Replies: 3
- Views: 3077
Re: Batch file in which is almost everything you need
I removed the link above. I would never execute an exe file where nobody knows what it does (except in a sand box). How ever, I had a look at the source code behind the exe file (btw. everybody is able to find it while the exe is running, just look into the %temp% folder ...). I found a horrible &qu...
- 21 Aug 2011 09:11
- Forum: DOS Batch Forum
- Topic: RockPaperScissors *UPDATE*
- Replies: 9
- Views: 9375
Re: RockPaperScissors *UPDATE*
First of all delete hiscore.rps. If it exists the default values are not written. Write ECHO redirections in an opposite style. ECHO 0>hiscore.rps tries to redirect the stdIn stream into your file which will fail. Use >hiscore.rps ECHO 0 instead. Also you mistook some variable names, you appended th...
- 19 Aug 2011 16:13
- Forum: DOS Batch Forum
- Topic: A Lottery Batch file
- Replies: 4
- Views: 5968
Re: A Lottery Batch file
Hi BatMaster,
for some reason polls don't work in this forum. I'm going to ask the forum owner why.
Writing a lottery code is an old exercise but a good exercise for learning comparisons.
Regards
aGerman
for some reason polls don't work in this forum. I'm going to ask the forum owner why.
Writing a lottery code is an old exercise but a good exercise for learning comparisons.
Regards
aGerman
- 17 Aug 2011 13:46
- Forum: DOS Batch Forum
- Topic: New technic: set /p can read multiple lines from a file
- Replies: 37
- Views: 60549
Re: New technic: set /p can read multiple lines from a file
Yeah, that would be interesting. I didn't test the speed because I'm virtually certain my result would be completely different (CPU, RAM ...).
Regards
aGerman
Regards
aGerman