Search found 69 matches

by mohdfraz
04 May 2018 03:21
Forum: DOS Batch Forum
Topic: Check Day in windows 10
Replies: 6
Views: 9544

Re: Check Day in windows 10

WMIC should be useful for /f "tokens=2 delims==" %%i in ('WMIC PATH Win32_LocalTime GET DayOfWeek /value') do for %%j in (%%i) do set "dow=%%j" Now variable %dow% contains a number in range 0 (for Sunday) until 6 (for Saturday). Steffen Dear Steffen, Your solution worked like a charm. Very great fu...
by mohdfraz
03 May 2018 02:09
Forum: DOS Batch Forum
Topic: Check Day in windows 10
Replies: 6
Views: 9544

Check Day in windows 10

Hi, I normally use this below code to check "Day" in batch file but in windows 10 it is not working. In older windows date return "Wed 03/05/2018" so it was easy to extra Day from date using below code but in windows 10 it is not working as Windows 10 will return "03/05/2018". Any suggestion please....
by mohdfraz
13 Jul 2017 07:53
Forum: DOS Batch Forum
Topic: Add delay in batch file
Replies: 1
Views: 3174

Re: Add delay in batch file

Hi,

Please ignore my post, I found the solution.

http://www.robvanderwoude.com/wait.php

Code: Select all

TIMEOUT /T 10 /NOBREAK


Thanks
by mohdfraz
13 Jul 2017 07:45
Forum: DOS Batch Forum
Topic: Add delay in batch file
Replies: 1
Views: 3174

Add delay in batch file

Hi, Is there any way to add delay 2 seconds delay in batch file? I normally use ping command but too many batch files sending ping to ipv6 is putting load on it and then I notice windows server 2016 is getting sluggish after few days. This start happens first in server 2012 recent update then I move...
by mohdfraz
25 Mar 2015 07:13
Forum: DOS Batch Forum
Topic: Delete Or Extract Specific rows from txt file
Replies: 4
Views: 5068

Re: Delete Or Extract Specific rows from txt file

Preserve only rows starting with "0" findstr "^0" test.txt >test_only_0_start.txt Delete rows starting with "0" findstr /v "^0" test.txt >test_no_0_start.txt Dave Benham Dave Benham, You are the MAN.......... It worked like a charm. One line solutions, Now th...
by mohdfraz
25 Mar 2015 02:14
Forum: DOS Batch Forum
Topic: Delete Or Extract Specific rows from txt file
Replies: 4
Views: 5068

Re: Delete Or Extract Specific rows from txt file

npocmaka_ wrote:check this : viewtopic.php?f=3&t=6184&start=0


This option will find key word in the whole row. But my issue is I want to check the key word in the First column only. If I use this option it will extract all rows.

Thanks
by mohdfraz
25 Mar 2015 01:52
Forum: DOS Batch Forum
Topic: Delete Or Extract Specific rows from txt file
Replies: 4
Views: 5068

Delete Or Extract Specific rows from txt file

Hi, I have a lot of txt files to sort out so I need a batch file which can delete all the rows which are starting from "0," Or Extract rows data which are not starting from "0," and transfer it to another txt file. Custom Criteria,result1,result2,result3,result4,result5,result6,r...
by mohdfraz
28 Feb 2015 06:19
Forum: DOS Batch Forum
Topic: Memory usage percentage to txt file
Replies: 2
Views: 4439

Re: Memory usage percentage to txt file

I'm not sure if this will exactly match the figure you're looking for, but give it a try: @Echo Off SetLocal EnableExtensions For /F "Skip=1 Tokens=*" %%A In ( 'WMIc OS Get FreePhysicalMemory^,TotalVisibleMemorySize') Do ( For %%B In (%%A) Do If Not Defined _ (Set/A _=100*%%B) Else (Set/A...
by mohdfraz
28 Feb 2015 02:13
Forum: DOS Batch Forum
Topic: Memory usage percentage to txt file
Replies: 2
Views: 4439

Memory usage percentage to txt file

Hello,

I want to get Memory Usage percentage to c:\Memory.txt through batch file.

I am using windows 8 and want the Memory usage percentage identical as showing in Task Manager.

Thanks
by mohdfraz
28 Jan 2015 07:39
Forum: DOS Batch Forum
Topic: Kill Batch fill process from another batch file
Replies: 4
Views: 5532

Re: Kill Batch fill process from another batch file

Hi You can also give a try with this vbscript Option Explicit Call KillProcessbyName("MyBatchFileName.bat") '********************************************************************************************** Sub KillProcessbyName(FileName) On Error Resume Next Dim WshShell,strComputer,objWMIS...
by mohdfraz
26 Jan 2015 08:29
Forum: DOS Batch Forum
Topic: Kill Batch fill process from another batch file
Replies: 4
Views: 5532

Re: Kill Batch fill process from another batch file

npocmaka_ wrote:One possible way is by getting the batch file PID - viewtopic.php?f=3&t=6133
save it to temp file and then kill it from another batch :?:



Ok Thanks
by mohdfraz
24 Jan 2015 05:30
Forum: DOS Batch Forum
Topic: Kill Batch fill process from another batch file
Replies: 4
Views: 5532

Kill Batch fill process from another batch file

Hi,

I want to kill the running batch file process with another batch file.

Thanks
by mohdfraz
30 Jun 2014 03:54
Forum: DOS Batch Forum
Topic: Echo not working on lines which got 0 at end of line
Replies: 6
Views: 5955

Re: Echo not working on lines which got 0 at end of line

As a programmer you will soon realise that adding whitespace to the end of a line is not a good way to process files simply to get around this redirection issue. Text in CSV files, and INI files can all be broken by adding whitespace when the program reading the files doesn't expect it. Agreed,,,,,...
by mohdfraz
29 Jun 2014 08:50
Forum: DOS Batch Forum
Topic: Echo not working on lines which got 0 at end of line
Replies: 6
Views: 5955

Re: Echo not working on lines which got 0 at end of line

try with: Echo REPEAT : 3 : 0 : 0 : Enter the number of iterations: : 0 : 0 1>>Test.txt What I think is happening here is you're trying to redirect the 0 stream (stdin) to the file. Setting 1 before the file redirection will redirect the 1 (stdout ) to the file. npocmaka_ Thank you........... Here ...
by mohdfraz
28 Jun 2014 04:39
Forum: DOS Batch Forum
Topic: Echo not working on lines which got 0 at end of line
Replies: 6
Views: 5955

Echo not working on lines which got 0 at end of line

Hi, When I run this below code Middle line is not Echo. any line which got 0 at the end creating issue. I have many files and on them all the lines which get 0 at the end does not get Echo from batch file. Any suggestions what to fix this issue? Echo Started>Test.txt Echo REPEAT : 3 : 0 : 0 : Enter ...