Search found 125 matches
- 13 Jul 2019 07:13
- Forum: DOS Batch Forum
- Topic: Printing problems
- Replies: 1
- Views: 3384
Re: Printing problems
not sure if it may help https://www.itprotoday.com/compute-engi ... and-prompt
- 08 Jul 2019 11:56
- Forum: DOS Batch Forum
- Topic: Months SCHTASKS
- Replies: 2
- Views: 3489
Re: Months SCHTASKS
please, write in english, though many of us have other native language, we use english in this site!
- 04 Jun 2019 00:06
- Forum: DOS Batch Forum
- Topic: Text Files - Coloured Characters
- Replies: 6
- Views: 4376
Re: Text Files - Coloured Characters
or you may try ansicon
- 17 Feb 2019 13:42
- Forum: DOS Batch Forum
- Topic: First read from file always fails
- Replies: 3
- Views: 1997
Re: First read from file always fails
and more over, here simply but, of course, details are not explicit
Code: Select all
echo(%%A
- 08 Feb 2019 13:47
- Forum: DOS Batch Forum
- Topic: Move file to folder based on part of file name
- Replies: 4
- Views: 1951
Re: Move file to folder based on part of file name
maybe misuse of string substitution, surf this place and tell us where you're stuck!
- 07 Feb 2019 08:44
- Forum: DOS Batch Forum
- Topic: Manage multiple databases services using batch script
- Replies: 16
- Views: 5580
Re: Load multiple parameters from file
think you are looking for this but, please ask what is your real task show us what have you tried as, we are here to help, not to do your own work now, you may also call the script with a param as scriptname "service_name" @echo off setlocal enabledelayedexpansion set "MyServiceName=Enter_Name_here"...
- 06 Feb 2019 06:19
- Forum: DOS Batch Forum
- Topic: Manage multiple databases services using batch script
- Replies: 16
- Views: 5580
Re: Load multiple parameters from file
Also, to avoid the intermediate file @echo off setlocal EnableDelayedExpansion set /a cnt=0 set "MyServiceName=Enter_Name_Here" for /f "tokens=1,* delims=: " %%G in ('sc query state^= all ^| find /I "SERVICE_NAME" ^| find /I "%MyServiceName%"') do (set /a cnt+=1 & set "param!cnt!=%%H") set param ech...
- 05 Feb 2019 07:53
- Forum: DOS Batch Forum
- Topic: Manage multiple databases services using batch script
- Replies: 16
- Views: 5580
Re: Load multiple parameters from file
Code: Select all
@echo off
setlocal enabledelayedexpansion
set /a cnt=0
for /f "delims== tokens=1" %%G in (%temp%\_list.log) do (set /a cnt+=1 & set "param!cnt!=%%G")
set param
more also, you don't need an intermediate file, you can run the sc command in a for loop an fetch it's output
- 05 Feb 2019 06:32
- Forum: DOS Batch Forum
- Topic: Manage multiple databases services using batch script
- Replies: 16
- Views: 5580
Re: Load multiple parameters from file
give this a try
You need delayed expansion as cnt is incremented within a code block
to know how many params have been loaded just see what's inside cnt
Code: Select all
setlocal enabledelayedexpansion
set /a cnt=0
for /f "delims== tokens=1" %%G in (%temp%\_list.log) do (set /a cnt+=1 & set "param!cnt!=%%G")
to know how many params have been loaded just see what's inside cnt
- 01 Aug 2018 05:24
- Forum: DOS Batch Forum
- Topic: Reading a hidden password via a FINDSTR bug
- Replies: 10
- Views: 5548
Re: Reading a hidden password via a FINDSTR bug
Nice find Antonio. :D Working in WIn 8 Enterprise. But the password is still accesible through the keyboard buffer (just hit the up arrow key). I would suggest clearing the buffer after password read @echo off setlocal set /P "=_" < NUL > "Enter password" findstr /A:1E /V "^$" "Enter password" NUL >...
- 20 May 2018 07:52
- Forum: DOS Batch Forum
- Topic: difficult starting cmd prompt with execution of two commands
- Replies: 4
- Views: 2500
Re: difficult starting cmd prompt with execution of two commands
Code: Select all
start "" cmd /k "bla & bla & bla"
Code: Select all
start "" cmd "/k "bla &bla & bla""
- 15 Apr 2018 04:58
- Forum: DOS Batch Forum
- Topic: ANSI.SYS on Windows 7 PC Ineffective - Recommentation?
- Replies: 7
- Views: 4647
Re: ANSI.SYS on Windows 7 PC Ineffective - Recommentation?
you may try ansicon developed by Jason Hood
- 17 Mar 2018 03:48
- Forum: DOS Batch Forum
- Topic: Mask password with Asterisk
- Replies: 11
- Views: 10040
Re: Mask password with Asterisk
Also, if using powershell is allowed @echo off SetLocal EnableDelayedExpansion EnableExtensions set/P user="* User: " call:getPass pass echo %user% %pass% EndLocal exit/B 1 :getPass SetLocal set "psCmd=powershell -Command "$pwd = read-host '* Password' -AsSecureString; $BSTR=[System.Runtime.InteropS...
- 14 Mar 2018 03:30
- Forum: DOS Batch Forum
- Topic: Is any way to insert blank lines in the text file?
- Replies: 4
- Views: 2358
Re: Is any way to insert blank lines in the text file?
supposed lines doesn't start with [ nor ] this should work for /F "tokens=1,* delims=[]" %%i in ('"type "%textfile%"|find /N /V """') do ( echo(%%j ) but, as you are doing string substitutions >"%newfile%" ( for /F "tokens=1,* delims=[]" %%i in ('"type "%textfile%"|find /N /V """') do ( set "line=%%...
- 12 Mar 2018 07:33
- Forum: DOS Batch Forum
- Topic: How to create links in automatic?
- Replies: 8
- Views: 3901
Re: How to create links in automatic?
the new link will overwrite the existing one (if you have enough permissions) see http://www.tek-tips.com/viewthread.cfm?qid=850335