Search found 91 matches

by carlsomo
15 Jul 2017 20:06
Forum: DOS Batch Forum
Topic: Anyone know a method for a batch script to determine if it is being called from another batch script?
Replies: 1
Views: 3317

Anyone know a method for a batch script to determine if it is being called from another batch script?

I vaguely remember someone bringing up this issue but my search failed

So anyway I wish to display certain statements if the script is being run from the command line and not display the statements if it is being called by another script.
by carlsomo
09 Jun 2017 15:12
Forum: DOS Batch Forum
Topic: Close DOS window
Replies: 5
Views: 6152

Re: Close DOS window

TipMark, Assuming you wish to run some batch code and then, when finished start a specific excel spreadsheet and have the batch window closed with the excel window 'on top' ?? You could try this: RunMyBatchThenOpenMyExcelFile.bat (make a shortcut to this file and set to run minimized under shortcut ...
by carlsomo
18 Apr 2015 21:25
Forum: DOS Batch Forum
Topic: Batch Animated Text
Replies: 10
Views: 24087

Re: Batch Animated Text

AiroNG

I apologize for not recognizing the variables in DOS related to regional and language settings. I am usually pretty happy getting something to work in one version, mine. :wink:

Carl
by carlsomo
18 Apr 2015 12:27
Forum: DOS Batch Forum
Topic: Batch Animated Text
Replies: 10
Views: 24087

Re: Batch Animated Text

AiroNG

My time is format h:mm:ss.hs yours has a comma h:mm:ss,hs
so add a comma to the delimeters in this for loop in the delay routine:

Code: Select all

for /f "tokens=1-4 delims=:.," %%a in ("%time1%") do (


Then it should work. I have only tested on Win7.
by carlsomo
17 Apr 2015 20:37
Forum: DOS Batch Forum
Topic: Batch Animated Text
Replies: 10
Views: 24087

Re: Batch Animated Text

SpinSpell.bat ["Message goes here"] [spincount] [spindelay] @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "$BS=%%a" SET /A SpinCount=7,MaxSpinCount=30,Spin_Delay=4,ctr=0 SET "_MSG=ÛÛÛÛÛÛÛÛÛÛÛÛÛ" IF NOT...
by carlsomo
08 Jan 2015 00:31
Forum: DOS Batch Forum
Topic: JSORT.BAT v4.2 - Case sensitive sort with option for numeric sort
Replies: 48
Views: 128806

Re: JSORT.BAT - Case sensitive sort with option for numeric

That would be cool, so sample csv file to sort by date, most recent year on top: Sample CSV File Title line FRUIT,Dish,Date submitted,item apple,taco,12/31/2000,bus ticket banana,fruit pie,3/17/1958,table orange,julius,1/5/1999,stool pea pod,stew,04/9/2014,glider key lime,pie,12/1/2000,ladder Is the...
by carlsomo
06 Jan 2015 21:59
Forum: DOS Batch Forum
Topic: JSORT.BAT v4.2 - Case sensitive sort with option for numeric sort
Replies: 48
Views: 128806

Re: JSORT.BAT - Case sensitive sort with option for numeric

It would be nice to have a date option so that date fields in the format: MM/DD/YYYY or m/d/y could be sorted by year month day? Just a suggestion. I currently have to write to a new file after converting dates to YYYYMMDD, run the sort with the date in the first position, then convert the dates bac...
by carlsomo
24 Jun 2014 23:29
Forum: DOS Batch Forum
Topic: Need help with parameter arguments
Replies: 8
Views: 9411

Re: Need help with parameter arguments

Here is an example of how to handle switches that may require a following switch or argument Attn to: call :parse %* and %AndShift% toggle and calling :labels in the parse routine This is a Choice replacement routine for XP that handles Win 7-8 and Vista formats as well: @echo off&goto :main :Ch...
by carlsomo
24 Jun 2014 22:02
Forum: DOS Batch Forum
Topic: Convert .xls and .csv to tab-delimited .txt
Replies: 6
Views: 14993

Re: Convert .xls and .csv to tab-delimited .txt

Hybrid batch/jscript:

viewtopic.php?f=3&t=4628&p=33475#p33475

Last post
XLS2CSV "D:\XLpath\my file.xlsx" "D:\CSVfiles\my file.csv" /S=/t

Converts xlsx to tab delimited txt file. I don't think there is a pure batch solution.
by carlsomo
06 Apr 2014 20:50
Forum: DOS Batch Forum
Topic: Batch File to read excel
Replies: 15
Views: 68864

Re: Batch File to read excel

Here is a Jscript hybrid version that does not need to write a separate VBS More documentation and error checking Update: Tested on Win7 and XP More error checking Still needs Excel though @if (@X)==(@Y) @end /* Harmless hybrid line that begins a JScript comment ::**************** Documentation ****...
by carlsomo
06 Apr 2014 01:39
Forum: DOS Batch Forum
Topic: Saving Vars
Replies: 8
Views: 8721

Re: Saving Vars

You could try SETX

type SETX -I @ command prompt for examples
It may not work if script is not run in admin mode depending on win version
by carlsomo
06 Apr 2014 01:01
Forum: DOS Batch Forum
Topic: REPLVAR.BAT - regex search and replace for variables
Replies: 32
Views: 39659

Re: REPLVAR.BAT - regex search and replace for variables

problems with ...'s

C:\>set input=111111111111??

C:\>replvar input output "..." "ttt"

C:\>set output
output=tttttttttttt??

C:\>replvar input output "222" "ttt"

C:\>set output
output=111111111111??
by carlsomo
26 Jan 2014 16:54
Forum: DOS Batch Forum
Topic: Creating carriage return (CR, 0Dh) doesn't work in Windows 8
Replies: 6
Views: 8381

Re: Creating carriage return (CR, 0Dh) doesn't work in Windo

This is the workaround I use in Win7 and does not require writing or reading from a file. Set/p will display backspaces. The :Setup_etc function defines max line width. The :CR function accepts a number to move cursor left. It is also very useful to move the cursor back just a specified number of ch...
by carlsomo
26 Jan 2014 16:24
Forum: DOS Batch Forum
Topic: Pure DOS valid Date checker
Replies: 5
Views: 7245

Re: Pure DOS valid Date checker

After a little more research.... Prior to Pope Gregory's new Calendar that we now use the Julian Calendar was in force. This calendar had leap years for every year divisible by 4 with no remainder. This led to a 10 day difference in the spring equinox from where the earth was actually in position wi...