Search found 91 matches

by carlsomo
28 Oct 2013 20:07
Forum: DOS Batch Forum
Topic: [SOLVED]Switches and parameters for creating tasks
Replies: 19
Views: 17575

Re: [NOT SOLVABLE] Switches and parameters for creating task

If 1.vbs contains the hide.bat code in same folder as 1.bat:

schtasks /create /tn "Task2" /tr "%SystemDrive%\1\2\1.vbs %SystemDrive%\1\2\1.bat" /sc onlogon /rl highest /f
by carlsomo
27 Oct 2013 22:22
Forum: DOS Batch Forum
Topic: [SOLVED]Switches and parameters for creating tasks
Replies: 19
Views: 17575

Re: [NOT SOLVABLE] Switches and parameters for creating task

Try running hide.vbs with the batch file as parameter Hide.vbs: Const HIDDEN_WINDOW = 12 if WScript.Arguments.Count = 0 then WScript.Echo "Missing parameters" end if strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonat...
by carlsomo
23 Oct 2013 19:37
Forum: DOS Batch Forum
Topic: ReturnVar macro revisited
Replies: 30
Views: 27508

Re: ReturnVar macro revisited

When I remove eol^^= from the for loop 'set line' I get an error message: in was unexpected at this time. test3='"="' is displayed on enable/disable and enable/enable unless I single quote the **("!_#_$_safeReturn!")** in the for loop replacement line you suggested and use %%U ra...
by carlsomo
23 Oct 2013 19:04
Forum: DOS Batch Forum
Topic: ReturnVar macro revisited
Replies: 30
Views: 27508

Re: ReturnVar macro revisited

Dear jeb, To be quite honest I am working more from trial and error than intimate knowledge of the many nuances of the DOS interpreter. When something works I tend to stick with it and ask questions later when I attempt to optimize without screwing things up. My initial stab at this problem was to s...
by carlsomo
22 Oct 2013 22:45
Forum: DOS Batch Forum
Topic: How to create a option menu
Replies: 10
Views: 8842

Re: How to create a option menu

Here is a header format I like to use with menus :HEADER MODE CON: COLS=80 LINES=50 COLOR 1E SET DISPLYDT=10/22/2012 SET "DAYOFWK=TUESDAY " SET "DAYOFWK=%DAYOFWK:~0,9%" ECHO. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵ Menu Selection Utility ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ...
by carlsomo
22 Oct 2013 22:16
Forum: DOS Batch Forum
Topic: ReturnVar macro revisited
Replies: 30
Views: 27508

Re: ReturnVar macro revisited

This seems to work as long as someone does not use ascii dec 246 very often I presume you have more quirks to toss at me? **EDIT** took your advice and got rid of the _ndf requirement and tested after the endlocals, thx OUTPUT: F:\>set "test1=^a!"^b" F:\>set "test2=caret^" F...
by carlsomo
21 Oct 2013 20:49
Forum: DOS Batch Forum
Topic: ReturnVar macro revisited
Replies: 30
Views: 27508

Re: ReturnVar macro revisited

OK jeb, this is pure evil! To be fair, I think when %ReturnVar% is called then all the setlocals above it in the designated subroutine or bat should be accounted for in the %ReturnVar% 'call' I think I found a way to make it work, but it requires an extra step. _ndf should be set before the first se...
by carlsomo
20 Oct 2013 18:04
Forum: DOS Batch Forum
Topic: ReturnVar macro revisited
Replies: 30
Views: 27508

Re: ReturnVar macro revisited

OK, here's another crack at it: :TestReturnVar.bat @echo off setlocal DisableDelayedExpansion call :ReturnVar set "var=^a!"^^b" set var echo ------------------------- call :Test_Dis echo ------------------------- call :Test_Ena exit /b :Test_Ena echo Test #2 EDE setlocal enabledelayed...
by carlsomo
19 Oct 2013 14:49
Forum: DOS Batch Forum
Topic: ReturnVar macro revisited
Replies: 30
Views: 27508

ReturnVar macro revisited

A while back jeb came up with a ReturnVar Macro single that could return poison character strings across the endlocal barrier and worked with both enabled and disabled delayed expansion with a helper function that was required if called with expansion disabled. It could also handle CR and LineFeeds....
by carlsomo
21 Sep 2013 23:49
Forum: DOS Batch Forum
Topic: (nearly) ieee 754 floating point single precisition
Replies: 39
Views: 30260

Re: (nearly) ieee 754 floating point single precisition

Mode 1: @echo off&goto :start :RoundFP Float_Env precision if defined %~1 goto :end echo.RoundFP.CMD Float_Env precision echo.Rounds Float_Env to desired precison (ie 12.556 2, returns 12.56 in Float_Env) echo.Resets Float_Env to new precision if passed as an environment variable echo.If numeric...
by carlsomo
19 Sep 2013 19:26
Forum: DOS Batch Forum
Topic: (nearly) ieee 754 floating point single precisition
Replies: 39
Views: 30260

Re: (nearly) ieee 754 floating point single precisition

I have a pure batch rounding routine for decimal numbers, but must be expressed as: set "pi=3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086" roundfp.bat pi 100 echo %pi% 3.1415926535897932384626433832795028841971693993751058209...
by carlsomo
24 Aug 2013 01:00
Forum: DOS Batch Forum
Topic: Color function v20 patched
Replies: 14
Views: 26872

Re: Color function v20

##################
"Final Version 20"
##################

only had to hit a key to get back to prompt
by carlsomo
23 Aug 2013 23:27
Forum: DOS Batch Forum
Topic: Color function v20 patched
Replies: 14
Views: 26872

Re: Color function v20

Win7 64 bit gives same display as foxdrive win8 32 with \\'s
##################
\=\Final Version 20\=\
##################
by carlsomo
18 Aug 2013 10:50
Forum: DOS Batch Forum
Topic: Regional date format tool (DOS English)
Replies: 0
Views: 6123

Regional date format tool (DOS English)

This batch only script can be useful to obtain the regional date format as well as assign date variables. I have only tested it on Win7 64 bit I'm sure it would be easy to modify for other languages: @echo off&goto :start ::——————______________________——————:: :: :: ::——————| RegDateFmt.bat |———...
by carlsomo
10 Aug 2013 23:55
Forum: DOS Batch Forum
Topic: Question about %$Strlen% maco
Replies: 4
Views: 4562

Re: Question about %$Strlen% maco

BTW here is the latest version of GetVar.bat that can be called from command line or bat with or without delayed expansion enabled. I would like to come up with a macro version some day. ::——————______________________——————:: :: :: ::——————| GetVar Function |——————:: :: :: ::——————¯¯¯¯¯¯¯ by carl ¯¯...