Search found 951 matches

by jeb
22 Apr 2010 10:51
Forum: DOS Batch Forum
Topic: Help
Replies: 8
Views: 4038

Re: Help

Hi,

as I wrote, your code will always fail

Code: Select all

  If %b%==%0% (
    Goto Loop
  )
  If %b%==%1% (
    Goto Loop
  )
  If %b%==%2% (
    Goto Loop
  )


You should try to debug it with some echo lines, like
echo %b% == %0%
to see why it will fail


jeb
by jeb
22 Apr 2010 00:03
Forum: DOS Batch Forum
Topic: Help
Replies: 8
Views: 4038

Re: Help

Hi 1+2=46, If %b%==%0% will always fail, because it expands to if ==counter.bat Because at first %b% is empty, %0 expands to the name of your batch file and the second % will be ignored. I suppose that is not exactly what you want You should use some echo's for debugging, than you can find this type...
by jeb
20 Apr 2010 09:45
Forum: DOS Batch Forum
Topic: !!!Question about BAT file
Replies: 5
Views: 2888

Re: Question about BAT file

Hi Pifukas, try to add some "pause" commands for debugging, best on each line. echo #1 pause cd /d C:\Progra~1\samba echo #2 pause cygsetup.cmd echo #2 pause start_daemons.cmd echo #2 pause And if you want to use other batch/cmd files in a batch, try to call them like cd /d C:\Progra~1\sam...
by jeb
19 Apr 2010 22:14
Forum: DOS Batch Forum
Topic: I Need This Working A Batch Spelling
Replies: 1
Views: 1569

Re: I Need This Working A Batch Spelling

Hi NiceNickeyBoot, I suppose the problem is the line if %Spell%==%spellingw%%play% goto SpellingALL This expands to (if you type "OK") if OK==1 goto SpellingALL because %spellingw% expands to nothing You should try this if "%Spell%"=="!spellingw%play%!" goto :SpellingAL...
by jeb
12 Apr 2010 04:17
Forum: DOS Batch Forum
Topic: echo %something% >> name.bat becomes blank space
Replies: 2
Views: 1995

Re: echo %something% >> name.bat becomes blank space

hi aseventhmindset, echo if %command%==Hide goto :Hide >> "%homedrive%\Documents and Settings\%username%\desktop\File Hider\FileHider.cmd" Will result to FileHider.cmd if ==Hide goto :Hide You should change it to echo if %%command%%==Hide goto :Hide >> "%homedrive%\Documents and Setti...
by jeb
12 Apr 2010 03:17
Forum: DOS Batch Forum
Topic: Batch file with for loop to run SQL SERVER DTS Package
Replies: 2
Views: 1764

Re: Batch file with for loop to run SQL SERVER DTS Package

Hi sauce1979, first of all your syntax seems to be invalid, because if you want to use the for-loop the "DO" have to be on the same line and the statement also or the block of statements have to begin on that line. set "myGuid={81FE4AE5-D2CC-47E6-B78C-9309CF4DDFB9}" set "myL...
by jeb
12 Apr 2010 02:22
Forum: DOS Batch Forum
Topic: Multiple FOR LOOP
Replies: 4
Views: 2406

Re: Multiple FOR LOOP

Hi six1zero, there are no return's ( goto :eof) at the end of your functions. @echo off REM -- Prepare the Command Processor -- SETLOCAL ENABLEEXTENSIONS SETLOCAL DISABLEDELAYEDEXPANSION SET ELS_DRIVE=%ELSHOMEDIRECTORY%\Test SET SPOOLTV=%ELS_DRIVE%\SpoolTV SET MATHRES=%ELS_DRIVE%\MathRes SET FILE_IO...
by jeb
10 Apr 2010 05:30
Forum: DOS Batch Forum
Topic: Counter
Replies: 10
Views: 4089

Re: Counter

Hi ---saster---, a simple loop and when it change the counter increases by one Yes this works, but ... It uses 100% CPU time (one single CPU). Therefore you should call ping (or something that wait for a while) @echo off set seg=0 :a set "var=%time:~6,2%" set "b=%var%" :b set var...
by jeb
09 Apr 2010 15:41
Forum: DOS Batch Forum
Topic: Counter
Replies: 10
Views: 4089

Re: Counter

hi 1+2=46, I dont have an idea, why your counter stop, but do you try to cancel it with CTRL-C? Do you know how can I make the seconds 100% exactly? I already tried use milliseconds, but it still isn't 100% exact. I suppose, you can not achieve it with the ping command only, but with the %time% and ...
by jeb
09 Apr 2010 13:11
Forum: DOS Batch Forum
Topic: copy most recent file to remote pc and clean up old files.
Replies: 3
Views: 3320

Re: copy most recent file to remote pc and clean up old file

Hi bobby999, I have not a solution, only some ideas. can i just map the drive of the remote server for it to work? This can be complicated, because network drives (with letter) does exists under the account, not for the machine. Can i use Xcopy? I assume not, try to use "dir" with order th...
by jeb
09 Apr 2010 12:36
Forum: DOS Batch Forum
Topic: Multiple FOR LOOP
Replies: 4
Views: 2406

Re: Multiple FOR LOOP

Hi six1zero, I suppose the problem is, that your first for-loop never call the :FILE_IOP, the :FILE_IOP is reached directly. You should add some goto :eof for %%i in (%FILE_IOP%*%FILE_SUFFIX%) do ( echo calling FILE_IOP CALL :FILE_IOP %%i ) goto :eof :FILE_IOP ... goto :eof jeb
by jeb
09 Apr 2010 11:59
Forum: DOS Batch Forum
Topic: Counter
Replies: 10
Views: 4089

Re: Counter

Hi %~"1+2=46"%,

look at "Convert decimal to hex, and bytes to chars", http://www.dostips.com/forum/viewtopic.php?f=3&t=951

Then you can use

Code: Select all

call :byteList2string bell 7
echo %bell%


jeb
by jeb
09 Apr 2010 11:56
Forum: DOS Batch Forum
Topic: Convert decimal to hex, and bytes to chars
Replies: 3
Views: 5404

Convert decimal to hex, and bytes to chars

Hi, for those who are interested. Three functions (perhaps anyone find it usefull). :dec2hex <hexResult> <decimalValue> <minimumDigits> :byteList2string <resultChar> <byte-1> [<byte-2> ...<byte-n>] :NormalizeVariable <varName> :dec2hex Converts a number to hex call :dec2hex hexResult 4079 4 echo 0x%...
by jeb
09 Apr 2010 01:43
Forum: DOS Batch Forum
Topic: Counter
Replies: 10
Views: 4089

Re: Counter

Hi 1+2=46, you simply forgot the )" But you can "pimp" your code a bit. And for better effects you should look at http://www.dostips.com/forum/viewtopic.php?f=3&t=939 "Solution: to write multiple times on the same line" (without clear the screen). @echo off SetLocal Enab...
by jeb
03 Apr 2010 14:08
Forum: DOS Batch Forum
Topic: Solution: to write multiple times on the same line
Replies: 2
Views: 2569

Solution: to write multiple times on the same line

Hello, the set /p command has some interessting features. The normal usage is to display a text and wait for an answer, finished by <Enter>. set /p user=Enter your name? But you can use it also to display only a text like set /p someVar=Display this text < nul or the same with an other notation <nul...