Search found 40 matches

by shirulkar
22 Feb 2013 18:26
Forum: DOS Batch Forum
Topic: To Capture copy time when copy folder from one to another
Replies: 5
Views: 4196

Re: To Capture copy time when copy folder from one to anothe

Put "echo Copy started at %date%%time% >>file.txt" before copy command
by shirulkar
22 Feb 2013 17:29
Forum: DOS Batch Forum
Topic: Copy file type from sub directories, into a folder renaming
Replies: 13
Views: 9357

Re: Copy file type from sub directories, into a folder renam

This will work for you @Echo OFF cd > a.txt set /p "abc="< a.txt set dSource=C:\Users\P Ditty\Documents\SH3\data\cfg\Careers Set dTarget=C:\Users\P Ditty\Documents\SH3\data\cfg\Backups_SCR for /f "tokens=* delims=" %%f in ('dir /a-d /b /s "%dSource%\*.txt"') do call :Fu...
by shirulkar
22 Feb 2013 16:55
Forum: DOS Batch Forum
Topic: Copy file type from sub directories, into a folder renaming
Replies: 13
Views: 9357

Re: Copy file type from sub directories, into a folder renam

Following will work just set Filepath. I left it empty. Filepath should be you .bat file path (Ex. C:\Users\P Ditty\Documents) @Echo OFF set dSource=C:\Users\P Ditty\Documents\SH3\data\cfg\Careers Set dTarget=C:\Users\P Ditty\Documents\SH3\data\cfg\Backups_SCR Set Filepath= for /f "tokens=* del...
by shirulkar
13 Feb 2013 13:01
Forum: DOS Batch Forum
Topic: Find Multiple Strings
Replies: 29
Views: 19098

Re: Find Multiple Strings

Following work for you @echo off for /F "tokens=2 delims=:" %%a in ('type "c:\temp1\PidDb.txt"^|find /i "Image Name:"') do ( echo Image Name:%%a >>a.txt IF !linecount! EQU %maxlines% GOTO MyExit1 SET /A linecount+=1 ) for /F "tokens=2 delims=:" %%b in ('type &...
by shirulkar
11 Feb 2013 17:30
Forum: DOS Batch Forum
Topic: Counting string length
Replies: 5
Views: 4846

Re: How to make it ?

Following code will give the length of the word. If it contain space then also it will give the length of whole string. Ex. I am good then it will give length as 9. @echo off SETLOCAL ENABLEDELAYEDEXPANSION set /p str= Enter word: set len=0 set flen=0 FOR /f "usebackq delims=" %%a in (` ec...
by shirulkar
11 Feb 2013 17:07
Forum: DOS Batch Forum
Topic: Counting string length
Replies: 5
Views: 4846

Re: How to make it ?

Hi, Following code will work but only for word without space. @echo off SETLOCAL ENABLEDELAYEDEXPANSION set /p str= Enter word: set len=0 FOR %%a in (%str%) do ( set str3=%%a call :fun1 %%a) Exit /b :fun1 REM set str1=%~1 REM set a=%str1% set str2=!str3:~%len%,1! if "%str2%"=="" ...
by shirulkar
11 Feb 2013 16:38
Forum: DOS Batch Forum
Topic: findstr in variable
Replies: 18
Views: 28483

Re: findstr in variable

Following work

Code: Select all

Findstr /R /N "^" "C:\test\test.csv" | find /c ":" >>a.txt
set /p "abc="< a.txt
del a.txt
by shirulkar
06 Feb 2013 06:37
Forum: DOS Batch Forum
Topic: how to add decimal numbers using batch file?
Replies: 11
Views: 39590

Re: how to add decimal numbers using batch file?

Yes I did it using vbs. Can we give input to calculator using batch script? if yes then please tell me
by shirulkar
06 Feb 2013 04:52
Forum: DOS Batch Forum
Topic: how to add decimal numbers using batch file?
Replies: 11
Views: 39590

Re: how to add decimal numbers using batch file?

I have following code SETLOCAL EnableExtensions FOR /F "usebackq tokens=*" %%f IN ("a.txt") DO CALL :runsox "%%f" GOTO :EOF :runsox SET num1=%~1 calc %num1%+1.2 ENDLOCAL it will open the calculator but i want out put without opening the calculator and calculator should ...
by shirulkar
06 Feb 2013 02:37
Forum: DOS Batch Forum
Topic: how to add decimal numbers using batch file?
Replies: 11
Views: 39590

how to add decimal numbers using batch file?

Hi

How to add decimal number in batch file.
For Example
a=2.4 and b=4.5 ,
c= a+b
=2.4+4.5
=6.9

I want result as 6.9 but i m getting it as 6
by shirulkar
04 Feb 2013 06:08
Forum: DOS Batch Forum
Topic: Set a variable to file contents
Replies: 3
Views: 3773

Re: Set a variable to file contents

Hi,
Following will work.

Code: Select all

@echo off
for /f "usebackq tokens=* delims=" %%a in ("mydatefile.txt") do call :Fun "%%a"

exit /b

:Fun
set str1=%~1
echo %str1%

exit /b
by shirulkar
31 Jan 2013 02:34
Forum: DOS Batch Forum
Topic: Help please to link two simple commands
Replies: 10
Views: 7310

Re: Help please to link two simple commands

Hi dobbis, following code will store 20th,40th,60th.... file directly in the require folder that is "c:\wdisplay\alldayvideostorage\%name%" @echo off set Counter=0 set name=%DATE:/=_% mkdir C:\wdisplay\alldayvideostorage\%name% for /f "tokens=*" %%f in ('DIR /b /s /O:D c:\alldayv...