Search found 384 matches

by Samir
17 Mar 2018 16:48
Forum: DOS Batch Forum
Topic: Branched Operate Based on Variable First Letter
Replies: 2
Views: 3355

Re: Branched Operate Based on Variable First Letter

I'm unsure if i understand your task right: @echo off setlocal enableExtensions disableDelayedExpansion CALL :FUNCTION "VARIABLE" CALL :FUNCTION "ALMOND" CALL :FUNCTION "ARYA" CALL :FUNCTION "CHEVA" CALL :FUNCTION "SATYA" CALL :FUNCTION "P" goto :eof :FUNCTION if /I "%~1" lss "p" goto :oneThing if ...
by Samir
17 Mar 2018 15:55
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9622

Re: Clean text

sorry it's not a dir command, but "7za l file.zip" I'll check your solution thank you for help! Ahh makes sense. And I just checked the options for 7za and it doestn' seem to have any options for the display. I have some ideas on how to do this since the column width seems always the same, but I'll...
by Samir
17 Mar 2018 15:36
Forum: DOS Batch Forum
Topic: timed batch file execution
Replies: 11
Views: 11288

Re: timed batch file execution

I think you are all missing the intended request. The user said they wanted a batch file to start a particular time of the day. They are not asking to pause execution of a batch file until a specified time of the day. Hmmm...but if the main loop of the batch file won't start until the specified tim...
by Samir
17 Mar 2018 00:06
Forum: DOS Batch Forum
Topic: Branched Operate Based on Variable First Letter
Replies: 2
Views: 3355

Branched Operate Based on Variable First Letter

I have a batch in which a variable with have a directory name. That directory name will start with a letter and vary in length, but usually within the old dos 8.3 limits. For example, variable name could be one of the following: ALMOND ARYA CHEVA SATYA What I would like to do is if the first letter ...
by Samir
16 Mar 2018 23:22
Forum: DOS Batch Forum
Topic: Clean text
Replies: 11
Views: 9622

Re: Clean text

This looks like you're just trying to get the filenames from a directory listing. And judging by the \ character, it's a dos/windows system. So instead of using just dir, you can use dir /b. For finding all the filenames in not only the current directory but also subdirectories, the for command is a...
by Samir
16 Mar 2018 23:10
Forum: DOS Batch Forum
Topic: Possible to Use Label Name as a Variable?
Replies: 1
Views: 2625

Re: Possible to Use Label Name as a Variable?

So in reading another thread here, I ran across an example that used %~1 with call, which inspired me to try %~0 with call. Indeed, it will return the label used. My testing batch: ECHO OFF CALL :MAIN "TEST" GOTO END :MAIN ECHO START ECHO %~0 SET LABEL=%~0 SET LABEL=%LABEL:~1% ECHO %LABEL% ECHO %~1 ...
by Samir
16 Mar 2018 22:50
Forum: DOS Batch Forum
Topic: timed batch file execution
Replies: 11
Views: 11288

Re: timed batch file execution

A little late to the party, but I use this in several batches. It doesn't require anything external except the ping command. It starts the batch at 1am.

Code: Select all

:START
PING -n 60 127.0.0.1 > NUL
SET CURTIME=%TIME:~0,-6%
IF NOT "%CURTIME%"==" 1:00" GOTO START
by Samir
16 Mar 2018 22:48
Forum: DOS Batch Forum
Topic: Possible to Use Label Name as a Variable?
Replies: 1
Views: 2625

Possible to Use Label Name as a Variable?

I have a batch file that will call to various functions where the label name is also used in the function. For example (ALMOND in this example): :ALMOND XCOPY \\SHARENAME\ALMOND \ALMOND /F/R/E/S/H/K/Y/D/C/L GOTO :EOF I wanted to know if there's any variable like %0 for the label in a batch file. Tha...
by Samir
19 Dec 2017 22:07
Forum: DOS Batch Forum
Topic: DOSTIPS.COM does not work on XP
Replies: 15
Views: 16961

Re: DOSTIPS.COM does not work on XP

I'm running xp as well. Using chrome portable 26 (I think) and it's working fine. phpbb is a very established forum software and has worked over several operating system incarnations (I started using this version of phpbb as a user when I was on win98), and I don't see any reason for them to update ...
by Samir
23 Jul 2017 16:18
Forum: DOS Batch Forum
Topic: DOS Text Editor w/ Keyboard Shortcuts like those in MS-Word (for Windows)?
Replies: 4
Views: 4977

Re: DOS Text Editor w/ Keyboard Shortcuts like those in MS-Word (for Windows)?

What kind of keyboard shortcuts are you looking for? (Although not to get your hopes up, no, I don't know of any command-line editors for DOS other than EDIT.) Just hoping for the basic stuff in MS Word (for Windows): e.g. Ctrl-C=Copy, Ctrl-V=Paste, Shift-^><=Highlight, Ctrl-Z=Undo, Ctrl-Y=Redo/Rep...
by Samir
23 Jul 2017 16:15
Forum: DOS Batch Forum
Topic: Rename Text Files Based On Content ("Line 4" - "Line 6".txt)
Replies: 5
Views: 5022

Re: Rename Text Files Based On Content ("Line 4" - "Line 6".txt)

I have 250,000 text files (Stories of various names) in alphabetized folders. I would like to rename each text file based on the 4th line (Story Title) and the 6th line (Story's Author) of their respected text... If I attempt to do this manually I think I will be doing this for the next 20 years......
by Samir
23 Jul 2017 15:58
Forum: DOS Batch Forum
Topic: how to save response of wget.exe in a variable?
Replies: 15
Views: 17379

Re: how to save response of wget.exe in a variable?

Samir, after typing TYPE TEST it showed what I wanted C:\Users\Ovidiu>c:\"Program Files (x86)"\GnuWin32\bin\wget.exe --output-document=TEST "http://192.168.1.40/push.php?loadpercentage=%loadpercentage%&totalphysicalmemory=%totalphysicalmemory%&boottime=%boottime%&freephys...
by Samir
23 Jul 2017 15:47
Forum: DOS Batch Forum
Topic: Find All Filenames NOT Containing a String
Replies: 16
Views: 14204

Re: Find All Filenames NOT Containing a String

Without the redirection to nul, the writes to the console are absolutely horrifically slow. Depending on what OS this is being run in, the video driver will also play a big part in how fast text is written to the display. Sometimes running a console 'full screen' (native text) helps, and other time...
by Samir
23 Jul 2017 15:46
Forum: DOS Batch Forum
Topic: Find All Filenames NOT Containing a String
Replies: 16
Views: 14204

Re: Find All Filenames NOT Containing a String

My results were quite interesting. I didn't show any noticeable speed increase/decrease. The file set was 5263 files totaling just over 7MB with file sizes ranging from just over 100 bytes to 6842 bytes. I ran the following commands each took approximately 80 seconds to run. FINDSTR /MVC:"No Da...
by Samir
23 Jul 2017 15:27
Forum: DOS Batch Forum
Topic: Find All Filenames NOT Containing a String
Replies: 16
Views: 14204

Re: Find All Filenames NOT Containing a String

That is a dramatic difference indeed!

I'm going to try some testing on my end and see what type of results I get with the original command. Bear in mind the files are on a file server, so network latency might skew my results slightly.