Search found 125 matches

by elzooilogico
12 Mar 2018 04:48
Forum: DOS Batch Forum
Topic: How to create links in automatic?
Replies: 8
Views: 3901

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: 3356

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...
by elzooilogico
04 Mar 2018 07:45
Forum: DOS Batch Forum
Topic: Fastest copy for multiple gigs?
Replies: 6
Views: 3010

Re: Fastest copy for multiple gigs?

Are you running it from task shedule r? If the answer is no, skip this post. If yes, I've faced the same copying up a database of 3Gb from NAS Storage to an alternative server to perform a RESTORE over it. Both systems are Windows Server 2008R2. Either XCOPY or ROBOCOPY take more than an hour to cop...
by elzooilogico
03 Mar 2018 16:36
Forum: DOS Batch Forum
Topic: Combine Text Searches / Strings to a specified .cvs format
Replies: 6
Views: 3356

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

booga73 wrote:
03 Mar 2018 14:37
Elzooilogico,

That is very amazing; thank you for your support. Both outputs are good.

very respectfully,
Booga73
lucky you, this is something I faced before, so answer was pretty forward.

glad to see it helps, but next time I'd prefer you to show your efforts.
by elzooilogico
03 Mar 2018 11:42
Forum: DOS Batch Forum
Topic: Combine Text Searches / Strings to a specified .cvs format
Replies: 6
Views: 3356

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

for /f "tokens=7*" %a in ('findstr /c:"NIST SP 800-53 Revision 4 ::" test1.txt') do @echo %a %b for /f "tokens=9*" %a in ('findstr /c:"Vuln ID:" test1.txt') do @echo %a Hello DosTips, ... let findstr find the data. any time an id is found is stored in a var named ID[index] , where index , will be 1...
by elzooilogico
27 Feb 2018 14:08
Forum: DOS Batch Forum
Topic: Counter with batch
Replies: 5
Views: 2511

Re: Counter with batch

pieh-ejdsch wrote:
27 Feb 2018 10:26

Code: Select all

set a Counter=0
will create a varName like "a Counter" with Content is 0
Good catch! I totally miss that! :oops:
by elzooilogico
26 Feb 2018 15:22
Forum: DOS Batch Forum
Topic: Counter with batch
Replies: 5
Views: 2511

Re: Counter with batch

only a note

Code: Select all

set /a COUNTER+=1
is best practice. you don't need any expansion with set /a, and you can make one line calculations

Code: Select all

set /a counter+=1, test=counter%%3, …
.
this is always evaluated left to right, so the left variable reflects the new value of the right one
by elzooilogico
07 Feb 2018 09:23
Forum: DOS Batch Forum
Topic: Want to read a text file and do copy of the Files
Replies: 5
Views: 2847

Re: Want to read a text file and do copy of the Files

be sure two write UNC paths within quotes when using xcopy. or better use robocopy
by elzooilogico
07 Feb 2018 04:52
Forum: DOS Batch Forum
Topic: Want to read a text file and do copy of the Files
Replies: 5
Views: 2847

Re: Want to read a text file and do copy of the Files

Percent expansion is done before a code block is executed. you have set delayed expansion, but you are not using it.

change

Code: Select all

if NOT %errorlevel%==0 ( whatever )
to

Code: Select all

if !errorlevel! neq 0 ( whatever )
by elzooilogico
13 Jan 2018 05:05
Forum: DOS Batch Forum
Topic: removing dates from filenames
Replies: 8
Views: 3471

Re: removing dates from filenames

Simply add full paths to exe, source and destination files. give this a try (NOT TESTED) @echo off :: %~dp0 is the directory this script is run from, so change :: set "pdftotext=%~dp0pdftotext.exe" to whatever the actual location is (i.e) :: set "pdftotext=C:\Program Files (x86)\xpdf\pdftotext.exe" ...
by elzooilogico
11 Jan 2018 03:27
Forum: DOS Batch Forum
Topic: removing dates from filenames
Replies: 8
Views: 3471

Re: removing dates from filenames

if date is always 21 characters long (as in your example) smply remove the last 22 (date length + hyphen) characters from filename @echo off setlocal enableDelayedExpansion set /a dateLen=22 for /f %%v in ('dir /b') do ( set "file=%%~nv" & rem fetch filename only set "file=!file:~0,-%dateLen%!%%~xv"...
by elzooilogico
27 Dec 2017 04:17
Forum: DOS Batch Forum
Topic: Why use > at beginning of command line
Replies: 9
Views: 3999

Re: Why use > at beginning of command line

just a side note, any time a redirection is used within a block, the system opens and closes the file (or stream). for %%I in .... ( >>"somefile.txt" echo %%I ) but >>"somefile.txt" ( for %%I in .... ( echo %%I ) ) Opens the file/stream, processes all commands in the block, and then close the file/s...
by elzooilogico
19 Dec 2017 03:28
Forum: DOS Batch Forum
Topic: Generating .pdf files with batch?
Replies: 31
Views: 11711

Re: Generating .pdf files with batch?

Just a note about https://www.dostips.com/forum/viewtopic.php?p=55088#p55088 c:\>set "sDate=. " <----- note a space after the dot. c:\>set "iDate=1" c:\>for /F "tokens=1-6 delims=. :.," %a in ("18. 12. 2017,13:36:29,01") do ( if 1 == 0 (set mm=%a & set dd=%b & set yy=%c ) else if 1 == 1 (set dd=%a &...
by elzooilogico
09 Oct 2017 02:53
Forum: DOS Batch Forum
Topic: BLAT - Unable to configure
Replies: 8
Views: 4252

Re: BLAT - Unable to configure

NO, it doesn't. But, this link may help
USING BLAT, STUNNEL AND GMAIL TOGETHER