Search found 40 matches
- 22 Feb 2013 18:26
- Forum: DOS Batch Forum
- Topic: To Capture copy time when copy folder from one to another
- Replies: 5
- Views: 4866
Re: To Capture copy time when copy folder from one to anothe
Put "echo Copy started at %date%%time% >>file.txt" before copy command
- 22 Feb 2013 17:40
- Forum: DOS Batch Forum
- Topic: Copy file type from sub directories, into a folder renaming
- Replies: 13
- Views: 11040
- 22 Feb 2013 17:29
- Forum: DOS Batch Forum
- Topic: Copy file type from sub directories, into a folder renaming
- Replies: 13
- Views: 11040
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...
- 22 Feb 2013 17:17
- Forum: DOS Batch Forum
- Topic: Copy file type from sub directories, into a folder renaming
- Replies: 13
- Views: 11040
Re: Copy file type from sub directories, into a folder renam
what is the full path of your bat file?
- 22 Feb 2013 16:55
- Forum: DOS Batch Forum
- Topic: Copy file type from sub directories, into a folder renaming
- Replies: 13
- Views: 11040
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...
- 13 Feb 2013 15:25
- Forum: DOS Batch Forum
- Topic: How to find full patch of script from within the script
- Replies: 2
- Views: 3422
- 13 Feb 2013 13:01
- Forum: DOS Batch Forum
- Topic: Find Multiple Strings
- Replies: 29
- Views: 22820
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 &...
- 11 Feb 2013 17:30
- Forum: DOS Batch Forum
- Topic: Counting string length
- Replies: 5
- Views: 5501
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...
- 11 Feb 2013 17:07
- Forum: DOS Batch Forum
- Topic: Counting string length
- Replies: 5
- Views: 5501
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%"=="" ...
- 11 Feb 2013 16:38
- Forum: DOS Batch Forum
- Topic: findstr in variable
- Replies: 18
- Views: 31096
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
- 06 Feb 2013 06:37
- Forum: DOS Batch Forum
- Topic: how to add decimal numbers using batch file?
- Replies: 11
- Views: 43230
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
- 06 Feb 2013 04:52
- Forum: DOS Batch Forum
- Topic: how to add decimal numbers using batch file?
- Replies: 11
- Views: 43230
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 ...
- 06 Feb 2013 02:37
- Forum: DOS Batch Forum
- Topic: how to add decimal numbers using batch file?
- Replies: 11
- Views: 43230
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
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
- 04 Feb 2013 06:08
- Forum: DOS Batch Forum
- Topic: Set a variable to file contents
- Replies: 3
- Views: 4290
Re: Set a variable to file contents
Hi,
Following will work.
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
- 31 Jan 2013 02:34
- Forum: DOS Batch Forum
- Topic: Help please to link two simple commands
- Replies: 10
- Views: 8565
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...