Search found 212 matches

by darioit
11 Apr 2016 09:44
Forum: DOS Batch Forum
Topic: Fille spaces from the end of a string via "FOR" command
Replies: 7
Views: 3195

Fille spaces from the end of a string via "FOR" command

Hello I find this example: set str=15 Trailing Spaces to truncate &rem echo."%str%" for /l %%a in (1,1,31) do if "!str:~-1!"==" " set str=!str:~0,-1! echo."%str%" and this is the output "15 Trailing Spaces to truncate space space space " "15...
by darioit
29 Feb 2016 23:55
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 5053

Re: Remove quote in xml file

I try this solution adding

Code: Select all

tr -d "\n" 
but doesn't work

Code: Select all

for /f %%A in ('tail -n1 C:\Meniscus\Data\cc_debug.txt ^| tr -d "\n"') do (
by darioit
29 Feb 2016 13:24
Forum: DOS Batch Forum
Topic: Remove quote in xml file
Replies: 12
Views: 5053

Re: Remove quote in xml file

Hello, I have a new issue about this script, very easy This code :Start for /f %%A in ('tail -n1 C:\Meniscus\Data\cc_debug.txt') do ( for /f "tokens=1-6 delims=/,.: " %%A in ("!date! !time: =0!") do ( set "MenTime=<MenTime>%%A/%%B/%%C %%D:%%E:%%F</MenTime>" ) >>"!f...
by darioit
25 Feb 2016 09:37
Forum: DOS Batch Forum
Topic: Store folder name of zip into variable
Replies: 2
Views: 1504

Re: Store folder name of zip into variable

you're alright, sometimes I think difficult solutions for simple things, here the best solutions! @echo off set RESULT= for /f "delims=" %%a in ('7za.exe l -r "ZipArchive.7z" ^| findstr "[0-9].D....\>" ^| find /v "\"') do set RESULT=%%a set FName=%RESULT:~53,5...
by darioit
25 Feb 2016 07:59
Forum: DOS Batch Forum
Topic: Store folder name of zip into variable
Replies: 2
Views: 1504

Store folder name of zip into variable

Hello, I have a zip archive "ZipArchive.7z" which inside this structure: FolderName\Document1.pdf FolderName\Document2.pdf I like to put only "FolderName" into variable. I wrote this code: 7za.exe l -r "ZipArchive.7z" | FINDSTR "[0-9].D....\>" | FIND /V "...
by darioit
30 Dec 2015 03:31
Forum: DOS Batch Forum
Topic: Move files and place a Windows link
Replies: 2
Views: 1989

Re: Move files and place a Windows link

This is not a script! This is a masterpiece !!!

It's works very well, thanks again!
by darioit
29 Dec 2015 02:22
Forum: DOS Batch Forum
Topic: Move files and place a Windows link
Replies: 2
Views: 1989

Move files and place a Windows link

Hello Everybody, I find my old script to copy all particular extensione file from a disk to another disk replicating asis the same directory structure xcopy /yisd D:\*.7z Z:\D\%1 xcopy /yisd E:\*.7z Z:\E\%1 Now I like to improve this script deleting a file successfully copied and replace it with a W...
by darioit
26 Nov 2015 05:06
Forum: DOS Batch Forum
Topic: Extract chars from string
Replies: 4
Views: 1730

Re: Extract chars from string

alredy test, doesn't work

for /f %%a in ('dir /b') do (
set variable=%%a:~0,2
echo !variable!
)
by darioit
26 Nov 2015 04:42
Forum: DOS Batch Forum
Topic: Extract chars from string
Replies: 4
Views: 1730

Extract chars from string

Hello,
How can I run this basic batch

Code: Select all

for /f %%a in ('dir /b') do echo %%a:~0,2


I need only first 2 chars

Thank you
by darioit
14 Oct 2015 02:10
Forum: DOS Batch Forum
Topic: Update variable in a For loop
Replies: 3
Views: 1599

Re: Update variable in a For loop

Good now works, many Thanks

10:09:28.74
10:09:29.75
10:09:30.79
10:09:31.83
10:09:32.86
10:09:33.90
10:09:34.94
10:09:35.99
by darioit
14 Oct 2015 01:45
Forum: DOS Batch Forum
Topic: Update variable in a For loop
Replies: 3
Views: 1599

Update variable in a For loop

Hello folks,

why in a FOR loop, %time% variable doesn't update?

Code: Select all

@echo off
for /f "delims=" %%a in ('dir /b *.*') do (
   echo %time%
   )


Result:
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81
9:44:07.81

Thank you
by darioit
10 Sep 2015 06:11
Forum: DOS Batch Forum
Topic: Set Conter 5 digit
Replies: 2
Views: 1434

Re: Set Conter 5 digit

Perfect works fine, many thanks!
by darioit
10 Sep 2015 04:31
Forum: DOS Batch Forum
Topic: Set Conter 5 digit
Replies: 2
Views: 1434

Set Conter 5 digit

Hello folks, I have this simply work, add 1 unit to my file Counter.txt, but digit must be 5 digit fix (ex.00023) This is my script, but when decimal is moving from 1 position doesn't works, any idea? echo on setlocal EnableDelayedExpansion set Counter=0 FOR /f "tokens=1" %%i in (Counter.t...
by darioit
21 Oct 2014 01:49
Forum: DOS Batch Forum
Topic: Random number
Replies: 1
Views: 1117

Random number

Hello, I use this variable %random% to get random number, but the result must be always 5 byte @echo off echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% echo %random% result: 14915 15875 3294 (results must be 03294) 17197 ...
by darioit
21 Oct 2014 01:46
Forum: DOS Batch Forum
Topic: Merge 2 script variable problem
Replies: 2
Views: 1273

Re: Merge 2 script variable problem

nice work, thank you !