Search found 147 matches

by Rileyh
01 Nov 2011 21:51
Forum: DOS Batch Forum
Topic: breaking a "for" loop with conditions
Replies: 4
Views: 5537

breaking a "for" loop with conditions

Hi, I have the code: @echo off setlocal disableDelayedExpansion set file=test.txt" set "search=test" for /f "delims=" %%A in ('findstr /i /c:"%search%" %file%') do ( set "ln=%%A" echo %search% endlocal ) if not defined _"%ln%" (goto :error) :Bre...
by Rileyh
01 Nov 2011 21:00
Forum: DOS Batch Forum
Topic: Password generator script
Replies: 2
Views: 3889

Re: Password generator script

!k's script is useful, but you could make your threshold higher and make the script much simpler:

Code: Select all

@echo off
set /p user=Enter Username:
set pass=password
set "pass=%random%"
echo %pass% >password.txt
by Rileyh
01 Nov 2011 20:46
Forum: DOS Batch Forum
Topic: Change batch cmd size (pixels)
Replies: 2
Views: 4075

Change batch cmd size (pixels)

Hi, I know that there is a default size that cmd has in pixels), but is it possible to change the size from a batch file or command line? In taking a guess, I think it would be something like this: set "%size%=(randomnumberthatyouchoose) Am I right? Or is there another way that works? Regards, ...
by Rileyh
01 Nov 2011 18:52
Forum: DOS Batch Forum
Topic: PLEASE HELP ME!
Replies: 5
Views: 4713

Re: PLEASE HELP ME!

Thanks Ed but could you explain how this works in relation to my question?

Thanks again,
Rileyh
by Rileyh
31 Oct 2011 23:10
Forum: DOS Batch Forum
Topic: PLEASE HELP ME!
Replies: 5
Views: 4713

PLEASE HELP ME!

Here is my issue: I have a batch file with many repeats of this code: setlocal disableDelayedExpansion set file="%b%.txt" set "search=(randomtextstring)" for /f "delims=" %%A in ('findstr /i /c:"%search%" %file%') do ( set "ln=%%A" (somethingrandom) ...
by Rileyh
30 Oct 2011 21:55
Forum: DOS Batch Forum
Topic: how to set the next characters on a line as a variable
Replies: 5
Views: 5851

Re: how to set the next characters on a line as a variable

Thanks for the help.
Now, i noticed your strange syntax in regards to the "echo" section:

Code: Select all

echo(!ln:*%search%=!


Could you explain that to me?

Thanks again,
Rileyh
by Rileyh
30 Oct 2011 20:51
Forum: DOS Batch Forum
Topic: how to look for a defined string followed by anything
Replies: 0
Views: 5699

how to look for a defined string followed by anything

Hi I need to find out how to look for a defined string, but then look for anything. For example: for /f "tokens=* delims= " %%a in ('find /c /i "(defined string)" "test.txt"') do (something random) Now, the part I'm having a problem with is I can't figure out how to mak...
by Rileyh
30 Oct 2011 20:32
Forum: DOS Batch Forum
Topic: how to set the next characters on a line as a variable
Replies: 5
Views: 5851

Re: how to set the next characters on a line as a variable

Thanks for the string, but it didn't work. It echoed "hello" when the "search" variable" was set to "hello", instead of doing what it was supposed to do, which was echoing "world", since it occurred after "hello". Could you fix it? Regards, Rileyh
by Rileyh
30 Oct 2011 05:40
Forum: DOS Batch Forum
Topic: make batch file that write another file [solved]
Replies: 2
Views: 4287

Re: make batch file that write another file

Make the first occurrence of ">>" be ">". This means that it will make the file, instead of append to a file that does not exist. Then you can have the doubles: echo Set WshShell = CreateObject("WScript.Shell") >"%homepath%\desktop\test.vbs" echo WshShell.Run ...
by Rileyh
30 Oct 2011 05:19
Forum: DOS Batch Forum
Topic: how to set the next characters on a line as a variable
Replies: 5
Views: 5851

how to set the next characters on a line as a variable

Hi all, I want to know how to get a batch file to echo the characters that occur after a point but on the same line. The batch file needs to find a string of text and then echo the characters that occur on the same line, but after it from left to right. For example: (IN A TEXT FILE) Hello world The ...
by Rileyh
27 Oct 2011 23:09
Forum: DOS Batch Forum
Topic: SET commands
Replies: 8
Views: 6967

Re: SET commands

Peter, I do not quite understand what you are talking about when you mention "another cmd" There is only one cmd/command prompt, so what do you mean by that ? Secondly, what is the "%~"? Thirdly, what do you want this code to do? Is this an excerpt from a batch file or is it one ...
by Rileyh
26 Oct 2011 23:15
Forum: DOS Batch Forum
Topic: Help with making a command with defined syntax
Replies: 2
Views: 2956

Re: Help with making a command with defined syntax

@jeb,
I have previously tried to make this batch and it hasn't worked. I don't have the knowledge to code this sort of thing (yet :wink: )
Could you post a solution (code) for my problem, or else could you post examples/links to help on the forum, please?

Thank you in advance,
Rileyh
by Rileyh
26 Oct 2011 19:35
Forum: DOS Batch Forum
Topic: Post your most advanced script
Replies: 5
Views: 4583

Re: Post your most advanced script

Is this good enough (it is an extremely underfunctionable operating system im developing) @echo off setlocal ENABLEEXTENSIONS setlocal ENABLEDELAYEDEXPANSION title DOS 7 :. echo ===============Welcome to DOS 7.=============== timeout /t 2 /nobreak >nul set /p a=If this is your first time using DOS 7...
by Rileyh
26 Oct 2011 00:14
Forum: DOS Batch Forum
Topic: Post your most advanced script
Replies: 5
Views: 4583

Re: Post your most advanced script

Very advanced (looks even more advanced since I am a noob)
What do you mean by macro?
Could you email me the 400 kb script (email at bottom)


Great script,
Rileyh
by Rileyh
25 Oct 2011 18:58
Forum: DOS Batch Forum
Topic: Post your most advanced script
Replies: 5
Views: 4583

Post your most advanced script

Hi everyone, Out of interest, I would like to make this post to see what an ultra-advanced batch script would look like. A definition of "ultra-advanced" would be "the most versatile". It should be able to "do the most things". So post your script as a reply to this pos...