Search found 1567 matches
- 22 May 2011 21:19
- Forum: DOS Batch Forum
- Topic: Delayed Expansion and escapes
- Replies: 3
- Views: 4693
Re: Delayed Expansion and escapes
>rem Unquoted uses 2 escapes on each pass, so 2^6=64 chars initially! >set v1=^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^! >set v2=!v1! >set v3=!v2! >set v v1=^^^^^^^^^^^^^^^! v2=^^^^^^^^^^^^^^^! v3=^^^^^^^^^^^^^^^! >rem Quoted uses only 1 escape per pass, so 2^3=8 chars initially. >set "v1=^^^^^^^!"...
- 22 May 2011 20:29
- Forum: DOS Batch Forum
- Topic: [Solved] Return ANY string across ENDLOCAL boundry - BUG!
- Replies: 7
- Views: 13142
Re: Return ANY string across ENDLOCAL boundry - BUG!
I can't follow this bit of code : set "var=!var:%%=%%~A!" set "var=!var:"=%%~B!" for %%a in ("!LF!") do set "var=!var:%%~a=%%~L!" for %%a in ("!CR!") do set "var=!var:%%~a=%%~C!" Would you explain it for me I'm not at your level
- 22 May 2011 20:10
- Forum: DOS Batch Forum
- Topic: Delayed Expansion and escapes
- Replies: 3
- Views: 4693
Delayed Expansion and escapes
Is there some kind of formula to figure out how many of them you'll need instead of guessing it & trying all possibilities to display a ! ^! ^^^! ^^^^^^^! ^^^^^^^^^^^^! ^^^^^^^^^^^^^^^^^!
- 21 May 2011 18:14
- Forum: DOS Batch Forum
- Topic: Batch "macros" with arguments
- Replies: 73
- Views: 122275
Re: Batch "macros" with arguments
' You said you had problems with nested macros and 'Dreference' function. that you could dref only twice . When I first define 4 macros and macro1 calls macro2 calls macro3 calls macro4, the code expands to : %forAmacro% ( *** ) do %forAmacro% ( *** ) do %forAmacro% ( *** ) do %forAmacro% ( *** ) do...
- 21 May 2011 15:51
- Forum: DOS Batch Forum
- Topic: Who created that file !
- Replies: 0
- Views: 4682
Who created that file !
I was playing with some macro commands . As you can see I forgot some escapes here und there . You would expect this to crash but no it creates a file named FindStr.EXE of 0kbs in the active directory instead . But why? if defined StdOut ( %\n2%^ echo.^^^!StdIn^^^! |^>nul FindStr.EXE /i /c:"^!S...
- 21 May 2011 13:15
- Forum: DOS Batch Forum
- Topic: FOR IN DO and GOTO
- Replies: 5
- Views: 6674
Re: FOR IN DO and GOTO
I don't think you can use labels inside a for loop.
- 20 May 2011 23:46
- Forum: DOS Batch Forum
- Topic: Batch "macros" with arguments
- Replies: 73
- Views: 122275
Re: Batch "macros" with arguments
' I would implement both techniques, the help screen does not need to be fast in my opinion as you should not be in help screens most of the time. Variabes are still best if the messages are repetitive. strings like "a b c d ..." for mathematics. My script is horribly innefficient &a h...
- 20 May 2011 19:53
- Forum: DOS Batch Forum
- Topic: Batch "macros" with arguments
- Replies: 73
- Views: 122275
Re: Batch "macros" with arguments
'
So you are reducing the overhead aswell! By derefferencing first, it won't have to be done at execution phase brilliant
So you are reducing the overhead aswell! By derefferencing first, it won't have to be done at execution phase brilliant
- 20 May 2011 16:06
- Forum: DOS Batch Forum
- Topic: Problems with script which call another file
- Replies: 16
- Views: 15533
Re: Problems with script which call another file
BUT then I was tripped up by parentheses failing when they contained double colons or a label, so I am perhaps over sensitive to the dangers of colons within parentheses. REM DIR FILE >> text.txt and the DIR command was disabled by REM but a blank line was appended to text.txt. The failure of rem i...
- 20 May 2011 13:15
- Forum: DOS Batch Forum
- Topic: Problems with script which call another file
- Replies: 16
- Views: 15533
Re: Problems with script which call another file
@alan_b I respect your capability, but for me to use these double colon tricks would be venturing beyond my capabilities, and I would fall flat on my face. Is this ironic "Better to remain silent and be thought a fool than to speak out and remove all doubt." Maybe, well I won't speak to yo...
- 20 May 2011 11:20
- Forum: DOS Batch Forum
- Topic: Problems with script which call another file
- Replies: 16
- Views: 15533
Re: Problems with script which call another file
Just a programming style I use :Label "( /Str: "String|Byval" /Optional )" :: :: This does nothing SetLocal ::( ::Open a subject ::( echo.Hi. My Name is.. ED ::) ::that's no subject ::( echo.realy?>nul ::) :: ( endlocal seterror ) goto :eof () ::) I could also use rem but I like ...
- 20 May 2011 09:58
- Forum: DOS Batch Forum
- Topic: File properties
- Replies: 2
- Views: 3493
Re: File properties
1. Retrieve a file creation date and time from all the files in a specific folder and save the data to a .txt file.
I think it can be done with the dir /? command .
2. (optional) Archive the .txt file (rar or zip).
Whhhza I need to reboot
use 7zip
- 20 May 2011 09:44
- Forum: DOS Batch Forum
- Topic: Batch "macros" with arguments
- Replies: 73
- Views: 122275
Re: Batch "macros" with arguments
' REALLY !, I did not know that . But have been progressing with macros &enableddelayedexpansion, macro1 could be called directly or indirectly by another macro: ::------------------------------------------------------------ ::Pre Define LocalScope EnableDelayedExpansion :: >> ::( Setlocal Enabl...
- 20 May 2011 07:08
- Forum: DOS Batch Forum
- Topic: Batch "macros" with arguments
- Replies: 73
- Views: 122275
Re: Batch "macros" with arguments
1) I want the macro definitions to persist after the batch that defines them terminates. What do u mean, If the current DOS environment closes, there is nothing to persist in! I make the environment persist like : >"%%~!" echo.@start "Restart" /low /min %%comspec%% /!COMMAND! &q...
- 20 May 2011 06:51
- Forum: DOS Batch Forum
- Topic: Batch "macros" with arguments
- Replies: 73
- Views: 122275
Re: Batch "macros" with arguments
Really, howcome its not working ::for %%! in ( "VAR" ) do %IsDefined.Error% %(>nul)% :: for %%? in ( IsDefined.Error ) do set "%%~?=set /a ERR = 0 ^&( if not defined %%~^^^! set /a ERR = 1 ) ^&( echo. ^&echo. ^&echo. IsDefined : '%%~^^^!' : ^&set /p "?= '^^^!%...