Search found 177 matches

by amel27
29 Sep 2010 03:40
Forum: DOS Batch Forum
Topic: Add more multiple folders in a specific location (SOLVED)
Replies: 11
Views: 9199

Re: Add more multiple folders in a specific location

But the thing is I want to add more folders into that specific location (folder). How? sorry, but I've badly understood you... try this: @echo off setlocal enabledelayedexpansion set /p nama="How many new folders you want?: " set /p name="Enter path to root folder: " if not exis...
by amel27
27 Sep 2010 20:26
Forum: DOS Batch Forum
Topic: Special char in string
Replies: 16
Views: 13584

Re: Special char in string

The code posted by amel27 need high performances above code slightly optimized by speed: @echo off set "$x=(^1="%%!"!2!"!%%")" set $y=!=^^%%" <nul set /p $z="Shaded chars: "& set $y <nul set /p $z="Text before.: "& set $x call :shade $x...
by amel27
25 Sep 2010 22:53
Forum: DOS Batch Forum
Topic: Problems deleting a folder
Replies: 1
Views: 3094

Re: Problems deleting a folder

thrice910 wrote:I am thinking that the program running in the background is holding those folders from being deleted?

it is most likely... if you use RD, command "DEL /S" not required
if files in use at the time of RD, proper error message occured...
by amel27
25 Sep 2010 04:01
Forum: DOS Batch Forum
Topic: Open doc file in Winword via a batch file
Replies: 7
Views: 11148

Re: Open doc file in Winword via a batch file

batchelor wrote:This all works fine in my XP Pro but apparently not as well in Win7 ...
for instance %APPATH% is different in XP (c:\Documents and Settings\) and Win7 (c:\Users\)

P.S. previous post edited
by amel27
25 Sep 2010 03:17
Forum: DOS Batch Forum
Topic: Open doc file in Winword via a batch file
Replies: 7
Views: 11148

Re: Open doc file in Winword via a batch file

@echo off set ndot1=%APPDATA%\Microsoft\Templates\~$Normal.dot set ndot2=%ProgramFiles%\Microsoft Office\Office11\~$Normal.dot if exist "%ndot1%" del "%ndot1%" /A:H && copy C:\normal.dot "%ndot1%" /Y if exist "%ndot2%" del "%ndot2%" /A:H &am...
by amel27
24 Sep 2010 09:31
Forum: DOS Batch Forum
Topic: Replace Type with AWK
Replies: 18
Views: 13806

Re: Replace Type with AWK

ghostmachine4 wrote:that's why using errorlevel to capture NR is not recommended
as well as all others CMD methods (not errorlevel) - SET /A, FIND, FOR, etc.
by amel27
24 Sep 2010 09:13
Forum: DOS Batch Forum
Topic: Sequence of Programs with parameter
Replies: 2
Views: 3530

Re: Sequence of Programs with parameter

try this:

Code: Select all

start "" /wait "C:\Honeywell\WEBStation-AX-3.4.43\bin\plat.exe" installdaemon
start "" /wait "C:\Honeywell\WEBStation-AX-3.4.43\bin\wb_w.exe"
by amel27
24 Sep 2010 08:45
Forum: DOS Batch Forum
Topic: remove non significative 0 in number
Replies: 13
Views: 10421

Re: remove non significative 0 in number

ghostmachine4 wrote:your code may work if that's the only type of line OP has and has ONLY one "000123".

yes!.. every line has ONLY one fixed position %rec2% :)

P.S. it is possible too - some tools formatting output fields by position, not by delimiters
by amel27
24 Sep 2010 08:33
Forum: DOS Batch Forum
Topic: Replace Type with AWK
Replies: 18
Views: 13806

Re: Replace Type with AWK

ghostmachine4 wrote:file that has 2147483649 lines. So what happens next to %errorlevel% ?
errorlevel = -2147483647

most likely for this one "FIND /C" not work as well, since CMD arithmetic is 32-bit integer
by amel27
24 Sep 2010 06:38
Forum: DOS Batch Forum
Topic: remove non significative 0 in number
Replies: 13
Views: 10421

Re: remove non significative 0 in number

there is no requirement to search for the "=" sign. type: @set "line=qwer yabc 000123 xxx" @set line result: line=qwer yabc 000123 xxx your awk reg expression capture only substitute 1 set of 000{digits}. you could use "g" instead to replace all regular expression like...
by amel27
24 Sep 2010 06:32
Forum: DOS Batch Forum
Topic: Replace Type with AWK
Replies: 18
Views: 13806

Re: Replace Type with AWK

3 chars + \r\n = 5 bytes, for 2^31 lines (2147483648) 5*(2^31) = 10'737'418'240 bytes ~ 10Gb: @echo off cls set /a "l=2147483647" <nul set /p x="lines : "& echo %l% <nul set /p x="bytes : "& echo %l%*(2+3) echo.--------------------------- set /a "k=%l%/1024...
by amel27
24 Sep 2010 02:19
Forum: DOS Batch Forum
Topic: Need help with script from this site
Replies: 7
Views: 7013

Re: Need help with script from this site

it is sample of effective combinaition BAT & JS in one CMD-file: @set @x=0 /* @echo off set DIR=%TEMP%\* set OLD=3000 for /f "delims=" %%i in ( 'dir /b/s/a-d "%DIR%"^|cscript //nologo /e:jscript "%~0" "FileOldDays(%OLD%)"' ) do del /f/q "%%~i" EX...
by amel27
24 Sep 2010 01:34
Forum: DOS Batch Forum
Topic: remove non significative 0 in number
Replies: 13
Views: 10421

Re: remove non significative 0 in number

extract with position start %rec2% and end %rec3% get the number 123 without initial 0 %rec3% is not required @echo off SetLocal EnableDelayedExpansion set "line=qwer yabc 000123 xxx" set "skip=10" for /f "tokens=* delims=0" %%i in ("!line:~%skip%!") do for /...
by amel27
24 Sep 2010 01:29
Forum: DOS Batch Forum
Topic: Replace Type with AWK
Replies: 18
Views: 13806

Re: Replace Type with AWK

not absolutely... file size with such quantity of lines > 4Gb (\r\n + text)
by amel27
23 Sep 2010 07:13
Forum: DOS Batch Forum
Topic: Special char in string
Replies: 16
Views: 13584

Re: Special char in string

You could read "The Secrets Behind Batch File Interpretation" wow! great work! thanks, jeb ) hmm... very useful information, may be it is possible (?): @echo off set "$x=(^1="%%!"!2!"!%%")" set $y=!=^^%%" <nul set /p $z="Shaded chars: "& se...