Search found 108 matches

by elzooilogico
17 Feb 2019 13:42
Forum: DOS Batch Forum
Topic: First read from file always fails
Replies: 3
Views: 357

Re: First read from file always fails

and more over, here simply

Code: Select all

echo(%%A
but, of course, details are not explicit
by elzooilogico
08 Feb 2019 13:47
Forum: DOS Batch Forum
Topic: Move file to folder based on part of file name
Replies: 4
Views: 330

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!
by elzooilogico
07 Feb 2019 08:44
Forum: DOS Batch Forum
Topic: Manage multiple databases services using batch script
Replies: 16
Views: 768

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"...
by elzooilogico
06 Feb 2019 06:19
Forum: DOS Batch Forum
Topic: Manage multiple databases services using batch script
Replies: 16
Views: 768

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...
by elzooilogico
05 Feb 2019 07:53
Forum: DOS Batch Forum
Topic: Manage multiple databases services using batch script
Replies: 16
Views: 768

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
please provide output for this
more also, you don't need an intermediate file, you can run the sc command in a for loop an fetch it's output
by elzooilogico
05 Feb 2019 06:32
Forum: DOS Batch Forum
Topic: Manage multiple databases services using batch script
Replies: 16
Views: 768

Re: Load multiple parameters from file

give this a try

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")
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
by elzooilogico
01 Aug 2018 05:24
Forum: DOS Batch Forum
Topic: Reading a hidden password via a FINDSTR bug
Replies: 10
Views: 1756

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 >...
by elzooilogico
20 May 2018 07:52
Forum: DOS Batch Forum
Topic: difficult starting cmd prompt with execution of two commands
Replies: 4
Views: 940

Re: difficult starting cmd prompt with execution of two commands

Code: Select all

start "" cmd /k "bla & bla & bla"
or

Code: Select all

start "" cmd "/k "bla &bla & bla""
cyquotation makes quite a difference. first quotes are window title
by elzooilogico
17 Mar 2018 03:48
Forum: DOS Batch Forum
Topic: Mask password with Asterisk
Replies: 11
Views: 2980

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...
by elzooilogico
14 Mar 2018 03:30
Forum: DOS Batch Forum
Topic: Is any way to insert blank lines in the text file?
Replies: 4
Views: 1141

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=%%...
by elzooilogico
12 Mar 2018 07:33
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 1715

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
by elzooilogico
12 Mar 2018 04:48
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 1715

Re: How to create links in automatic?

as a starting point here is a script that uses vbs to create links. you only need to tell createShortut the real data @ echo off SetLocal EnableDelayedExpansion EnableExtensions set "target=" & rem put here your real file (if empty this script will be used) set "description=" & rem put link descript...
by elzooilogico
04 Mar 2018 07:58
Forum: DOS Batch Forum
Topic: Combine Text Searches / Strings to a specified .cvs format
Replies: 6
Views: 1503

Re: Combine Text Searches / Strings to a specified .cvs format

@Antonio, I began with a script similar to yours, copying the contents of the test1.txt text file . Then I downloaded the test1.zip to test it against the real data. This file contains 146 IDs to parse, and (at least on my computer) notepad can't show 146 columns, it wraps lines, so result was a mes...