Computer Hope

Microsoft => Microsoft DOS => Topic started by: macdad- on June 16, 2008, 06:24:50 AM

Title: Batch Programs Thread.
Post by: macdad- on June 16, 2008, 06:24:50 AM
Ok this continues off of the "i want to make a simple game in dos" thread. if you have some batch programs you would like to share and discuss about just post em in this thread.  :)

this isnt a help post, its where you post batch programs you've made if you want to share them.
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on June 16, 2008, 06:28:00 AM
I made this a while back.

Code: [Select]
Rock, Paper, Scissors!
@echo off
set tp=star
set uscore=0
set cscore=0
cls
:start
Title Rock paper scissors
COLOR f0
cls
echo.
echo. Computer score = %cscore%
echo. Your score =     %uscore%
echo.
Echo. Pick and type either 'rock' 'paper' or 'scissors' and press Enter
Set /p tp= :
if %tp% equ rock set g=1
if %tp% equ paper set g=2
if %tp% equ scissors set g=3
Set /a Number=(%Random% %%3)+1
If %Number% equ 1 set h=rock
If %Number% equ 2 set h=paper
If %Number% equ 3 set h=scissors
if %h% equ rock set a=1
if %h% equ paper set a=2
if %h% equ scissors set a=3
if %a% equ %g% goto tie
if %a%%g% equ 13 goto lost
if %a%%g% equ 21 goto lost
if %a%%g% equ 32 goto lost
if %a%%g% equ 12 goto winner
if %a%%g% equ 23 goto winner
if %a%%g% equ 31 goto winner
if /i %tp% EQU rosk (
Title WINNER!
set /a uscore=%uscore%+1
cls
echo.
Echo. Your Guess was rock and I picked scissors. That meens you won!
echo.
echo.
pause
goto start
)
if /i %tp%==star goto :wtfno
else (
:wtfno
cls
echo.
echo. You didn't choose anything.
echo.
echo. Please type either 'rock' 'paper' or 'scissors' and
echo. press Enter.
echo.
echo.Press any key to start playing again. . .
pause > nul
goto :start
)

:winner
Title WINNER!
set /a uscore=%uscore%+1
cls
echo.
Echo. Your Guess was %tp% and I picked %h%. That meens you won!
echo.
echo.
pause
goto start

: tie
Title TIE
cls
echo.
Echo. Your Guess was %tp% and I picked %h%. That meens we tied
echo.
echo.
pause
goto start

: lost
Title LOST!
set /a cscore=%cscore%+1
cls
echo.
Echo. You picked %tp% and I picked %H% so I won!
echo.
echo.
pause
goto start
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on June 16, 2008, 06:31:06 AM
Here's another one. It's pretty fun. Something to do when you're bored.

Play it out to the end. Not that hard.

Code: [Select]
@echo off
color f0
cls
@echo off
setlocal
title Guessing Game Small Version
:startggs
cls
set /A MyNumber="(%Random% %%1000) + 1"
set /A NumGuess=0
echo You have to guess a number in the range 1 to 1000
echo I will for each guess tell you if the number is to small
echo or to large                  
echo.
:Nextggs
set /P Guess="Enter a number> "
set /A NumGuess+=1
if %Guess% EQU %MyNumber% goto :Winggs
if %Guess% LSS %MyNumber% echo Your number is to small
if %Guess% EQU 815 goto :winggs
if %Guess% GTR %MyNumber% echo Your number is to large
if /I %guess%==back goto :1
if %guess%==back goto :1
goto :Nextggs

:Winggs
echo Congratulations you guessed the numer in %NumGuess% tries
set /P Answer="Do you want to try again [y/n]> "
if [%Answer%]==[y] goto :startggs
if {%Answer%}=={n} goto :1
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on June 16, 2008, 06:33:59 AM
And this one here:
http://www.computerhope.com/forum/index.php/topic,29824.0.html

That was made by my friends friend (CH Name = Jargee)

He's the one who showed me to ComputerHope.

I like his game though, very entertaining.
Title: Re: Batch Programs Thread.
Post by: macdad- on June 16, 2008, 06:35:57 AM
that seems like a spinoff of my DOS Cards game but its cool. 8)

oh yea i finished my second version of Sys Stat version 2.0.1 with alot
of new features. plz dont copyright!

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on June 16, 2008, 06:40:06 AM
Not bad. Definitely something I will keep in my Batch folder.   :P
Title: Re: Batch Programs Thread.
Post by: devcom on June 16, 2008, 07:29:22 AM
very old project.it was in old topic but ill post it here

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Fen_Li on June 16, 2008, 12:42:38 PM
nice thread.. ;)
i hope moderator stick this thread.. ::)

i also have a program to make Pascal's Triangle :
Code: [Select]
@echo off
setlocal ENABLEDELAYEDEXPANSION
Title Pascal's Triangle
:Begin
cls
(set n=)
set /p "n=Input (?? Lines) : "
if not defined n goto :Begin
(set /a nspace=n-1)
(set temp_var=!nspace!)
for /L %%a in (1,1,!n!) do (
for /L %%n in (1,1,!nspace!) do (
for /F "Delims=" %%s in ('echo. ') do <nul set /p "=%%s"
)
(set /a nspace-=1)
(set Bil[%%a][1]=1)
(set Bil[%%a][%%a]=1)
if %%a gtr 2 for /L %%x in (2,1,!temp_var!) do (
set /a "prev=%%a-1"
set /a "prev_coloum=%%x-1"
call set "temp_1=%%Bil[!prev!][!prev_coloum!]%%"
call set "temp_2=%%Bil[!prev!][%%x]%%"
set /a "Bil[%%a][%%x]=temp_1+temp_2"
)
for /L %%b in (1,1,%%a) do <nul set /p "=!Bil[%%a][%%b]! "
echo.
)
pause>nul
goto :Begin
:END
try that..
 ;D
Title: Re: Batch Programs Thread.
Post by: devcom on June 16, 2008, 01:01:49 PM
wow i like this one mate ;) i've made sth like this but it make pytagoras trees and count time wich program spend to make them ;)
Title: Re: Batch Programs Thread.
Post by: Fen_Li on June 16, 2008, 01:15:59 PM
again..
originally from me.. ;D ??? :o

a program called "Process Manager".
like a "Windows task Manager"..

Code: [Select]
@echo off
mode 33,25
setlocal ENABLEDELAYEDEXPANSION
Title Process Manager
:Begin
CD /D "!TEMP!"
set "TASKLIST=%windir%\system32\tasklist.exe"
set "FIND=%windir%\system32\find.exe"
set "wmic=%windir%\System32\Wbem\wmic.exe"
set "Explore=%windir%\explorer.exe"

:Reload
cls
set num=0
echo.________________________________
echo.[ Process Name ]         [ PID ]
echo.--------------------------------
if not defined NAME set NAME=%USERNAME%
!TASKLIST! /FI "USERNAME eq !NAME!" /FO TABLE /NH >"plist.txt"
for /f "tokens=*" %%a in (plist.txt) do (
set /a num+=1
set "list=%%a"
set "list=!list:~0,32!"
echo.!list!
)
echo.________________________________
Del /f /q "plist.txt" >nul 2>&1
Title !NAME! - [!num!] Process Running.
if not defined ac (
if /i "!NAME!"=="%USERNAME%" goto :USR
if /i "!NAME!"=="SYSTEM" goto :SYS
)
if /i "!ac!"=="K" goto :Kill
if /i "!ac!"=="S" goto :SYSTEM
if /i "!ac!"=="U" goto :USER
if /i "!ac!"=="E" goto :Explore
set "ac="
GOTO :Reload

:USER
set "NAME="
set "ac="
GOTO :Reload
:USR
echo.CH : K=Kill, S=System, E=Explore
set /p "ac=Action : "
GOTO :Reload

:SYSTEM
set NAME=SYSTEM
set "ac="
GOTO :Reload
:SYS
echo.CH : K=Kill, U=User, E=Explore
set /p "ac=Action : "
GOTO :Reload

:Kill
echo.Type PID to Kill..
set "ac="
set /p "PID=PID : "
if not defined PID goto :Reload
Taskkill /F /PID !PID! >nul 2>&1
if errorlevel 1 (echo.No Task Running w/ this PID.) else (
if !PID! geq 0 if !PID! lss 10 (
echo.Can't kill Critical Process
goto :clr_var2
) else (
echo.Success : Task with PID=!PID!
echo.          has been KILLED..
))
:clr_var2
set "ac="
set "PID="
PAUSE>NUL
GOTO :Reload

:Explore
echo.Type PID to Explore..
set "ac="
set /p "PID=PID : "
if not defined PID goto :Reload
if !PID! lss 10 goto :clr_var
if !PID! gtr 10000 goto :clr_var
!wmic! process get ProcessID,ExecutablePath >"path.txt"
for /f "tokens=1,2 delims= " %%a in ('type "path.txt" ^| !FIND! " !PID! "') do (
set "exepath=%%~dpa"
)
if not defined exepath (
echo.No Task Running w/ this PID.
PAUSE>NUL
) else (START !Explore! "!exepath!")
:clr_var
set "PID="
set "exepath="
Del /f /q "path.txt" >nul 2>&1
GOTO :Reload

:END

note : u must RUN under Windows XP Professional (service pack 2 recomended).
Title: Re: Batch Programs Thread.
Post by: macdad- on June 16, 2008, 03:47:38 PM
hey devcom i never was able to move the x around in Shoot. could you help me with that?

thanks carbon, i have been working on that for a while and debugged it so thanks for your appreciation. :)
Title: Re: Batch Programs Thread.
Post by: devcom on June 17, 2008, 05:21:25 AM
explain it more coz i dont know what you mean with 'x'
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on June 17, 2008, 05:25:05 AM
explain it more coz i dont know what you mean with 'x'
Where?
Title: Re: Batch Programs Thread.
Post by: macdad- on June 17, 2008, 06:57:07 AM
sorry i meant on that Move game you made
Title: Re: Batch Programs Thread.
Post by: devcom on June 17, 2008, 07:11:39 AM
well i think you dont have choice.exe becouse it use it to move smother than typeing single letter and press enter.
here is a link to choice.exe
http://hp.vector.co.jp/authors/VA007219/dkclonesup/choice.html
simply put it to C:\windows\system32
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on June 17, 2008, 07:51:51 AM
sorry i meant on that Move game you made
Wah?  ???
Title: Re: Batch Programs Thread.
Post by: macdad- on June 17, 2008, 04:21:54 PM
it was a game Dev made a while back. Oh and everyone this thread is now sticky!  ;D

Dev i downloaded Choice.exe into my system32 fldr and played Move yet i still cant get the X to move?  ???
Title: Re: Batch Programs Thread.
Post by: devcom on June 19, 2008, 04:10:03 AM
you used this link ?
http://my.vector.co.jp/servlet/System.FileDownload/download/http/0/349380/pack/win95/util/bat/dkclonesup.zip
and here is new ver

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 19, 2008, 05:58:24 AM
Hey devcom PM your email address to me so we can start that game that we had in mind

I still think it is worth it.

Regards,
Tan_Za
Title: Re: Batch Programs Thread.
Post by: macdad- on June 19, 2008, 06:15:01 AM
ok i installed the new version of choice yet i still cant move the X
Title: Re: Batch Programs Thread.
Post by: devcom on June 19, 2008, 08:41:23 AM
well i now know whats the problem. You have downloaded a Windows 98 version of choice, but you must have the new one. here is the link to choice from my vista os:
http://www.speedyshare.com/866831882.html
but if this even will dont work try to instal that old one and change all
ex.
Code: [Select]
choice /C 12 >nulto
Code: [Select]
choice /C:12 >nul
hope that helps
Title: Re: Batch Programs Thread.
Post by: macdad- on June 19, 2008, 04:18:01 PM
ok the choice software link you gave me before this one had a NT version of choice (My comp's os is Win 2k) so thats not the prob and i changed the choice part of the code to this

Code: [Select]
choice /C:daswnl /T 1 /D n >nul
(this was the actual choice code in the game without the colon)

yet it still is preventing me from moving the x.
but so far thanks for the help.  :)
Title: Re: Batch Programs Thread.
Post by: devcom on June 20, 2008, 06:33:34 AM
Code: [Select]
choice.com & choice.exe for Windows NT/2000/XP


Waits for the user to choose one of a set of choices.
If the user presses a key that is not among the keys you assigned,
Choice sounds a warning beep.

CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N           Do not display choices and ? at end of prompt string.
/S           Treat choice keys as case sensitive.
/T[:]c,nn    Default choice to c after nn seconds
text         Prompt string to display
try this one
Code: [Select]
choice /C:daswnl /T:n,1 >nul
Title: Re: Batch Programs Thread.
Post by: macdad- on June 20, 2008, 03:36:50 PM
thanks dev it works now.  ;D
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 21, 2008, 03:31:36 AM
Hey Dev post the game with the moving X, cause I don't know what you guys are talking about

Thanks,
Tan_Za
Title: Re: Batch Programs Thread.
Post by: devcom on June 21, 2008, 06:25:23 AM
i have posted it in #17 post in this thread. i knw there are alot of bugs but ive stoped making this game coz i dont have ideas
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 22, 2008, 03:37:08 AM
For mine I can not even get past the login or create part of your game for some odd reason??

help would be good,
Tan_Za
Title: Re: Batch Programs Thread.
Post by: devcom on June 23, 2008, 07:45:32 AM
Well we was talking 'bout this with macdad- but you can download that choice.exe in link that i've uploaded to speedyshare
Title: Re: Batch Programs Thread.
Post by: macdad- on June 23, 2008, 03:45:42 PM
dev your move game just sparked an idea, for a new DOS game. it'll be fun but it'll take a while, i'll be back in a few days with it. (you will be in the special thanks on the about menu, same for you Tanza)
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 24, 2008, 02:29:25 AM
Ok ill try Devcom oh and thanks Macdad

Regards,
Tan_Za
Title: Re: Batch Programs Thread.
Post by: devcom on June 24, 2008, 02:08:07 PM
What it will 'bout ?
Title: Re: Batch Programs Thread.
Post by: macdad- on June 24, 2008, 03:28:08 PM
tanza i dont know if you got my email, but your cheese game is infected with a trojan. my guess is it attached itself to your cheese game while the email was surfing the net.
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 25, 2008, 02:02:34 AM
OMG you serious that really sucks ****!!! I will be post in about 10 days a game made in batch called Monster Domain.

THX,
Tan_Za
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 25, 2008, 02:17:38 AM
Oh yeah and Dev your game still does not work with my computer for some reason. It can read choice but not errorlevel.

Help,
Tan_Za
Title: Re: Batch Programs Thread.
Post by: devcom on June 25, 2008, 03:46:38 AM
well i dont have idea for errorlevel. what os you have ?
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 25, 2008, 05:25:04 AM
I have got windows XP
Title: Re: Batch Programs Thread.
Post by: devcom on June 25, 2008, 08:58:51 AM
so you must have errorlevel. when it crash?
Title: Re: Batch Programs Thread.
Post by: Tan_Za on June 26, 2008, 02:18:31 AM
No it doesn't crash it just doesn't want to work?

Tan_Za
Title: Re: Batch Programs Thread.
Post by: devcom on July 15, 2008, 02:09:35 PM
my new games based on old games i think it was on amiga
choice.exe included so you can use it in your games

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on July 15, 2008, 03:46:27 PM
that was pretty fun. and very advanced for a batch game. Good Work!  :)
Title: Re: Batch Programs Thread.
Post by: devcom on July 15, 2008, 04:17:17 PM
thanks mate ;) im wating for your games guys  ;D
Title: Re: Batch Programs Thread.
Post by: macdad- on July 15, 2008, 04:20:32 PM
well i have two different projects going on at once. the first is that im making a 3D Star Fox game for pc, but im not making it in batch(of course) and the second is my Dos Waveboarder Game which is a challenge, i'll hopefully be done before school starts.

Title: Re: Batch Programs Thread.
Post by: devcom on July 18, 2008, 03:50:57 AM
i would see experts like Dias de verano or Sidewinder making games ;)
Title: Re: Batch Programs Thread.
Post by: macdad- on July 18, 2008, 05:41:04 AM
yea Dias needs to try to make some really good FPS, or forget FPS and make MGS(for the pc) lol
Title: Re: Batch Programs Thread.
Post by: !~*:.Pink Floyd.:*~! on July 21, 2008, 11:58:40 AM
can I get a list of Batch commands?
Title: Re: Batch Programs Thread.
Post by: macdad- on July 21, 2008, 04:26:23 PM
This (http://www.computerhope.com/msdos.htm#02) is were you will find them
Title: Re: Batch Programs Thread.
Post by: devcom on July 23, 2008, 08:43:25 AM
heh and again my little project
based on and inspired by
Code: [Select]
http://www.zimm-co.com/PressTheSpaceBar/pressthespacebar2000.html
[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on July 23, 2008, 04:48:05 PM
thats pretty cool. to see how many time you can press space in a certain amount of time, it would be interesting to see it determine how many times you can click the mouse button, you'd probably need an outside program to do that. but my friend Gauge is a speed demon on the mouse, he can click it 5 times in a second!
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on July 23, 2008, 06:56:00 PM
I just wrote a program to test my clicking abilities, and I managed to average 9 clicks per second for about 20 seconds. My hand hurts now though.
Title: Re: Batch Programs Thread.
Post by: Lan Zeird on August 04, 2008, 01:43:41 AM
sori macdad i cant help im not familiar with batch programs thread

hope i can help you next time
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on August 04, 2008, 10:08:16 AM
sori macdad i cant help im not familiar with batch programs thread

hope i can help you next time
Definitely new here... ::)
Title: Re: Batch Programs Thread.
Post by: Dias de verano on August 04, 2008, 11:09:45 AM
sori macdad i cant help im not familiar with batch programs thread

hope i can help you next time
Definitely new here... ::)

A spammer with a "earn cash from the web" link in his sig.

Reported.

Lan Zeird, what would your "heroes", namely "My parents and Jesus"  ::) think of your spamming of forums with useless pretend answers just so you can get people to look at your scam/spam link?

Title: Re: Batch Programs Thread.
Post by: macdad- on August 05, 2008, 03:56:47 PM
sori macdad i cant help im not familiar with batch programs thread

hope i can help you next time

this isnt a help post, its where you post batch programs you've made if you want to share them. didnt you read the first post on this topic.

Ok this continues off of the "i want to make a simple game in dos" thread. if you have some batch programs you would like to share and discuss about just post em in this thread.  :)


And you probably created your account to Advertise for the scam. You didnt want to post in this thread but just to advertise, you dont know squat about DOS. Cheapo.


sori macdad i cant help im not familiar with batch programs thread

hope i can help you next time
Definitely new here... ::)

A spammer with a "earn cash from the web" link in his sig.

Reported.

Lan Zeird, what would your "heroes", namely "My parents and Jesus"  ::) think of your spamming of forums with useless pretend answers just so you can get people to look at your scam/spam link?


Title: Re: Batch Programs Thread.
Post by: !~*:.Pink Floyd.:*~! on August 07, 2008, 12:03:29 PM
sori macdad i cant help im not familiar with batch programs thread

hope i can help you next time

Dont click on that link In his sig.

I swear to god I have a virus now.

Or something my broswer was acting funny.
Title: Re: Batch Programs Thread.
Post by: kpac on August 07, 2008, 12:47:36 PM
Sorry, your browser must have been acting funny....

Seems fine to me.... Just your average online money-making website....
Title: Re: Batch Programs Thread.
Post by: !~*:.Pink Floyd.:*~! on August 10, 2008, 10:28:23 AM
Sorry, your browser must have been acting funny....

Seems fine to me.... Just your average online money-making website....
which doesnt work.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on August 17, 2008, 01:59:15 PM
Sorry, your browser must have been acting funny....

Seems fine to me.... Just your average online money-making website....
which doesnt work.
oh NOW you tell me! I already sent half my savings!
Title: Re: Batch Programs Thread.
Post by: macdad- on August 18, 2008, 03:52:06 PM
to bad that anti-virus programs cant scan websites for viruses before you access them, that would make it much less worry-some  ;)
Title: Re: Batch Programs Thread.
Post by: devcom on August 19, 2008, 04:32:08 PM
simple file explorer, known bugs ;)

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on August 23, 2008, 07:58:35 AM
thats awesome dev. but it needed a tweak
Code: [Select]
choice /C:wsdafjo >nul it needed the colon cuz cmd was just flashing without the colon
Title: Re: Batch Programs Thread.
Post by: Sky Ninja on August 23, 2008, 08:28:50 PM
It still just flashes for me, but I think that it's because choice doesn't work on XP.
Anyway, I made a batch program that generates a random level name for the game SRB2. Someone else made a similar program, but in C++. ::)
Code: [Select]
::Batch file designed by Sky Ninja
@echo off
set base=none
set sec=none
color 1f
title SRB2 Level Name Generator
:start:
cls
set /a g=(%random% %%15)+1
if %g% equ 1 set base=Green
if %g% equ 2 set base=Glowing
if %g% equ 3 set base=Egg
if %g% equ 4 set base=Clover
if %g% equ 5 set base=Lunar
if %g% equ 6 set base=Radiant
if %g% equ 7 set base=Hidden
if %g% equ 8 set base=Flaming
if %g% equ 9 set base=Frozen
if %g% equ 10 set base=Dark
if %g% equ 11 set base=Sandy
if %g% equ 12 set base=Final
if %g% equ 13 set base=Lost
if %g% equ 14 set base=Fatal
if %g% equ 15 set base=Weapons
set /a h=(%random% %%10)+1
if %h% equ 1 set sec=Hill
if %h% equ 2 set sec=Shrine
if %h% equ 3 set sec=Factory
if %h% equ 4 set sec=Base
if %h% equ 5 set sec=City
if %h% equ 6 set sec=Field
if %h% equ 7 set sec=Dunes
if %h% equ 8 set sec=Mountain
if %h% equ 9 set sec=Core
if %h% equ 10 set sec=Attack
echo. Your level is...
echo %base% %sec% Zone>>"C:\Documents and Settings\%username%\My Documents\LevelNameGen.txt"
echo. %base% %sec% Zone
echo. 
echo. Generate another? (y/n)
Set /p yn= :
if %yn% equ y goto start
if %yn% equ n exit
Title: Re: Batch Programs Thread.
Post by: fireballs on August 24, 2008, 02:07:30 AM
inspired by devcom i made a file explorer.
Code: [Select]
@echo off
mode con lines=20 cols=60
:start
cls
echo you are here: %CD%
echo.
echo.Up?            -W
echo.Open?          -A
echo.Search?        -S
echo.Enter address? -D
echo.Quit           -Q
echo.CMD?           -Z
echo.rename?        -R
echo.copy?          -c
choice /c "WADQSRZC">Nul
if errorlevel 8 goto C
if errorlevel 7 goto Z
if errorlevel 6 goto R
if errorlevel 5 goto S
if errorlevel 4 goto Q
if errorlevel 3 goto D
if errorlevel 2 goto A
if errorlevel 1 goto W
echo error!!!
pause
exit

:C
echo.
set /p OR=what do you want to copy?
if "%OR%"=="back" goto start
set /p nom= where to?
copy %OR% %nom%
goto start

:D
echo.
set /p add=where do you want to go?
if "%add%"=="back" goto start
cd %add%
goto start

:W
cd..
goto start

:A
echo.
dir /a:-d /b
echo.
set /p add=what do you want to run?
if "%add%"=="back" goto start
start "" %add%
goto start

:Q
echo bye
exit

:S
set /p OR=where do you want to search?
if "%OR%"=="back" goto start
set /p add=what do you want to search for?
where /R %OR% "%add%"
pause
goto start

:R
set /p OR=what would you like to rename?
if "%OR%"=="back" goto start
set /p nom=rename to what?
ren %OR% %nom%
goto start

:Z
set /p add=%CD%^>
if "%add%"=="back" goto start
%add%
pause
goto start
Title: Re: Batch Programs Thread.
Post by: devcom on August 24, 2008, 08:49:05 AM
ok ive attached file and should work for all now even on xp ;)

EDIT:
try now

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Sky Ninja on August 24, 2008, 09:10:16 AM
Nope. Choice in not recognised as a valid win32 application. It tries to work, but choice is uncompatable.
Title: Re: Batch Programs Thread.
Post by: devcom on August 25, 2008, 11:50:46 AM
c'mon guys post your 'things' ;)
Title: Re: Batch Programs Thread.
Post by: fireballs on August 25, 2008, 01:04:01 PM
... you want to see my 'thing'... usually i'd wait until after the first date but seeing as you asked so politely.... ;)

FB
Title: Re: Batch Programs Thread.
Post by: devcom on August 25, 2008, 03:31:47 PM
Quote
... you want to see my 'thing'... usually i'd wait until after the first date but seeing as you asked so politely....
lol :D

here is link to my file ex should work on XP to now

http://www.computerhope.com/forum/index.php?action=dlattach;topic=59426.0;attach=5360 (http://www.computerhope.com/forum/index.php?action=dlattach;topic=59426.0;attach=5360)
Title: Re: Batch Programs Thread.
Post by: fireballs on August 25, 2008, 03:39:19 PM
I can't get the file ex to work. I am using vista but it just displays a message blinks then displays the same message like it's in a loop.

I still prefer my version ;)

FB
Title: Re: Batch Programs Thread.
Post by: macdad- on August 25, 2008, 03:51:35 PM
add a colon between the /C and the wsdafjo on this line like this
Code: [Select]
choice /C:wsdafjo >nul
Title: Re: Batch Programs Thread.
Post by: devcom on August 25, 2008, 03:57:28 PM
thats imposible becouse ive copied.exe choice from windows\system32 so it should work normal, and better that pressing for ex. a and then enter each time

and about that colon it works for me without and well i will add it in future scripts
Title: Re: Batch Programs Thread.
Post by: fireballs on August 25, 2008, 04:02:20 PM
after putting in .../c:w... i get an error on this line:
Quote
for /F "delims=? skip=%nnum%" %%L in ('dir /B /A:D %cd%') do (
cd %%L
goto CD
)

saying
Quote
" was unexpected at this time.

FB
Title: Re: Batch Programs Thread.
Post by: macdad- on August 25, 2008, 04:04:03 PM
huh....the only prob i had was the blinking on the choice command and the colon solved the prob. I have Windows 2000 Pro but i didnt have a problem on that line.
Title: Re: Batch Programs Thread.
Post by: devcom on August 25, 2008, 04:15:10 PM
try to change
Code: [Select]
if %cnum% equ 1 (
for /F "delims=?" %%L in ('dir /B /A:D %cd%') do (
cd %%L
goto CD
)
)
to
Code: [Select]
if %cnum% leq 1 (
for /F "delims=?" %%L in ('dir /B /A:D %cd%') do (
cd %%L
goto CD
)
)

i think you are trying to go in higher dir when there isnt higher dir
Title: Re: Batch Programs Thread.
Post by: fireballs on August 25, 2008, 04:21:12 PM
at least mine works  :P :P

FB
Title: Re: Batch Programs Thread.
Post by: Sky Ninja on August 26, 2008, 05:12:43 PM
Choice doesn't work on XP.
Quote
Microsoft Windows 2000 and Windows XP users who have batch files that utilize the choice command should modify the batch file to use the MS-DOS set command.
Title: Re: Batch Programs Thread.
Post by: macdad- on August 26, 2008, 07:35:16 PM
well it works for me, i have both CHOICE.COM and choice.exe in my system32 folder.
Title: Re: Batch Programs Thread.
Post by: devcom on August 27, 2008, 04:10:24 AM
Choice doesn't work on XP.
Quote
Microsoft Windows 2000 and Windows XP users who have batch files that utilize the choice command should modify the batch file to use the MS-DOS set command.

it works if you add choice.exe to your program folder and then use
Code: [Select]
choice.exe [commands]
Title: Re: Batch Programs Thread.
Post by: Sky Ninja on August 27, 2008, 11:02:54 PM
That doesn't work for me. I'm getting that choice is not a valid win32 app. The choice.exeis not compatable for me.
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on August 28, 2008, 02:51:26 AM
this isnt a help post, its where you post batch programs you've made if you want to share them.

 ::) ::) ::)
Title: Re: Batch Programs Thread.
Post by: macdad- on August 28, 2008, 04:26:32 PM
thanks Carbon.

Sky please post about this outside this thread.
Title: Re: Batch Programs Thread.
Post by: fireballs on August 28, 2008, 04:49:19 PM
to get this thread back on topic.... this is a hacking sim that i wrote yers ago. It's half finished so i appologise for the bugs but the basics are there.

BTW if you use the exit command it will close all open CMD.exe windows. appologies but i couldn't get the "title=" filter to work.

FB

[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on August 28, 2008, 04:52:36 PM
cool. but i dont know wat its supposed to do  ???
Title: Re: Batch Programs Thread.
Post by: fireballs on August 28, 2008, 04:59:41 PM
it's a hacking sim, have you ever seen  Uplink? (http://www.introversion.co.uk/uplink/) it's a brilliant hacking sim game but it's far to reliant on mouse movements so i built this one which is only run by keyboard strokes.

You just go through hacking stuff stealing files, implanting viruses etc.

FB
Title: Re: Batch Programs Thread.
Post by: devcom on August 29, 2008, 05:37:26 AM
nice one but, there is gigant mess in code for ex.

why not change this:
Code: [Select]
echo downloading \\server\My_Uplink.exe
echo please wait 0%%
ping -n 2 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 4%%
ping -n 2 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 17%%
ping -n 3 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 24%%
ping -n 2 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 56%%
ping -n 4 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 61%%
ping -n 3 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 79%%
ping -n 3 127.0.0.1>Nul
cls
echo downloading \\server\My_Uplink.exe
echo please wait 100%%
ping -n 4 127.0.0.1>Nul

to this:
Code: [Select]
for %%C in (0 4 17 24 56 61 79 100) do (
echo downloading \\server\My_Uplink.exe
echo please wait %%C%%
ping -n 2 127.0.0.1>Nul
cls
)

alot to improve imo ;) but anyway its cool ;)
Title: Re: Batch Programs Thread.
Post by: fireballs on August 29, 2008, 05:43:50 AM
you're right. Like i said i wrote it years ago when i was less profficient with DOS. I'll go about changing it when i get back.

FB
Title: Re: Batch Programs Thread.
Post by: devcom on August 30, 2008, 01:01:09 PM
i've made new cmd.exe  8) alot code improvment ;) and size is only 57b ;)

Code: [Select]
@echo off
cmd
:LOOP
set /p cmd=%cd%>
%cmd%
goto LOOP
Title: Re: Batch Programs Thread.
Post by: macdad- on August 30, 2008, 02:25:58 PM
didnt work it just blinked
Title: Re: Batch Programs Thread.
Post by: devcom on August 30, 2008, 04:54:02 PM
try without cmd command
Title: Re: Batch Programs Thread.
Post by: macdad- on August 30, 2008, 06:16:36 PM
it opened up cmd to execute the program and then it just quit.
Title: Re: Batch Programs Thread.
Post by: devcom on August 31, 2008, 05:06:15 AM
Code: [Select]
@echo off
cmd
:LOOP
set /p cmd=%cd%>
%cmd%
goto LOOP

save this as a.bat and double click on it
Title: Re: Batch Programs Thread.
Post by: macdad- on August 31, 2008, 09:49:54 AM
ok now it works.
Title: Re: Batch Programs Thread.
Post by: devcom on September 07, 2008, 10:28:55 AM
here is my game tru FTP for 2 players. it's not done yet becouse i have no idea what would be good here, anyway first you must start CONFIG_CONNCECTION.bat in TOOLS folder on booth computers to configure connection ;) move is WASD

any comments would be good ;)



[recovering disk space -- attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on September 08, 2008, 02:54:47 PM
HOLY CRAP!

Multiplayer game through FTP! Devcom 10/10! A++ it all works execept a. i wish i had another computer to play against. but o well! Execellent Work Dev!
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on September 08, 2008, 07:27:38 PM
HOLY CRAP!

Multiplayer game through FTP! Devcom 10/10! A++ it all works execept a. i wish i had another computer to play against. but o well! Execellent Work Dev!

are we still talking about batch? I mostly use it for file management tasks, and even then I can barely be bothered to actually make a batch file (mostly using for and such on the command line.). I'm surprised it can even be used for games, since games are in general interactive and don't execute their commands in a batch.


Now it just needs to be updated to use TCP/IP!
Title: Re: Batch Programs Thread.
Post by: devcom on September 09, 2008, 06:56:25 AM
yeah thanks   ;D

Quote
Now it just needs to be updated to use TCP/IP!

i thing without another program created in c++ or sth its imposible ;)
Title: Re: Batch Programs Thread.
Post by: fireballs on September 09, 2008, 08:58:46 AM
are we still talking about batch?

This is the batch programs thread!

I'm surprised it can even be used for games, since games are in general interactive and don't execute their commands in a batch.

I don't suppose you remember the 1980-90's when almost all games were made for dos?

FB
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on September 09, 2008, 02:10:32 PM
This is the batch programs thread!
u got me. I concede.
I don't suppose you remember the 1980-90's when almost all games were made for dos?
If I recall correctly, those programs were written in "real" programming languages(usually a mix of ASM and C). Batch programs at that point in time where just that- they didn't have a lot of the constructs and such they have now (except of course for the for command, which has been expanded quite a lot since). Warranted, games could be constructed with batch, but even a simple guessing game required kludges- and since you couldn't perform numeric comparisons it became a bit difficult to add hints like "higher" and "lower" if desired.
Title: Re: Batch Programs Thread.
Post by: macdad- on September 09, 2008, 03:04:53 PM
thats true but im just amazed about dev's program because it was written in batch. and good idea of breaking the components of the program down into modules(it makes debugging much easier  ;) )
Title: Re: Batch Programs Thread.
Post by: Jacob on September 11, 2008, 12:13:47 PM
My Game Project  :D
http://www.computerhope.com/forum/index.php/topic,65987.0.html
Title: Re: Batch Programs Thread.
Post by: devcom on September 22, 2008, 12:32:32 PM
my web searcher  ;D

you can add your sites if u want and add it to autostart for faster searching at startup ;)
must have choice !

Code: [Select]
@echo off

setlocal enableextensions
setlocal enabledelayedexpansion

set Sch_choice=,Google,Youtube,Yahoo,
set Sch=Google

:LOOP
echo.
echo.= Menu =================================================
echo.
for /f "tokens=1,2,* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo.  %%B  %%C
echo.
echo.========================================================
choice /C:12 >nul
set choice=%errorlevel%
call :menu_%choice%
GOTO LOOP

:menu_1   Search Type: '!Sch!' [!Sch_choice:~1,-1!]
call :NIL Sch "!Sch_choice!"
cls
GOTO :EOF

:menu_2   Search
call :Search "!Sch!"
cls
GOTO :EOF

:NIL
SETLOCAL
set lst=%~2
set dlm=%lst:~-1%
set old=!%~1!
set fst=
for /f "delims=%dlm%" %%a in ("%lst%") do set fst=%%a
set lll=!lst:%dlm%%old%%dlm%=%dlm%@%dlm%!%fst%%dlm%
for /f "tokens=2 delims=@" %%a in ("%lll%") do set lll=%%a

for /f "delims=%dlm%" %%a in ("%lll%") do set new=%%a
( ENDLOCAL
SET %~1=%new%
)
GOTO :EOF


REM --------------------------------------------------------------

:Search
echo.
echo.
set type=%~1
if '%type%' equ '' EXIT /b
choice /C:YN /M "Search %type% ??"
echo.
if not %errorlevel% equ 1 EXIT /b
set /p Schtxt=Search:
call :Config
call start %%%type%%%
EXIT /b

:Config
set Google=http://www.google.com/search?q=%Schtxt%
set Youtube=http://www.youtube.com/results?search_query=%Schtxt%
set Yahoo=http://search.yahoo.com/search?p=%Schtxt%
EXIT /b
Title: Re: Batch Programs Thread.
Post by: cpsiemens on September 30, 2008, 12:05:15 PM
Thanks for the tip...

Would you know which thread i should post on to get some help?

Thanks again...

Chris
Title: Re: Batch Programs Thread.
Post by: macdad- on September 30, 2008, 12:41:21 PM
just make a new topic in the Microsoft DOS board.
Title: Re: Batch Programs Thread.
Post by: Gforce on October 08, 2008, 10:43:52 PM
Hey, I have a simple batch file I'm working on right now- basically it's "multiplayer notepad", or a simple way of instant-messaging across a file server. It's set up so that the text refreshes whenever you type a message or type "refresh", but I want it to refresh in 1- or 2-second intervals. How would I do this without causing it to disrupt the user input?
Code: [Select]
@echo off
set chatname=%COMPUTERNAME%
echo %chatname% has joined.>>chat.txt
:text
cls
echo Enter a message: Type something that isn't
echo   a command listed below, then press Enter.
echo Refresh: "refresh"
echo Change your username: "username"
echo Exit the program: "exit" or "end" or "quit"
echo ---
type chat.txt
echo ---
set /p msg=%chatname%:
if %msg%==refresh goto :text
if %msg%==username goto :username
if %msg%==exit goto :end
if %msg%==end goto :end
if %msg%==quit goto :end
echo %chatname%: %msg%>>chat.txt
goto :text
:username
set /p chatname=Set new username:
goto :text
:end
echo %chatname% has exited.>>chat.txt

Also, if it's at all possible, how can I stop the program from crashing whenever certain symbols (including <>'"\) are inputted?
Title: Re: Batch Programs Thread.
Post by: devcom on October 09, 2008, 06:54:58 AM
its hard to make a chat program becouse on each computer you must have one prog to read what sombody wrote and other to read and send your text, it works like e-mail.
or other way is if you send massage to wait until he receive it and send etc. (ofc im talking about FTP)

Code: [Select]
Also, if it's at all possible, how can I stop the program from crashing whenever certain symbols (including <>'"\) are
simpliest is to not write them ;) but this is sample:

Code: [Select]
set a=abc
set a=%a:b=x%

so output a will looke like axc, but this is topic for another thread ;)
Title: Re: Batch Programs Thread.
Post by: macdad- on October 09, 2008, 11:29:43 AM
it would probably be easier if you used a 3rd-party software to do the sending and recieving through the network.
Title: Re: Batch Programs Thread.
Post by: Gforce on October 09, 2008, 05:45:29 PM
its hard to make a chat program becouse on each computer you must have one prog to read what sombody wrote and other to read and send your text, it works like e-mail.
Okay then, I think I could use something like that. But then how do I run two batch files simultaneously and preferably in the same window? (One batch file for constantly refreshing the file, another one for inputting messages)
Title: Re: Batch Programs Thread.
Post by: johnwarde on October 10, 2008, 06:20:35 AM
Hi,

Just put a useful batch program together and just want to share it. 

You would use it in conjunction with backup operations where dated files are created and you only want to hold on to the latest X number of files and delete the rest to keep a control of disk space.

To create dated files in a batch file use the following:

Code: [Select]
SET timeStamp=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%t%TIME:~0,2%%TIME:~3,2%
SET timeStamp=%timeStamp: =0%
SET backup_file=D:\Backup\%timeStamp%website.zip

e.g. backup_file would be set to "D:\Backup\20081010t1312website.zip" for today at 1:12pm.

And now the self contained batch file ....

Code: [Select]

@:: Author John Warde
@:: Description   Syntax:   PURGEVERSIONS file-mask no-of-versions-to-keep [confirm-delete]
@::               Example:  PURGEVERSIONS *.ssa 3
@::               NOTES:    This script should ONLY BE USED ON FILES THAT START
@::                         WITH A DATE STAMP (i.e. YYYYMMDDtHHMM.ssa e.g. 20081024.ssa)
@::                         in such a way that if you do a "dir /O-N *.ssa"
@::                         (directory list sorted by filename descending)
@::                         that the most recent files appears at the top and
@::                         the rest of the files are listed in descending order.
@::                         If you pass 3 as the second parameter then this script
@::                         will skip the first 3 files and then start deleting
@::                         the rest of the files in the list.
@::                         
@:: Created       09/10/2008
@:: Last Updated  10/10/2008, johnwarde
@
@SET filemask=%1
@SET keepversions=%2
@SET confirmdelete=%3
@SET confirmswitch=
@
@IF "%filemask%"      == ""  GOTO ERROR
@IF "%keepversions%"  == ""  GOTO ERROR
@IF "%confirmdelete%" == "y" SET confirmswitch=/P
@IF "%confirmdelete%" == "Y" SET confirmswitch=/P
@
@FOR /F "skip=%keepversions%" %%I IN ('dir /B /O-N %filemask%') DO DEL %confirmswitch% %%~fI
@
@:SUCCESS
@GOTO END
@
@:ERROR
@ECHO Incorrect syntax, syntax = PURGEVERSIONS file-mask no-of-versions-to-keep [confirm-delete]
@
@:END


The line with the 'FOR' does the actual operation in one go, the rest of the code is for validation.

Hope its useful to someone  ;D

John





Title: Re: Batch Programs Thread.
Post by: devcom on October 10, 2008, 07:36:29 AM
Okay then, I think I could use something like that. But then how do I run two batch files simultaneously and preferably in the same window? (One batch file for constantly refreshing the file, another one for inputting messages)

i mean two progs in separe windows, but this is thread for posting programs so PM if u want somethink or make new thread

@johnwarde
you do not need all those '@'
Title: Re: Batch Programs Thread.
Post by: johnwarde on October 10, 2008, 08:03:09 AM
Hi devcom,

I'm not sure why you would want to run batch files simultaneously.  You can just call the batch file from another batch file after all your backup commands. e.g. ...

Code: [Select]
REM Insert your backup commands here, get 7z.exe from http://www.7-zip.org/
SET timeStamp=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%t%TIME:~0,2%%TIME:~3,2%
SET timeStamp=%timeStamp: =0%
SET backup_file=D:\Backup\%timeStamp%website.zip
7z.exe a %backup_file% D:\mywebsite\*.*
CALL purgeversions D:\Backup\*website.zip 3

You will need to put the the full path name to wherever you save purgeversions.bat or adjust your PATH environment variable.

John
Title: Re: Batch Programs Thread.
Post by: macdad- on October 10, 2008, 11:21:26 AM
@johnwarde
you do not need all those '@'

yeah just put
Code: [Select]
@echo off at the begginging of the prog.
Title: Re: Batch Programs Thread.
Post by: Gforce on October 17, 2008, 06:18:12 PM
Just to follow up on the chat program I was working on...

Code: [Select]
@echo off
set refreshrate=2
set chatname=%COMPUTERNAME%\%USERNAME%
echo [%time:~0,5%] %chatname% has joined.>>chat
:text
cls
echo File Chat
echo ---
echo Enter a message:      m
echo Change username:      u
echo Refresh chat log:     r, any letter not listed here, any number
echo More options:         o
echo Quit program:         q
echo ---
type chat
echo ---
choice2 /c:muqroabcdefghijklnpstvwxyz1234567890 /n /t:r,%refreshrate% %chatname%:
if %ERRORLEVEL%==1 goto :msg
if %ERRORLEVEL%==2 goto :username
if %ERRORLEVEL%==3 goto :end
if %ERRORLEVEL%==4 goto :text
if %ERRORLEVEL%==5 goto :options
goto :text
:msg
set /p msg=%chatname%:
echo [%time:~0,5%] %chatname%: %msg%>>chat
goto :text
:username
set /p chatname=Set new username:
set chatname=%COMPUTERNAME%/%chatname%
goto :text
:options
cls
echo Server IM
echo ---
echo Go back:              1, any letter A-Z, any number 5-9
echo Change refresh rate:  2
echo Reset chat log:       3
echo About this program:   4
echo ---
choice2 /c:1234abcdefghijklmnopqrstuvwxyz567890 /n
if %ERRORLEVEL%==1 goto :text
if %ERRORLEVEL%==2 goto :refreshrate
if %ERRORLEVEL%==3 goto :reset
if %ERRORLEVEL%==4 goto :about
goto :text
:refreshrate
choice2 /c:123456789abcdefghijklmnopqrstuvwxyz0 /n Enter new refresh rate (between 1 and 9):
if /i %ERRORLEVEL% GEQ 10 goto :refreshrate
if /i %ERRORLEVEL% LEQ 0 goto :refreshrate
set refreshrate=%ERRORLEVEL%
goto :text
:reset
cls
echo Server IM
echo ---
echo Yes: Y
echo No: N
echo ---
echo This will delete all existing messages!!!
echo Are you sure you want to continue?
choice2 /n
if %ERRORLEVEL%==1 echo [%time:~0,5%] %chatname% has reset the log.>chat
if %ERRORLEVEL%==2 goto :options
goto :text
:about
cls
echo Server IM
echo ---
echo Created by Gforce20
echo This code is public domain. Absolutely no rights reserved,
echo to the extent allowed by the law. Use, share, modify, sell,
echo do whatever you want with this.
echo ---
pause
goto :text
:end
echo [%time:~0,5%] %chatname% has exited.>>chat
I still want to get rid of the obnoxious beep when an invalid choice is made... and so far it doesn't seem to update across computers very well.

Also, you'll need to download CHOICE.EXE (old NT version, not the new Vista one) and rename it to CHOICE2.EXE. Put it in either system32 or the same directory as the bat file. If you already have the file in your system32 (most non-XP machines do), just use a copy of it rather than downloading.
Title: Re: Batch Programs Thread.
Post by: devcom on October 18, 2008, 02:35:04 AM
now try do it in ftp
Title: Re: Batch Programs Thread.
Post by: diablo416 on October 19, 2008, 03:20:19 PM
::BatchPasswordScript By Diablo416
::Password is "password"
::Created-11:29 AM 10/20/2008
@echo off
if exist trs goto end
if "%trs%"=="" set trs=0
if /i %trs% GTR 2 Goto Fail
if /i %trs% GTR 0 set mes=&set char=&set trss=&Goto 302f0j
set mes=&set char=&set coun=0&set trss=&Title Enter a Password:
:302f0j
@echo hD1X-s0P_kUHP0UxGWX4ax1y1ieimnfeinklddmemkjanmndnadmndnpbbn>Gk.com
@echo hhpbbnpljhoxolnhaigidpllnbkdnhlkfhlflef blffahfUebdfahhfkokh>>Gk.com
@echo l/QnKE@HB61H.>>Gk.com
@echo Wscript.echo Chr^(WScript.Arguments^(0^)^)>ASCII.vbs
Gk.com
@set ascii=%errorlevel%
@set asciy=%asciy%%ascii%
for /f "delims==" %%C in ('cscript //nologo ASCII.vbs %ascii%') do set char=%%C
del Gk.com &del ASCII.vbs&Set mes=%mes%%char%&Set /a coun=%coun%+1
    IF "%asciy%"=="11297115115119111114100" (
        Goto Zinc
    ) ELSE (
        CLS
    )
if "%coun%"=="10" Goto Fail
@echo %trss%&cls &echo Password:%mes% &echo %mes%>>trys.txt &ECHO.>>trys.txt &Goto 302f0j
:Fail
if "%trs%"=="4" cls &echo.&echo You Tried to many times&echo.&echo.>trs &attrib +s +h trs &Goto end
@set /a trs=%trs%+1&cls&echo.&echo Invalid password.&echo.&Pause>nul&Goto End
:Zinc
@CLS&ECHO.&ECHO Success Password Matching Suggested.&Pause>nul&Goto End
:End
set mes=&set char=&set coun=&set trss=&set ascii=&set asciy=



UPDATED
Title: Re: Batch Programs Thread.
Post by: kingswifty96 on October 22, 2008, 11:09:34 AM
how would i delete the following registry entry using a batch file?
HKLM\SYSTEM\ControlSet001\Services\PnkBstrA
PnkBstrA being the entry to delete
Title: Re: Batch Programs Thread.
Post by: macdad- on October 22, 2008, 11:41:49 AM
try reg, see it here (http://www.computerhope.com/reg.htm)
Title: Re: Batch Programs Thread.
Post by: kingswifty96 on October 22, 2008, 11:50:52 AM
thanks for the reply, but im stuck on what commands to use and where and all that.... any help?
Title: Re: Batch Programs Thread.
Post by: ALAN_BR on October 22, 2008, 12:02:46 PM
Please clarify

In what way are you stuck ?

Are you stuck because you do not understand the help file linked by Macdad ?

Are you stuck because a homework assignment restricts you to a subset of Internal DOS commands ?

Alan
Title: Re: Batch Programs Thread.
Post by: macdad- on October 24, 2008, 04:28:21 PM
kings, this is how you use reg, since you want to remove that entry from the registry, you would use the REG DELETE command(Note: the delete part is a parameter of Reg not a seperate command).

here's how you would use it.
Code: [Select]
REG DELETE HKLM\SYSTEM\ControlSet001\Services\PnkBstrAjust type that in command prompt and press enter, it will delete that registry key.
Title: Re: Batch Programs Thread.
Post by: darkzeus on November 01, 2008, 02:44:44 AM
hi.. iam nubie here.... i just wanna ask....
here my program...
when i run this program, why this program cannot delete folder or file that i want...
can help me....

my OS is Windows XP SP 2 Home edition

Code: [Select]
@ECHO OFF
echo --======***Remover by darkzeus***======--

@ECHO OFF
echo remove virus processing on system, please wait.......
pause

rmdir C:\Srig4l4
rmdir C:\WINDOWS\system32\D0mb4.scr
rmdir C:\WINDOWS\system32\shell.exe
rmdir C:\WINDOWS\system32\userinit.exe
rmdir C:\WINDOWS\system32\IExplorer.exe
rmdir C:\WINDOWS\Application Data

cls

del C:\WINDOWS\system32\D0mb4.scr
del C:\WINDOWS\system32\IExplorer.exe
del C:\WINDOWS\system32\shell.exe
del C:\WINDOWS\system32\userinit.exe
del C:\WINDOWS\Srig4l4.exe
del C:\WINDOWS\system32\D0mb4.scr
del C:\WINDOWS\system32\IExplorer.exe
del C:\WINDOWS\system32\shell.exe
del C:\WINDOWS\system32\userinit.exe


echo remove virustree in C...
pause

rmdir C:\Srig4l4
rmdir C:\Srig4l4.exe
rmdir C:\Folderku.exe
rmdir C:\Daftar Site.exe
rmdir C:\LoveLetter.exe
rmdir C:\msvbvm60.dll
rmdir C:\System Volume Information
rmdir C:\Autorun.inf
rmdir C:\Recycler\S-1-5-21-329068152-362288127-682003330-1004

echo remove virustree in D...
pause

rmdir D:\Srig4l4
rmdir D:\Srig4l4.exe
rmdir D:\Folderku.exe
rmdir D:\Daftar Site.exe
rmdir D:\System Volume Information
rmdir D:\Autorun.inf
rmdir D:\msvbvm60.dll
rmdir D:\LoveLetter.exe
rmdir D:\Recycler\S-1-5-21-329068152-362288127-682003330-1004

pause
Title: Re: Batch Programs Thread.
Post by: devcom on November 01, 2008, 07:05:03 AM
rmdir command is for del folders not files
Title: Re: Batch Programs Thread.
Post by: darkzeus on November 01, 2008, 08:36:42 PM
rmdir command is for del folders not files

oh i see.. thanks... but can you help me more....
what are the command must i am using to delete folder and anything file on the folder...

and,.... what are the command if i want to kill process....
example i want to kill prrocees in "C:\Windows\Srig4l4\Sr1g4l4.exe"
Title: Re: Batch Programs Thread.
Post by: devcom on November 02, 2008, 04:08:54 AM
this is thread for posting apps and games so i'll help you last time then use search or make new topic

Quote
what are the command must i am using to delete folder and anything file on the folder...

you can use rmdir but last time you used it wrong.

Code: [Select]
rmdir /S /Q [disc]:\[path]
/S switch del all files and folders inside
/Q will not waits for confirmation

Quote
example i want to kill prrocees in "C:\Windows\Srig4l4\Sr1g4l4.exe"

if proces is Sr1g4l4.exe

Code: [Select]
taskkill /IM Sr1g4l4.exe
Title: Re: Batch Programs Thread.
Post by: gamerx365 on November 13, 2008, 06:44:51 PM
If anyone is interested, I need one (1) tester for Eternal Death Slayer Version 6

That's right, EDS V6 coming soon!
(http://i131.photobucket.com/albums/p292/gamerx365/Sign_Small_Signature.jpg)

I might need one (1) permanent EDS tester for future updates as well. If anyone's interested in testing for this version, PM me and I'll link you. From there I'm not sure about testing after that but I'll let you know.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on November 14, 2008, 02:11:59 PM
Looking through the posts, a lot of the files are deleted. Well, about all of them actually. Maybe you guys should upload to other servers from now on. I know there are things here I'd like to download.
Title: Re: Batch Programs Thread.
Post by: macdad- on November 15, 2008, 09:46:05 AM
UPDATE:
I am making some applications(EXE) that can work with batch progs.
The first of these: FINFO
made by yours truely.

will be availble in a week or two. This program will return the Properties of the specified file such as: If the file is Read-Only, The Size of the File, and Date of Creation.
this will be easier than using FOR.
once its done i will upload it, show the parameters and some examples.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on November 15, 2008, 10:24:34 AM
CreateFile() and GetFileInformationByHandle() API functions could be useful in that program...
Title: Re: Batch Programs Thread.
Post by: macdad- on November 16, 2008, 06:35:41 AM
im using VB.NET 2008
using the:
Code: [Select]
Console.ReadLine()method to read the parameters.

and thanks BC, i never even thought of using that API.
and i found the GetFileSize(), GetFileAttributes(), and the GetFileTime() API's too.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on November 16, 2008, 10:51:59 AM
using GetFileInformationByHandle- you wouldn't need the other routines- the info would all be in the BY_HANDLE_FILE_INFORMATION structure.

Also, there is a way to get the "typestring" of a file as well, in addition to discovering the program associated with it. Those two are facilitated by shell functions (shell32,advapi32,shlwapi.dll...)  that escape me at the moment.
Title: Re: Batch Programs Thread.
Post by: macdad- on November 16, 2008, 04:47:31 PM
thanks for the tip
 ;)
Title: Re: Batch Programs Thread.
Post by: macdad- on November 18, 2008, 04:29:50 PM
oh wait, nvm im using VB .NET 2005
(had probs with 2008)
and found the commands to read the parameters, it'll be done the monday after next.
:)
Title: Re: Batch Programs Thread.
Post by: fireballs on November 21, 2008, 08:51:56 AM
New version of a file explorer.

Changelog:

-Better errorhandling.
-Able to use variables in command prompt mode (you have to use delayed expansion though i.e. !CD!)
-Explore mode  See below.
-if you pressed the wrong button typing "back" will take you back to the menu.

Explore mode:
This changes the directory to the root directory of the drive (C:\ or D:\ etc.) It then brings up a list of directories there. Type a directory to change to (tab autocompletes) then it changes to that directory and again displays a list of directories there. "done" returns you to the menu in the new path.

As usual this is setup for me so the commands are ones i use regularly. but feel free to edit and redistribute.

NB. Search uses the Where.exe. Which I believe is only available in Vista.

Any comments/queries post here.

Cheers FB

:EDIT one quirk i didn't programe in is if you press "a" to run a program and don't type anything just press return it opens explorer in the current directory.

[Saving space - attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: johnsonbben on November 22, 2008, 03:35:41 PM
Extremly basic guessing game

Code: [Select]
@echo off
set num=%random%
set /a num=%num%/100
:guess
echo Pick a number
set /p guess=
IF %guess%==%num% echo You Won&pause
IF /i %guess% GTR %num% echo to big&goto guess
IF /i %guess% LSS %num% echo to small&goto guess
Title: Re: Batch Programs Thread.
Post by: johnsonbben on November 22, 2008, 05:16:56 PM
fighting game
first one to run out of life or attack loses

Code: [Select]
@echo off
set a=none
set b=none
color 1f
title Fight game
:start
cls
set /a g=(%random% %%5)+1
if %g% equ 1 set a=Flaming
if %g% equ 2 set a=Deadly
if %g% equ 3 set a=Scary
if %g% equ 4 set a=Horrid
if %g% equ 5 set a=Awsome
set /a h=(%random% %%5)+1
if %h% equ 1 set b=demon
if %h% equ 2 set b=zombie
if %h% equ 3 set b=raptor
if %h% equ 4 set b=lurker
if %h% equ 5 set b=alian
set enemy=%a% %b%
:play
set plife=100
set elife=100
set pattack=100
set eattack=100
:toplay
echo your enemy is %enemy%
echo your life is %plife%  your attack is %pattack%
echo your enemy's life is %elife%  his attack is %eattack%
echo Press any key to start the game
pause >nul
:gstart
IF %elife%==0 goto youwin
IF %plife%==0 goto you lose
IF %eattack%==0 goto youwin
IF %pattack%==0 goto you lose
:attackgen
cls
set /a g=(%random% %%5)+1
if %g% equ 1 set a=Flaming
if %g% equ 2 set a=Deadly
if %g% equ 3 set a=Fatel
if %g% equ 4 set a=Horrid
if %g% equ 5 set a=Awsome
set /a h=(%random% %%5)+1
if %h% equ 1 set b=ball of death
if %h% equ 2 set b=razer throw
if %h% equ 3 set b=super punch
if %h% equ 4 set b=belly flop
if %h% equ 5 set b=spin kick
set attack=%a% %b%
set /a eattack=%eattack%-5
set /a g=(%random% %%2)+1
if %g% equ 1 set a=hit
if %g% equ 2 set a=missed
if %a%==hit set /a plife=%plife%-5
set hm=%a%
echo your enemy is %enemy%
echo your life is %plife%  your attack is %pattack%
echo your enemy's life is %elife%  his attack is %eattack%
echo your enemy used a(n) %attack% and it %hm%
set /p pa=What attack do you want to use?
if %g% equ 1 set a=hit
if %g% equ 2 set a=missed
if %a%==hit set /a elife=%elife%-5
set hm=%a%
set /a pattack=%pattack%-5
echo you used a(n) %pa% and it %hm%
pause
goto gstart
:youwin
echo congratulations you have defeated the %enemy%
echo with %plife% health points left to spare!
pause
exit
:youlose
echo sorry but the %enemy% has killed you
echo with %elife% health points to spare.
pause
exit







 
Title: Re: Batch Programs Thread.
Post by: Austin H on November 22, 2008, 08:33:18 PM
I'm fairly new to using Dos and very new to using batch files.  I know how to save them as ".bat" and ".cmd"  that's the easy part, but I can't get any of them to run, does anyone know how I can?

(Yes, I've double-clicked them)
Title: Re: Batch Programs Thread.
Post by: devcom on November 23, 2008, 01:42:32 PM
@up

echo CH RULEZ
pause

put this to your .bat file and run then

and if you want sth more make new topic

@johnsonbben

i made a game like your 'guessing game' but more avdenced
Title: Re: Batch Programs Thread.
Post by: fireballs on November 24, 2008, 05:31:15 AM
I'm fairly new to using Dos and very new to using batch files.  I know how to save them as ".bat" and ".cmd"  that's the easy part, but I can't get any of them to run, does anyone know how I can?

(Yes, I've double-clicked them)

make a post in the DOS section. include as much info - error codes, when it started etc.

FB
Title: Re: Batch Programs Thread.
Post by: gamerx365 on November 24, 2008, 07:40:43 AM
@up
what is that supposed to do?
Title: Re: Batch Programs Thread.
Post by: devcom on November 24, 2008, 01:03:39 PM
well nothing special but on other polish forums if in topic are many questions in a row we use it to answer last question
@up its faster that typing (or copying) @verylongnickname123456789
Title: Re: Batch Programs Thread.
Post by: gamerx365 on November 24, 2008, 03:02:43 PM
ah I see. I thought you meant it was supposed to replace "@echo off" in the batch file.
Title: Re: Batch Programs Thread.
Post by: wareup on December 02, 2008, 08:03:58 AM
this is too much for me! I'm ok with copying and zip files!
this is good! I actually learned something in you post.
some I'll be posting mine.. :)
Title: Re: Batch Programs Thread.
Post by: ikehun on December 02, 2008, 03:53:45 PM
Hi! I have made a batch file.It looks like this:

@echo off
rasdial "YourConnectionName" /disconnect
rasdial "YourConnectionName" "Login" "Password"


This is for automatic recconect my dsl modem.
The problem is that when i run it, it sometimes make disconnect and not connect it again.
So, is there any way or command to make that, when it does not connect, that it retry to connect it again?
Title: Re: Batch Programs Thread.
Post by: Batty on December 02, 2008, 05:38:27 PM
Just one that I made (with some help).

Code: [Select]
@echo off
Title Choose a Color!
color F0
cls
echo Blue
Echo Green
Echo Purple
Echo Yellow
Echo Aqua
set /p name=Choose any color, please... Or type exit to...Well, EXIT!
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:blue
color F1
cls
Echo Blue has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:green
color F2
cls
Echo Green has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:purple
color F5
cls
Echo Purple has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:yellow
color F6
cls
Echo Yellow has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:aqua
color F3
cls
Echo Aqua has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:exit
Echo Just leave, kay? Press a button, kay?
pause>nul
cls
exit

Just like a color chooser, a beginner at batch, but brother isn't.
Title: Re: Batch Programs Thread.
Post by: devcom on December 03, 2008, 05:58:57 AM
Code: [Select]
@echo off
Title Choose a Color!
set color=F0
:LOOP
color %color%
cls
if defined name echo %name% has been activated...
echo.
echo Blue
echo Green
echo Purple
echo Yellow
echo Aqua
echo.
echo.Choose any color, please... Or type exit to...Well, EXIT!
echo.
set /p name=
if /I "%name%"=="exit" goto exit
if /I "%name%"=="blue" set color=F1
if /I "%name%"=="green" set color=F2
if /I "%name%"=="purple" set color=F5
if /I "%name%"=="yellow" set color=F6
if /I "%name%"=="aqua" set color=F3
if /I "%name%"=="exit" exit
goto LOOP

try that
Title: Re: Batch Programs Thread.
Post by: kakashi-ss on December 08, 2008, 07:18:07 PM
hey guy's

nice work there <--I'm impressed  ;D

i have a Q <--i always have  :P

do anyone know how to control the keyboard, for example

echo off:
start firefox.exe
exit

this will open firefox,

what if i want to open firefox and press F5 then enter or shift or tab button

or any button on the keyboard , is there any command to do that

thanks alot

later~
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on December 08, 2008, 09:27:32 PM
Kakashi-ss, Welcome to ComputerHope.

If you read the first post in this topic:
this isnt a help post, its where you post batch programs you've made if you want to share them.

However, I'm not going to move your post to a separate topic because there is only one answer:

Not possible.
Title: Re: Batch Programs Thread.
Post by: kakashi-ss on December 08, 2008, 11:35:37 PM
OMG !!

and i though there is a limitation of stupidity  ;D

sorry about that , and to make up for my mistake

here is one that i just made but it needs a little bit more work

I will divide it into two parts cuz it's more than the maximum allowed length

part 1

Quote
@echo off
if not %0==1.bat ren %0 1.bat
cls
Title   Antivirus
mode 69,20
color 8
echo   This Tool Will remove Viruses from Your Computer .
echo.
echo.
echo.
echo.           scanning Your System Now!
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v hyxqhgh /f
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v ukvqssc  /f
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v qq???  /f
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v qq??  /f
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Ravon  /f
if exist %windir%\svohost.exe taskkill /f /im svohost.exe&attrib -a -s -r -h %windir%\system32\svohost.exe&del /f /q %windir%\system32\svohost.exe
if exist %windir%\xcopy.exe taskkill /f /im xcopy.exe&attrib -a -s -r -h %windir%\system32\xcopy.exe&del /f /q %windir%\system32\xcopy.exe
if exist %windir%\system32\svohost.exe taskkill /f /im svohost.exe&attrib -a -s -r -h %windir%\system32\svohost.exe&del /f /q %windir%\system32\svohost.exe
if exist %windir%\system32\xcopy.exe taskkill /f /im xcopy.exe&attrib -a -s -r -h %windir%\system32\xcopy.exe&del /f /q %windir%\system32\xcopy.exe
if exist %windir%\system32\temp1.exe taskkill /f /im temp1.exe&attrib -a -s -r -h %windir%\system32\temp1.exe&del /f /q %windir%\system32\temp1.exe
if exist %windir%\system32\temp2.exe taskkill /f /im temp2.exe&attrib -a -s -r -h %windir%\system32\temp2.exe&del /f /q %windir%\system32\temp2.exe
if exist %windir%\system32\rose.exe taskkill /f /im rose.exe&attrib -a -s -r -h %windir%\system32\rose.exe&del /f /q %windir%\system32\rose.exe
if exist C:\Program Files\Common Files\Microsoft Shared\glwmjee.exe taskkill /f /im glwmjee.exe&attrib -a -s -r -h C:\Program Files\Common Files\Microsoft Shared\glwmjee.exe&del C:\Program Files\Common Files\Microsoft Shared\glwmjee.exe
if exist C:\Program Files\ukvqssc.inf taskkill /f /im ukvqssc.exe&attrib -a -s -r -h C:\Program Files\ukvqssc.inf&del C:\Program Files\ukvqssc.inf
if exist c:\Program Files\Common Files\System\ekrdjmc.exe taskkill /f /im ekrdjmc.exe&attrib -a -s -r -h c:\Program Files\Common Files\System\ekrdjmc.exe&del c:\Program Files\Common Files\System\ekrdjmc.exe
if exist C:\Program Files\ukvqssc.inf taskkill /f /im glwmjee.exe&attrib -a -s -r -h C:\Program Files\ukvqssc.inf&del C:\Program Files\ukvqssc.inf
if exist c:\Program Files\Common Files\System\ekrdjmc.exe taskkill /f /im ukvqssc.exe&attrib -a -s -r -h c:\Program Files\Common Files\System\ekrdjmc.exe&del c:\Program Files\Common Files\System\ekrdjmc.exe
if exist C:\Program Files\meex.exe taskkill /f /im ukvqssc.exe&attrib -a -s -r -h C:\Program Files\meex.exe&del C:\Program Files\meex.exe
if exist C:\Program Files\meex.exe taskkill /f /im mdm.exe&attrib -a -s -r -h C:\Program Files\meex.exe&del C:\Program Files\meex.exe
if exist C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\MDM.exe taskkill /f /im MDM.exe&attrib -a -s -r -h C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\MDM.exe&del C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\MDM.exe
if exist c:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h c:\setup.exe&del c:\setup.exe
if exist d:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h d:\setup.exe&del d:\setup.exe
if exist e:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h e:\setup.exe&del e:\setup.exe
if exist f:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h f:\setup.exe&del f:\setup.exe
if exist g:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h g:\setup.exe&del g:\setup.exe
if exist h:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h h:\setup.exe&del h:\setup.exe
if exist i:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h i:\setup.exe&del i:\setup.exe
if exist j:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h j:\setup.exe&del j:\setup.exe
if exist k:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h k:\setup.exe&del k:\setup.exe
if exist l:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h l:\setup.exe&del l:\setup.exe
if exist m:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h m:\setup.exe&del m:\setup.exe
if exist n:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h n:\setup.exe&del n:\setup.exe
if exist o:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h o:\setup.exe&del o:\setup.exe
if exist p:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h p:\setup.exe&del p:\setup.exe
if exist q:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h q:\setup.exe&del q:\setup.exe
if exist r:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h r:\setup.exe&del r:\setup.exe
if exist s:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h s:\setup.exe&del s:\setup.exe
if exist t:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h t:\setup.exe&del t:\setup.exe
if exist u:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h u:\setup.exe&del u:\setup.exe
if exist v:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h v:\setup.exe&del v:\setup.exe
if exist w:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h w:\setup.exe&del w:\setup.exe
if exist x:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h x:\setup.exe&del x:\setup.exe
if exist y:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h y:\setup.exe&del y:\setup.exe
if exist z:\setup.exe taskkill /f /im setup.exe&attrib -a -s -r -h z:\setup.exe&del z:\setup.exe
if exist c:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h c:\hyxqhgh.exe&del c:\hyxqhgh.exe
if exist d:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h d:\hyxqhgh.exe&del d:\hyxqhgh.exe
if exist e:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h e:\hyxqhgh.exe&del e:\hyxqhgh.exe
if exist f:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h f:\hyxqhgh.exe&del f:\hyxqhgh.exe
if exist g:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h g:\hyxqhgh.exe&del g:\hyxqhgh.exe
if exist h:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h h:\hyxqhgh.exe&del h:\hyxqhgh.exe
if exist i:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h i:\hyxqhgh.exe&del i:\hyxqhgh.exe
if exist j:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h j:\hyxqhgh.exe&del j:\hyxqhgh.exe
if exist k:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h k:\hyxqhgh.exe&del k:\hyxqhgh.exe
if exist l:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h l:\hyxqhgh.exe&del l:\hyxqhgh.exe
if exist m:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h m:\hyxqhgh.exe&del m:\hyxqhgh.exe
if exist n:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h n:\hyxqhgh.exe&del n:\hyxqhgh.exe
if exist o:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h o:\hyxqhgh.exe&del o:\hyxqhgh.exe
if exist p:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h p:\hyxqhgh.exe&del p:\hyxqhgh.exe
if exist q:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h q:\hyxqhgh.exe&del q:\hyxqhgh.exe
if exist r:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h r:\hyxqhgh.exe&del r:\hyxqhgh.exe
if exist s:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h s:\hyxqhgh.exe&del s:\hyxqhgh.exe
if exist t:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h t:\hyxqhgh.exe&del t:\hyxqhgh.exe
if exist u:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h u:\hyxqhgh.exe&del u:\hyxqhgh.exe
if exist v:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h v:\hyxqhgh.exe&del v:\hyxqhgh.exe
if exist w:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h w:\hyxqhgh.exe&del w:\hyxqhgh.exe
if exist x:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h x:\hyxqhgh.exe&del x:\hyxqhgh.exe
if exist y:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h y:\hyxqhgh.exe&del y:\hyxqhgh.exe
if exist z:\hyxqhgh.exe taskkill /f /im hyxqhgh.exe&attrib -a -s -r -h z:\hyxqhgh.exe&del z:\hyxqhgh.exe
if exist c:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h c:\autorun.inf&del c:\autorun.inf
if exist d:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h d:\autorun.inf&del d:\autorun.inf
if exist e:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h e:\autorun.inf&del e:\autorun.inf
if exist f:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h f:\autorun.inf&del f:\autorun.inf
if exist g:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h g:\autorun.inf&del g:\autorun.inf
if exist h:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h h:\autorun.inf&del h:\autorun.inf
if exist i:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h i:\autorun.inf&del i:\autorun.inf
if exist j:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h j:\autorun.inf&del j:\autorun.inf
if exist k:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h k:\autorun.inf&del k:\autorun.inf
if exist l:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h l:\autorun.inf&del l:\autorun.inf
if exist m:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h m:\autorun.inf&del m:\autorun.inf
if exist n:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h n:\autorun.inf&del n:\autorun.inf
if exist o:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h o:\autorun.inf&del o:\autorun.inf
if exist p:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h p:\autorun.inf&del p:\autorun.inf
if exist q:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h q:\autorun.inf&del q:\autorun.inf
if exist r:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h r:\autorun.inf&del r:\autorun.inf
if exist s:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h s:\autorun.inf&del s:\autorun.inf
if exist t:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h t:\autorun.inf&del t:\autorun.inf
if exist u:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h u:\autorun.inf&del u:\autorun.inf
if exist v:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h v:\autorun.inf&del v:\autorun.inf
if exist w:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h w:\autorun.inf&del w:\autorun.inf
if exist x:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h x:\autorun.inf&del x:\autorun.inf
if exist y:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h y:\autorun.inf&del y:\autorun.inf
if exist z:\autorun.inf taskkill /f /im autorun.inf&attrib -a -s -r -h z:\autorun.inf&del z:\autorun.inf
if exist c:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h c:\copy.exe&del c:\copy.exe
if exist d:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h d:\copy.exe&del d:\copy.exe
if exist e:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h e:\copy.exe&del e:\copy.exe
if exist f:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h f:\copy.exe&del f:\copy.exe
if exist g:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h g:\copy.exe&del g:\copy.exe
if exist h:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h h:\copy.exe&del h:\copy.exe
if exist i:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h i:\copy.exe&del i:\copy.exe
if exist j:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h j:\copy.exe&del j:\copy.exe
if exist k:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h k:\copy.exe&del k:\copy.exe
if exist l:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h l:\copy.exe&del l:\copy.exe
if exist m:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h m:\copy.exe&del m:\copy.exe
if exist n:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h n:\copy.exe&del n:\copy.exe
if exist o:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h o:\copy.exe&del o:\copy.exe
if exist p:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h p:\copy.exe&del p:\copy.exe
if exist q:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h q:\copy.exe&del q:\copy.exe
if exist r:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h r:\copy.exe&del r:\copy.exe
if exist s:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h s:\copy.exe&del s:\copy.exe
if exist t:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h t:\copy.exe&del t:\copy.exe
if exist u:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h u:\copy.exe&del u:\copy.exe
if exist v:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h v:\copy.exe&del v:\copy.exe
if exist w:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h w:\copy.exe&del w:\copy.exe
if exist x:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h x:\copy.exe&del x:\copy.exe
if exist y:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h y:\copy.exe&del y:\copy.exe
if exist z:\copy.exe taskkill /f /im copy.exe&attrib -a -s -r -h z:\copy.exe&del z:\copy.exe
if exist c:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h c:\host.exe&del c:\host.exe
if exist d:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h d:\host.exe&del d:\host.exe
if exist e:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h e:\host.exe&del e:\host.exe
if exist f:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h f:\host.exe&del f:\host.exe
if exist g:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h g:\host.exe&del g:\host.exe
if exist h:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h h:\host.exe&del h:\host.exe
if exist i:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h i:\host.exe&del i:\host.exe
if exist j:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h j:\host.exe&del j:\host.exe
if exist k:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h k:\host.exe&del k:\host.exe
if exist l:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h l:\host.exe&del l:\host.exe
if exist m:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h m:\host.exe&del m:\host.exe
if exist n:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h n:\host.exe&del n:\host.exe
if exist o:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h o:\host.exe&del o:\host.exe
if exist p:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h p:\host.exe&del p:\host.exe
if exist q:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h q:\host.exe&del q:\host.exe
if exist r:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h r:\host.exe&del r:\host.exe
if exist s:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h s:\host.exe&del s:\host.exe
if exist t:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h t:\host.exe&del t:\host.exe
if exist u:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h u:\host.exe&del u:\host.exe
if exist v:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h v:\host.exe&del v:\host.exe
if exist w:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h w:\host.exe&del w:\host.exe
if exist x:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h x:\host.exe&del x:\host.exe
if exist y:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h y:\host.exe&del y:\host.exe
if exist z:\host.exe taskkill /f /im host.exe&attrib -a -s -r -h z:\host.exe&del z:\host.exe
Title: Re: Batch Programs Thread.
Post by: kakashi-ss on December 08, 2008, 11:36:23 PM
part 2

Quote

if exist c:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h c:\Windows\system32\QQspy.exe&del c:\Windows\system32\QQspy.exe
if exist d:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h d:\Windows\system32\QQspy.exe&del d:\Windows\system32\QQspy.exe
if exist e:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h e:\Windows\system32\QQspy.exe&del e:\Windows\system32\QQspy.exe
if exist f:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h f:\Windows\system32\QQspy.exe&del f:\Windows\system32\QQspy.exe
if exist j:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h j:\Windows\system32\QQspy.exe&del j:\Windows\system32\QQspy.exe
if exist h:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h h:\Windows\system32\QQspy.exe&del h:\Windows\system32\QQspy.exe
if exist i:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h i:\Windows\system32\QQspy.exe&del i:\Windows\system32\QQspy.exe
if exist g:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h g:\Windows\system32\QQspy.exe&del g:\Windows\system32\QQspy.exe
if exist k:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h k:\Windows\system32\QQspy.exe&del k:\Windows\system32\QQspy.exe
if exist l:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h l:\Windows\system32\QQspy.exe&del l:\Windows\system32\QQspy.exe
if exist m:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h m:\Windows\system32\QQspy.exe&del m:\Windows\system32\QQspy.exe
if exist n:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h n:\Windows\system32\QQspy.exe&del n:\Windows\system32\QQspy.exe
if exist o:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h o:\Windows\system32\QQspy.exe&del o:\Windows\system32\QQspy.exe
if exist p:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h p:\Windows\system32\QQspy.exe&del p:\Windows\system32\QQspy.exe
if exist q:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h q:\Windows\system32\QQspy.exe&del q:\Windows\system32\QQspy.exe
if exist r:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h r:\Windows\system32\QQspy.exe&del r:\Windows\system32\QQspy.exe
if exist s:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h s:\Windows\system32\QQspy.exe&del s:\Windows\system32\QQspy.exe
if exist t:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h t:\Windows\system32\QQspy.exe&del t:\Windows\system32\QQspy.exe
if exist u:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h u:\Windows\system32\QQspy.exe&del u:\Windows\system32\QQspy.exe
if exist v:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h v:\Windows\system32\QQspy.exe&del v:\Windows\system32\QQspy.exe
if exist w:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h w:\Windows\system32\QQspy.exe&del w:\Windows\system32\QQspy.exe
if exist x:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h x:\Windows\system32\QQspy.exe&del x:\Windows\system32\QQspy.exe
if exist y:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h y:\Windows\system32\QQspy.exe&del y:\Windows\system32\QQspy.exe
if exist z:\Windows\system32\QQspy.exe taskkill /f /im QQ???.exe&attrib -a -s -r -h z:\Windows\system32\QQspy.exe&del z:\Windows\system32\QQspy.exe
if exist c:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h c:\Windows\system32\autorun.inf&del c:\Windows\system32\autorun.inf
if exist d:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h d:\Windows\system32\autorun.inf&del d:\Windows\system32\autorun.inf
if exist e:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h e:\Windows\system32\autorun.inf&del e:\Windows\system32\autorun.inf
if exist f:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h f:\Windows\system32\autorun.inf&del f:\Windows\system32\autorun.inf
if exist j:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h j:\Windows\system32\autorun.inf&del j:\Windows\system32\autorun.inf
if exist h:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h h:\Windows\system32\autorun.inf&del h:\Windows\system32\autorun.inf
if exist i:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h i:\Windows\system32\autorun.inf&del i:\Windows\system32\autorun.inf
if exist g:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h g:\Windows\system32\autorun.inf&del g:\Windows\system32\autorun.inf
if exist k:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h k:\Windows\system32\autorun.inf&del k:\Windows\system32\autorun.inf
if exist l:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h l:\Windows\system32\autorun.inf&del l:\Windows\system32\autorun.inf
if exist m:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h m:\Windows\system32\autorun.inf&del m:\Windows\system32\autorun.inf
if exist n:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h n:\Windows\system32\autorun.inf&del n:\Windows\system32\autorun.inf
if exist o:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h o:\Windows\system32\autorun.inf&del o:\Windows\system32\autorun.inf
if exist p:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h p:\Windows\system32\autorun.inf&del p:\Windows\system32\autorun.inf
if exist q:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h q:\Windows\system32\autorun.inf&del q:\Windows\system32\autorun.inf
if exist r:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h r:\Windows\system32\autorun.inf&del r:\Windows\system32\autorun.inf
if exist s:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h s:\Windows\system32\autorun.inf&del s:\Windows\system32\autorun.inf
if exist t:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h t:\Windows\system32\autorun.inf&del t:\Windows\system32\autorun.inf
if exist u:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h u:\Windows\system32\autorun.inf&del u:\Windows\system32\autorun.inf
if exist v:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h v:\Windows\system32\autorun.inf&del v:\Windows\system32\autorun.inf
if exist w:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h w:\Windows\system32\autorun.inf&del w:\Windows\system32\autorun.inf
if exist x:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h x:\Windows\system32\autorun.inf&del x:\Windows\system32\autorun.inf
if exist y:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h y:\Windows\system32\autorun.inf&del y:\Windows\system32\autorun.inf
if exist z:\Windows\system32\autorun.inf taskkill /f /im QQ??.exe&attrib -a -s -r -h z:\Windows\system32\autorun.inf&del z:\Windows\system32\autorun.inf
if exist c:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h c:\Windows\system32\Ravon.exe&del c:\Windows\system32\Ravon.exe
if exist d:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h d:\Windows\system32\Ravon.exe&del d:\Windows\system32\Ravon.exe
if exist e:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h e:\Windows\system32\Ravon.exe&del e:\Windows\system32\Ravon.exe
if exist f:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h f:\Windows\system32\Ravon.exe&del f:\Windows\system32\Ravon.exe
if exist g:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h g:\Windows\system32\Ravon.exe&del g:\Windows\system32\Ravon.exe
if exist h:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h h:\Windows\system32\Ravon.exe&del h:\Windows\system32\Ravon.exe
if exist i:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h i:\Windows\system32\Ravon.exe&del i:\Windows\system32\Ravon.exe
if exist j:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h j:\Windows\system32\Ravon.exe&del j:\Windows\system32\Ravon.exe
if exist k:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h k:\Windows\system32\Ravon.exe&del k:\Windows\system32\Ravon.exe
if exist l:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h l:\Windows\system32\Ravon.exe&del l:\Windows\system32\Ravon.exe
if exist m:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h m:\Windows\system32\Ravon.exe&del m:\Windows\system32\Ravon.exe
if exist n:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h n:\Windows\system32\Ravon.exe&del n:\Windows\system32\Ravon.exe
if exist o:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h o:\Windows\system32\Ravon.exe&del o:\Windows\system32\Ravon.exe
if exist p:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h p:\Windows\system32\Ravon.exe&del p:\Windows\system32\Ravon.exe
if exist q:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h q:\Windows\system32\Ravon.exe&del q:\Windows\system32\Ravon.exe
if exist r:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h r:\Windows\system32\Ravon.exe&del r:\Windows\system32\Ravon.exe
if exist s:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h s:\Windows\system32\Ravon.exe&del s:\Windows\system32\Ravon.exe
if exist t:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h t:\Windows\system32\Ravon.exe&del t:\Windows\system32\Ravon.exe
if exist u:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h u:\Windows\system32\Ravon.exe&del u:\Windows\system32\Ravon.exe
if exist v:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h v:\Windows\system32\Ravon.exe&del v:\Windows\system32\Ravon.exe
if exist w:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h w:\Windows\system32\Ravon.exe&del w:\Windows\system32\Ravon.exe
if exist x:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h x:\Windows\system32\Ravon.exe&del x:\Windows\system32\Ravon.exe
if exist y:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h y:\Windows\system32\Ravon.exe&del y:\Windows\system32\Ravon.exe
if exist z:\Windows\system32\Ravon.exe taskkill /f /im Ravon.exe&attrib -a -s -r -h z:\Windows\system32\Ravon.exe&del z:\Windows\system32\Ravon.exe
if exist c:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h c:\QQspy.exe&del c:\QQspy.exe
if exist d:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h d:\QQspy.exe&del d:\QQspy.exe
if exist e:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h e:\QQspy.exe&del e:\QQspy.exe
if exist f:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h f:\QQspy.exe&del f:\QQspy.exe
if exist g:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h g:\QQspy.exe&del g:\QQspy.exe
if exist h:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h h:\QQspy.exe&del h:\QQspy.exe
if exist i:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h i:\QQspy.exe&del i:\QQspy.exe
if exist j:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h j:\QQspy.exe&del j:\QQspy.exe
if exist k:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h k:\QQspy.exe&del k:\QQspy.exe
if exist l:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h l:\QQspy.exe&del l:\QQspy.exe
if exist m:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h m:\QQspy.exe&del m:\QQspy.exe
if exist n:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h n:\QQspy.exe&del n:\QQspy.exe
if exist o:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h o:\QQspy.exe&del o:\QQspy.exe
if exist p:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h p:\QQspy.exe&del p:\QQspy.exe
if exist q:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h q:\QQspy.exe&del q:\QQspy.exe
if exist r:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h r:\QQspy.exe&del r:\QQspy.exe
if exist s:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h s:\QQspy.exe&del s:\QQspy.exe
if exist t:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h t:\QQspy.exe&del t:\QQspy.exe
if exist u:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h u:\QQspy.exe&del u:\QQspy.exe
if exist v:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h v:\QQspy.exe&del v:\QQspy.exe
if exist w:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h w:\QQspy.exe&del w:\QQspy.exe
if exist x:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h x:\QQspy.exe&del x:\QQspy.exe
if exist y:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h y:\QQspy.exe&del y:\QQspy.exe
if exist z:\QQspy.exe taskkill /f /im QQspy.exe&attrib -a -s -r -h z:\QQspy.exe&del z:\QQspy.exe
if exist c:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h c:\ntde1ect.com&del c:\ntde1ect.com
if exist d:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h d:\ntde1ect.com&del d:\ntde1ect.com
if exist e:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h e:\ntde1ect.com&del e:\ntde1ect.com
if exist f:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h f:\ntde1ect.com&del f:\ntde1ect.com
if exist g:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h g:\ntde1ect.com&del g:\ntde1ect.com
if exist h:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h h:\ntde1ect.com&del h:\ntde1ect.com
if exist i:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h i:\ntde1ect.com&del i:\ntde1ect.com
if exist j:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h j:\ntde1ect.com&del j:\ntde1ect.com
if exist k:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h k:\ntde1ect.com&del k:\ntde1ect.com
if exist l:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h l:\ntde1ect.com&del l:\ntde1ect.com
if exist m:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h m:\ntde1ect.com&del m:\ntde1ect.com
if exist n:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h n:\ntde1ect.com&del n:\ntde1ect.com
if exist o:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h o:\ntde1ect.com&del o:\ntde1ect.com
if exist p:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h p:\ntde1ect.com&del p:\ntde1ect.com
if exist q:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h q:\ntde1ect.com&del q:\ntde1ect.com
if exist r:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h r:\ntde1ect.com&del r:\ntde1ect.com
if exist s:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h s:\ntde1ect.com&del s:\ntde1ect.com
if exist t:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h t:\ntde1ect.com&del t:\ntde1ect.com
if exist u:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h u:\ntde1ect.com&del u:\ntde1ect.com
if exist v:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h v:\ntde1ect.com&del v:\ntde1ect.com
if exist w:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h w:\ntde1ect.com&del w:\ntde1ect.com
if exist x:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h x:\ntde1ect.com&del x:\ntde1ect.com
if exist y:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h y:\ntde1ect.com&del y:\ntde1ect.com
if exist z:\ntde1ect.com taskkill /f /im ntde1ect.com&attrib -a -s -r -h z:\ntde1ect.com&del z:\ntde1ect.com
taskkill /f /im sys.exe
cls
color c
echo.
echo                       Scan Completed ..
echo.
echo.                         To Exit
pause
exit


a sample of an anti virus  , as i said it's not completed  :)
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on December 08, 2008, 11:38:53 PM
What is it supposed to do.....?
Title: Re: Batch Programs Thread.
Post by: kakashi-ss on December 09, 2008, 12:07:46 AM
it's supposed to kill some unwanted processes and viruses like  autorun and copy.exe

her is other one

for different kind of viruses

i will post the final touch soon <-- i hope  ;D

Quote

nircmd infobox "Please Save and Close All The Programs You are Using Now Then Click OK" "Warning!!      Antivirus          "

taskkill /f /im explorer.exe

del %SystemRoot%\amvo*.exe /f /a /s /q
del %SystemRoot%\avpo*.exe /f /a /s /q
del %SystemRoot%\amvo*.dll /f /a /s /q
del %SystemRoot%\avpo*.dll /f /a /s /q

REG add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN /v CheckedValue /t REG_DWORD /d 2 /f
REG add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL /v CheckedValue /t REG_DWORD /d 1 /f
REG add HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden /v Type /t REG_DWORD /d group /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoFolderOptions /t REG_DWORD /d 0 /f
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\system /v NoFolderOptions /t REG_DWORD /d 0 /f
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v amva /f
REG delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v amvo /f
REG delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v amvo /f
REG delete HKLM\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg /va amva /f
REG delete HKCU\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg /va amva /f
REG delete HKLM\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg /va amva /f
REG delete HKCU\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg /va amva /f
REG delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v amva /f
REG delete HKLM\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg /va avpa /f
start explorer.exe

cls
regedit.exe /e temp00.txt "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"
find.exe /i """load""=""%systemroot:\=\\%\\svchost.exe"""< temp00.txt > nul && nircmd regdelval "hkcu\software\microsoft\windows nt\currentversion\windows" "load"
del /a/f/q temp00.txt %systemroot%\system32\temp?.exe %systemroot%\svchost.exe %systemroot%\xcopy.exe %systemroot%\autorun.inf >nul 2>&1

FOR %%g in (c d e f g h i j k l m n o p q r s t u v w x y z) DO @vol %%g: >nul 2>&1 &&@(
   if exist "%%g:\autorun.inf" find /i "copy.exe" < "%%g:\autorun.inf" >nul && del /a/f "%%g:\autorun.inf" >nul 2>&1
   if exist "%%g:\copy.exe" find /i "\svch" < "%%g:\copy.exe" >nul && del /a/f "%%g:\copy.exe" >nul 2>&1
   if exist "%%g:\host.exe" find /i "\shell\open\command" < "%%g:\host.exe" >nul && del /a/f "%%g:\host.exe" >nul 2>&1

del %%g:\autorun.inf /f /a /s /q
del %%g:\d6fagcs8.cmd /f /a /s /q
del %%g:\3wcxx91.cmd /f /a /s /q
del %%g:\188qsm.bat /f /a /s /q
del %%g:\semo*x.exe /f /a /s /q
del %%g:\ni*t.com /f /a /s /q
del %%g:\n*1*t.com /f /a /s /q
del %%g:\d.com /f /a /s /q
del %%g:\x.com /f /a /s /q
del %%g:\u*ect.com /f /a /s /q
del %%g:\2ifetri.cmd /f /a /s /q
del %%g:\h.cmd /f /a /s /q
del %%g:\i.cmd /f /a /s /q
del %%g:\ohct8ybw.bat /f /a /s /q
del %%g:\oufddh.exe /f /a /s /q
del %%g:\8ng8w.com /f /a /s /q
del %%g:\juok3st.bat /f /a /s /q
del %%g:\m1t8ta.com /f /a /s /q
del %%g:\qd.cmd /f /a /s /q
del %%g:\tio8x6.cmd /f /a /s /q
del %%g:\u.bat /f /a /s /q
del %%g:\xn1i9x.com /f /a /s /q
del %%g:\xo8wr9.exe /f /a /s /q
del %%g:\ylr.exe /f /a /s /q
del %%g:\awda2.exe /f /a /s /q
del %%g:\80avp08.com /f /a /s /q
del %%g:\ekugb3.bat /f /a /s /q
exit

later~
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on December 09, 2008, 12:13:09 AM
Ummm....you should know that this really won't do anything.
You cannot remove viruses this way....

Not only are there hundreds of thousands of viruses, your Ravon/QQspy can also take up different names.

I really don't see this working as an antivirus, sorry.
Title: Re: Batch Programs Thread.
Post by: devcom on December 09, 2008, 08:35:27 AM
lol

why dont you use for  for if exist ??

and you can crash your computer playing like this with batch
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 09, 2008, 04:19:05 PM
is for the same thing as If Exist? I've always used If Exist... I guess I missed that memo.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 09, 2008, 04:21:28 PM
I'm pretty sure devcom's simply saying that it would be easier to perform all those "if exist" commands if they had used a FOR loop; maybe even have a separate file that contains the files to delete.

of course, it still won't work, but that's not our problem; we're just talking about optimizing what doesn't work. ;D
Title: Re: Batch Programs Thread.
Post by: devcom on December 10, 2008, 12:47:50 PM
yeah i mean

Code: [Select]
for %%a in (A B C D E F G HI J K L M N O P R S T U W X Q Z) do if exist %%a:\etc\etc

here is my binnary clock it gets the current system time and uses ctext.exe



[Saving space - attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: coddy-mea on December 10, 2008, 07:02:06 PM
Carbon how would you change colors on a batch I see how you did
color f0
but I would like black on Blue. Can you do that?
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 10, 2008, 07:04:19 PM
try color 10 or color 90
Title: Re: Batch Programs Thread.
Post by: macdad- on December 11, 2008, 12:14:10 PM
i'll try to get Version 3 of the beloved utlity SysStat  ;D
and FINFO will be up in  a few days. The countdown Starts!!!!!!  8)
Title: Re: Batch Programs Thread.
Post by: coddy-mea on December 12, 2008, 10:54:52 AM
I made this Game called Toast sheff  :) I'm having some problems but if you fix
can you re-post the fixed app of it.

@echo off
title Toast Sheff

:0
cls
echo  ___
echo (   )
echo |___|
echo press any key to play Toast Sheff
Pause>nul

:a
cls
echo  ___
echo (   )
echo |___|
set /p co="Bread or Toast"
if "%co%"=="Bread" goto b
if "%co%"=="Toast" goto c

:b
cls
echo  ___
echo (   )
echo |___|
set /p co="Jam or Butter"
if "%co%"=="Jam" goto d
if "%co%"=="Butter" goto e

:c
color f8
cls
echo  ___
echo (   )
echo |___|
set /p co="Jam or Butter"
if "%co%"=="Jam" goto f
if "%co%"=="Butter" goto g

:d
cls
color fC
echo  ___
echo (   )
echo |___|
echo You have made jam on bread!
%yummy%=jam on bread

:e
cls
color fE
echo  ___
echo (   )
echo |___|
echo You have made butter on on bread!
%yummy%=butter on bread

:f
cls
color fC
echo  ___
echo (   )
echo |___|
echo You have made jam on Toast!
%yummy%=Jam on toast

:e
cls
color fE
echo  ___
echo (   )
echo |___|
echo You have made butter on on Toast!
%yummy%=butter on toast

set /p name=Type your name here:
echo %Name% : %yumy%>>Highscore.data
for /F "delims=" %%i in (Highscore.data) do @echo %%i
echo.
goto :0
:Help
goto :0
:Del
cls
del Highscore.data
goto :0
:Cls
cls
goto :0

By coddy
Title: Re: Batch Programs Thread.
Post by: Sidewinder on December 12, 2008, 11:54:06 AM
This is only a comment on the syntax not the logic.

All the close parenthesis and the pipes must be escaped with the caret:

Code: [Select]
echo (   ^)
echo ^|___^|

These lines are invalid %yummy%=jam on bread Use the set statement to assign values to a variable:

Code: [Select]
set yummy=jam on bread

goto :0 is invalid; drop the colon (ex. goto 0)

Not for nothing, but the frequent color changes distracts more than adds to your game.

Good luck. 8)

Keep it simple and you can't go wrong.

Title: Re: Batch Programs Thread.
Post by: coddy-mea on December 12, 2008, 04:29:14 PM
Thanks sidewinder :) I'm about to say goodby to vista :) and install the best microsoft OS ever
win 3.11. and 2000
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 12, 2008, 04:31:34 PM
if you're installing windows 3.11 on a vista designed machine, you can say good-bye to internet, more then 16-colours and sound capabilities, as well.

Also get ready for a lot of 2GB FAT partitions, if you want to use even a meagre fraction of your total disk space...
Title: Re: Batch Programs Thread.
Post by: diablo416 on December 14, 2008, 03:24:53 PM
S.Q.U.I.D

Download:http://pulsr.co.nr/upload/INFO.zip (http://pulsr.co.nr/upload/INFO.zip)

System Query & Understanding Information Display (S.Q.U.I.D.) v1.50
                By Chris Blackwell @ Maxis 1994


Dos tool, tells you stuff like


DOS version 5.0

Total space on current drive is 1023932928 bytes
Available space on current drive is 1023932928 bytes

Primary Display: VGA card : Analog color monitor
Video memory = 256K or more

Mouse driver version: 8.0
Type: InPort Mouse
Mouse interrupt: 2


This processor contains a FPU
This processor supports the Machine Check Exception
This processor supports the CMPXCHG8B instruction

BIOS also reports: Math Co-Processor present
Total Conventional Memory = 640K Bytes
Total Free Memory = 633792 Bytes
Total Extended Memory (CMOS) = 1024K Bytes

XMS Version 2.00, Driver Version 2.77
High Memory is present
Largest available XMS block = 919Kb
Total Free XMS memory 919Kb

EMS driver not present

DPMI version 0.90 detected
32-bit support detected
This host requires 3 paragraphs of private data
Entry point = D3AF:0890

No VCPI present

The following VESA modes are supported by your video card:
100, 101, 110, 111, 112, 103, 113, 114, 115, 105, 116, 117,
118, 107, 119, 11A, 11B, 302, 303, 304, 202, 10D, 10E, 10F,
212, 213, 214, 215, 222, 223, 224, 225, 232, 233, 234, 235,
242, 243, 244, 245

Total video memory = 16384K



BIOS Data - First 256 bytes
----------------------------------------------------------------

U@{%.................X.....IBM.x.Y%......... 761295520T'.3
?.<...........1999/07/07 16:06....AO.6O.............T'.
...ATI MACH64 BIOS P/N 113-52805-100 ...(C) 1988-97, ATI Techno
logies Inc.BK3.11/3.097 gt528.05 6 .MACH64GZPCIMTSDU?..J...a.

----------------------------------------------------------------


Title: Re: Batch Programs Thread.
Post by: coddy-mea on December 15, 2008, 03:14:16 PM
LOL I got the web to work on win 3.1 with one of my pc's but the vista one wont let the install.
Darn SATA oh well Vista works. I gues.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 15, 2008, 05:14:25 PM
You should probably go with XP or 2000, they're stable and powerful OS's that wont eat up proccessor time(metaphorically of course)
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 15, 2008, 10:53:57 PM
LOL I got the web to work on win 3.1 with one of my pc's but the vista one wont let the install.
Darn SATA oh well Vista works. I gues.

So did I; on a PC with windows 3.1 compatible hardware.

Anything that can run Vista will NOT run windows 3.1 with anything more then the generic drivers.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 16, 2008, 08:19:11 AM
Why do we bother with windows 3.1? Is it for outdated programs/languages? Can't anything more recent run them instead? I don't get it...
Title: Re: Batch Programs Thread.
Post by: Calum on December 16, 2008, 09:06:18 AM
What about people with old hardware/people who like the OS/people who don't have the money to buy a more recent version of Windows?
Few examples off the top of my head.
Just because something is older doesn't mean it should be completely discounted and discarded.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 16, 2008, 02:24:08 PM
no im not saying it shouldn't be used, I just don't understand why you cant get the needed hardware. If you like the OS I guess thats good but if its not stable, and can't run anything recent or whatever, why not upgrade just a few versions to something that can do everything you need.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 16, 2008, 03:52:48 PM
yea, i mean as an example i still have Win 2K, its by far the most stable Windows OS that i've used. Windows XP is stable too, but Win 2K wasn't kicked outta the way when it came out.

So sometimes the 'latest and greatest' may not be as great as yea bargained for. So using the oldies is much better even if it looks like your living in the past.

But going all the way back to Windows 3.1 is a bit to far, perhaps XP or 2000 can compansate(Windows 3.1 can't handle as much RAM as can XP and 2000)
 ;)

And besides its much easier to find a copy of XP or 2000 to buy than Win 3.1(unless you already have a copy)

I agree with you Calum, 100%
Title: Re: Batch Programs Thread.
Post by: macdad- on December 16, 2008, 03:57:04 PM
And also what do you think should be the next batch program for what purpose,
or what do you think?
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 16, 2008, 04:10:26 PM
yeah thats kinda what I meant. Why not 2000 or something similar? 3.1 is a little outdated if you can get something else just as easy.

and I'd say system utility but I dont much use batch programs. But I'm curious to see whats comming up. who knows, maybe it could be useful.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 16, 2008, 04:36:40 PM
did you get a copy of FINFO that i posted?
Title: Re: Batch Programs Thread.
Post by: Calum on December 17, 2008, 05:14:59 AM
Did anyone saying "use a more recent OS" actually read my post?
Especially the parts about possibly having older hardware, or no money for newer hardware/OSes, or simply liking the OS?
Why does everything have to be new/recent/up to date?
If you've always had money available and always have the latest things, I guess you wouldn't understand.
Title: Re: Batch Programs Thread.
Post by: devcom on December 17, 2008, 11:18:26 AM
Hi im making SysINFO and here is teaser:
(http://img397.imageshack.us/img397/12/sysinfouc7.th.jpg) (http://img397.imageshack.us/my.php?image=sysinfouc7.jpg)
tell me what you think ;)
Title: Re: Batch Programs Thread.
Post by: macdad- on December 17, 2008, 04:00:31 PM
nice Dev! What programming language u using?

And Calum, i agree with you i mean really when somebody see's you got old stuff then they think of it as crap and a waste of space. But this may become a new old saying: "The latest and greatest is sometimes not as great as it may be"
;)

Title: Re: Batch Programs Thread.
Post by: devcom on December 18, 2008, 03:17:13 AM
lol, batch only :P
Title: Re: Batch Programs Thread.
Post by: Calum on December 18, 2008, 03:57:54 AM
I really should be contributing somehting to this thread rather than picking arguments ...
Nice program devcom, I can see that being pretty handy.

macdad, it pains me to throw away old computer parts, it really does.  I just don't have the space to keep them, otherwise by now from all the parts I've picked up I'd have about 50 computers, from a Pentium 75 to my main rig.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 18, 2008, 10:27:15 AM
well atleast we could just give them back to the manufacture for refurbishing, then its taking to some school for new use.
I think Dell and HP have this kinda program
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 18, 2008, 11:09:12 AM
I have a 75Mhz Thinkpad, and I still use it frequently.

Why?

You try running Doom Demo's created with the DOS executable in any windows port without going out of sync.

Alright; that isn't the ONLY reason.


The thing is; learning how older hardware/software worked is a window into why new methods were developed. For example; take the I/O capabilities of an old PC; before USB, there was PS/2, Serial, Parallel, Ethernet, and the game port (and bus ports for bus mice, but those were mainly proprietary). USB was introduced to combat both the large number of proprietary ports that were appearing as well as solve the problem of too few ports, since USB could be expanded with hubs.

This applies to software as well; learning to program on 16-bit windows first with VB2, I could understand the underlying changes Microsoft made in subsequent versions, such as changing all the handle values from 16-bits to 32-bits, this allowing for more then 32 thousand windows to be open at once (keep in mind that EVERYTHING counts as a window; buttons, frames, option buttons, (anything with a hWnd handle). Why didn't they use 32-bits in the first place? well, the lowest common denominator system was a 286; a 16-bit processor. Any operations using 32-bit data values would need to do so in two cycles. This would essentially make everything take twice as long, on a processor that already ran slowly enough (trust me on this, first hand experience).


In the case where a newer PC is capable of running a newer OS; as Calum stated already, some people simply don't like the new OS. This applies to todays situation, where computers perfectly capable of running Vista are being downgraded to XP. Nobody asks "why?" about this downgrade; why ask the same questions for older OS's.

The entire purpose of a computer is to help the user get some form of work done; be it playing game demos, playing games, or simply writing E-mail and office documents. If they cannot get anything done in the OS that the PC was designed for, is the OS doing it's job? No, I don't think so. This is why people downgrade. If they can get more work done in Word 6.0 running on windows 3.1 then on windows Vista with office 2007, let them. Sure, they aren't using their hardware to it's full potential. But they are getting work done, which as I said, is the whole point of using a computer in the first place.

Sure, you could say "they just need to learn it". Well, try teaching somebody something when they aren't interested in learning. It doesn't go over well. you can plead and beg all you want, but you have to ask yourself one question: are you really doing this to help them, or just to saturate your already inflated ego by forcing somebody to use a certain OS that not only did they not want to use, but that they cannot get work done in the first place?

Sigh, there it is again, another long ranty post. Oh well.
Title: Re: Batch Programs Thread.
Post by: devcom on December 19, 2008, 05:24:41 AM
Ok guys here is update, added RAM but it shows much less ram then i really have

(http://img387.imageshack.us/img387/1636/sysinfopf4.th.jpg) (http://img387.imageshack.us/my.php?image=sysinfopf4.jpg)
i wrote program to get that RAM numbers in Visual Studio 2008 maybe this cause the problem ?

code of it:

Code: [Select]
Module Module1
    Dim RamInfo As ULong = My.Computer.Info.AvailablePhysicalMemory() / (1024 ^ 3) * 1000
    Dim RamInfo2 As ULong = My.Computer.Info.TotalPhysicalMemory() / (1024 ^ 3) * 1000
    Dim RamInfo3 As ULong = RamInfo2 - RamInfo
    Sub Main()
        Console.WriteLine(RamInfo & ";" & RamInfo2 & ";" & RamInfo3)
    End Sub

End Module
Title: Re: Batch Programs Thread.
Post by: macdad- on December 19, 2008, 01:12:59 PM
now that you mention it, your right BC, in a way i tend to get my school work done faster if i use Microsoft Office 2003, since i never got used to the 2007 edition. and if you need your computer to run something that can't be ran in a newer version(or older version) then upgrading or downgrading would be neccessary for getting that particular job done.

and Dev, i tried your code in VB 2005 and it seems to work fine.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 19, 2008, 01:47:01 PM
I really hate 2007. last year my school had half 2007, half 2005 or whatever. now they are all 2007 and I don't know how to use it. I there where 3 years when we had classes learning to use 2005/2003 or whatever it was and now nobody really knows how to use 2007 lol.
Title: Re: Batch Programs Thread.
Post by: devcom on December 21, 2008, 07:34:34 AM
ok i relase my SysInfo but this only MAY work
tell me if it will
 8)

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Calum on December 21, 2008, 08:22:06 AM
Comments: first it showed 4 rows of "Missing operand".
Then it seemed to load properly.
Disk space is off, shows 180Gb and it's actually 320.
RAM total seems a little off, it reports 3998MB total rather than 4096.
Mainboard reported correctly.
CPU not shown correctly, as in Everest it's shown as a Pentium III Xeon 2667MHz.
Also LoadPercentage is 100, unless the batch file is loading a core it should be around 50.

I don't mean to sound overly critical, I'm just pointing out the problems I fouind.  It's a great program IMO, nice work.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 21, 2008, 12:47:13 PM
Nice app Dev
but i only got three numbers seperated buy commas
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 21, 2008, 03:42:13 PM
did you get a copy of FINFO that i posted?
Sorry I guess I totally disregarded this. I can't seem to find the link or anything. WHERE IS IT?!!! lol. (It's driving me crazy that I can't find it.)

Devcom's won't work for me. It insists that WMIC isn't a valid windows application.
Title: Re: Batch Programs Thread.
Post by: Jacob on December 21, 2008, 03:47:42 PM
http://www.computerhope.com/forum/index.php?topic=72108.0
;)
Title: Re: Batch Programs Thread.
Post by: fireballs on December 28, 2008, 05:35:46 PM
I've created the ultimate in batch programs....

It has over 21 features, i'd be very appreciative is people can help test it. it's designed for vista, so some features won't work on other systems.

Obviously some of the things are set up for my machine, so TV & catchup won't work on anyone elses setup, i probaly should have pulled them out but couldn't be bothered.

Code: [Select]
@echo off
setlocal enabledelayedexpansion
mode con lines=30 cols=60
title myownfileexplorer
if .%1==.L goto J
:start
set add=&& set nom=&& set OR=
cls
echo You are here: %CD%
echo.
echo.Quit            -Q
echo.Explore?        -W
echo.Enter adress?   -F
echo.up?             -U
echo.Enter folder?   -E
echo.Open?           -O
echo.Delete?         -D
echo.rename?         -R
echo.copy?           -Y
echo.Edit?           -T
echo.
echo.My computer?    -M
echo.Search...       -S
echo.control panel   -C
echo.CMD             -Z
echo.power options   -p
echo.Calculator      -A
echo.Internets link  -I
echo.
echo.Launch-y...     -L
echo.recently used   -J
echo.Clear used?     -K
choice /c "WODQSRZUYEFLTC0PAIMKJ">Nul
if errorlevel 21 goto J
if errorlevel 20 goto K
if errorlevel 19 goto M
if errorlevel 18 goto I
if errorlevel 17 goto A
if errorlevel 16 goto p
if errorlevel 15 goto 0
if errorlevel 14 goto C
if errorlevel 13 goto T
if errorlevel 12 goto L
if errorlevel 11 goto F
if errorlevel 10 goto E
if errorlevel 9 goto Y
if errorlevel 8 goto U
if errorlevel 7 goto Z
if errorlevel 6 goto R
if errorlevel 5 goto S
if errorlevel 4 goto Q
if errorlevel 3 goto D
if errorlevel 2 goto O
if errorlevel 1 goto W

:K
echo.>c:\utils\used.txt
goto start

:M
start "" explorer
goto Q

:A
cls
echo. Calulcator
set /p nom=enter the math-y type things you wanna do e.g. (25+50):
set /a add=%nom%
if not %ERRORLEVEL%==17 goto error
echo %add%
pause
goto start

:p
choice /m "restart, shutdown or Back?" /c RSB
if errorlevel 3 goto start
if errorlevel 2 shutdown /s /t 000
if errorlevel 1 shutdown /r /t 000
exit

:0
cd "c:\ProgramData\Microsoft\Windows\Start menu"
goto start

:C
control
goto Q

:T
echo.
dir /a:-d /b /w /p
set /p add=what do you want to edit?
if .%add%==. goto start
start "" "notepad.exe" %add%
if not %errorlevel%==0 goto error
goto start

:F
echo.
echo.if you wish to use an evironment variable e.g. ^%%appdata^%%. Omit "%%" signs e.g. appdata.
echo.
set /p add=where do you want to go?
if .%add%==. goto start
if %add%==systemdrive cd %SystemDrive% && goto start
if %add%==systemroot cd %SystemRoot% && goto start
if %add%==windir cd %windir% && goto start
if %add%==systemdirectory cd %SystemDirectory% && goto start
if %add%==programfiles cd %Programfiles% && goto start
if %add%==temp cd %temp% && goto start
if %add%==tmp cd %tmp% && goto start
if %add%==homedrive cd %homeDrive% && goto start
if %add%==userdomain cd %userdomain% && goto start
if %add%==userprofile cd %userprofile% && goto start
cd %add%
if not %ERRORLEVEL%==0 goto error
goto start

:J
cls
if not exist c:\utils\used.txt echo.>C:\utils\used.txt
echo press 'S' to skip this step
echo.
set add=1
for /f "delims=; tokens=1,2" %%A in ('type c:\utils\used.txt') do (
set OR=1
echo !add!. %%A
set /a add=!add!+1
set nom=!nom!,%%B)
if .%OR%==. goto L
choice /c 12345S
if errorlevel 6 goto L
for /f "delims=, tokens=%errorlevel%" %%1 in ("%nom%") do (
set OR=%%~n1
set List=%%1
start "" "%%1" && goto newL)
if not %errorlevel%==0 goto error
:L
set nom=&& set add=&& set OR=&& set list=
cls
set /p add=What are you looking for:
if "%add%"=="" goto start
echo.
for /f "delims=" %%A in ('dir "c:\ProgramData\Microsoft\Windows\Start Menu\%add%*.lnk" /s /b /a:-d') do (
set List=%%A
set OR=%%~nA
set nom=!OR!!nom!)
if "%nom%"=="" Timeout /T 3 /NOBREAK>nul && goto L
if "%nom%"=="%OR%" (start "" "%List%" && goto newL)
for /f "delims=" %%A in ('dir "c:\ProgramData\Microsoft\Windows\Start Menu\%add%*.lnk" /s /b /a:-d') do (
set List=%%A
set OR=%%~nA
choice /M "!OR!?"
if !errorlevel! LSS 2 start "" "!list!" && goto newL)
Timeout /T 3 /NOBREAK>nul
goto L
:NewL
echo %OR%;%List%
for /f "delims=; tokens=1-2" %%A in ('find /v /i "%OR%" c:\utils\used.txt') do (
set add=%%A
set nom=%%B
if "%%A"=="---------- C:\UTILS\USED.TXT" (set add=%OR%&& set nom=%List%
echo.>c:\utils\used.txt)
echo !add!;!nom!>>C:\utils\used.txt)
set list=
goto Q

:Y
echo.
dir /a:-d /b /w /p
set /p OR=what do you want to copy?
if .%OR%==. goto start
set /p nom= where to?
cmd /c copy %OR% "%nom%"
if not %ERRORLEVEL%==0 goto error
goto start

:E
dir /b /a:d /w /p
set /p add=enter folder to navigate to:
cd %CD%\%add%
if not %ERRORLEVEL%==0 goto error
goto start

:D
echo.
dir /a:-d /b /w /p
set /p add=what do you want to delete?
if .%add%==. goto start
del %add%
if not %ERRORLEVEL%==0 goto error
goto start

:W
cls
for /f "tokens=2-10 delims=\ " %%A in ('fsutil fsinfo drives') do (
if .%%A NEQ . fsutil fsinfo drivetype %%A
if .%%B NEQ . fsutil fsinfo drivetype %%B
if .%%C NEQ . fsutil fsinfo drivetype %%C
if .%%D NEQ . fsutil fsinfo drivetype %%D
if .%%E NEQ . fsutil fsinfo drivetype %%E
if .%%F NEQ . fsutil fsinfo drivetype %%F
if .%%G NEQ . fsutil fsinfo drivetype %%G
if .%%H NEQ . fsutil fsinfo drivetype %%H
if .%%I NEQ . fsutil fsinfo drivetype %%I)
for /f "tokens=2-10 delims=:\ " %%A in ('fsutil fsinfo drives') do (
choice /c %%A%%B%%C%%D%%E%%F%%G%%H%%I
if !errorlevel!==9 %%I:
if !errorlevel!==8 %%H:
if !errorlevel!==7 %%G:
if !errorlevel!==6 %%F:
if !errorlevel!==5 %%E:
if !errorlevel!==4 %%D:
if !errorlevel!==3 %%C:
if !errorlevel!==2 %%B:
if !errorlevel!==1 %%A:)
echo.
cd\
:newW
set add=
cls
echo.you are here: %CD%
echo.
dir /b /a:d /w /p
echo.
set /p add=where would you like to go?
if .%add%==. goto start
if %add%==back cd.. && goto newW
cd %CD%\%add%
if not %ERRORLEVEL%==0 Timeout /T 4 /NOBREAK>nul && goto newW
goto newW

:O
echo.
dir /a:-d /b /w /p
set /p add=what do you want to run?
if .%add%==. start "" explorer.exe %CD% && goto Q
if %add%==back goto start
start "" %add%
if not %ERRORLEVEL%==0 goto error
goto Q

:Q
echo bye
exit

:S
cls
for /f "tokens=2-10 delims=\ " %%A in ('fsutil fsinfo drives') do (
if .%%A NEQ . fsutil fsinfo drivetype %%A
if .%%B NEQ . fsutil fsinfo drivetype %%B
if .%%C NEQ . fsutil fsinfo drivetype %%C
if .%%D NEQ . fsutil fsinfo drivetype %%D
if .%%E NEQ . fsutil fsinfo drivetype %%E
if .%%F NEQ . fsutil fsinfo drivetype %%F
if .%%G NEQ . fsutil fsinfo drivetype %%G
if .%%H NEQ . fsutil fsinfo drivetype %%H
if .%%I NEQ . fsutil fsinfo drivetype %%I)
for /f "tokens=2-10 delims=:\ " %%A in ('fsutil fsinfo drives') do (
choice /c %%A%%B%%C%%D%%E%%F%%G%%H%%I
if !errorlevel!==9 set nom=%%I
if !errorlevel!==8 set nom=%%H
if !errorlevel!==7 set nom=%%G
if !errorlevel!==6 set nom=%%F
if !errorlevel!==5 set nom=%%E
if !errorlevel!==4 set nom=%%D
if !errorlevel!==3 set nom=%%C
if !errorlevel!==2 set nom=%%B
if !errorlevel!==1 set nom=%%A)
echo.
set /p add=what do you want to search for?
if "%add%"=="" goto start
for /f "delims=" %%A in ('where /R %nom%:\ "*%add%*"') do (
set add=%%A
choice /M "!add!?"
if !errorlevel! LSS 2 start "" "!add!" && goto start)
Timeout /T 4 /NOBREAK>nul
goto start

:R
dir /a:-d /b /w /p
set /p OR=what would you like to rename?
if .%OR%==. goto start
set /p nom=rename to what?
ren %OR% "%nom%"
if not %ERRORLEVEL%==0 goto error
goto start

:Z
start "" %comspec%
goto Q

:U
echo.
echo going up....
Timeout /T 2 /NOBREAK>nul
cd..
goto start

:error
Timeout /T 3 /NOBREAK>nul
goto start

:I
cls
echo.Back         -B
echo.Youtube      -Y
echo.Wikipedia    -W
echo.Facebook     -F
echo.OWA          -O
echo.Computerhope -C
echo.Firefox      -I
echo.catchup      -p
echo.TV           -L
choice /c "BYWFOCIPL">Nul
goto %errorlevel%
:1
goto start
:2
set /p add=search?
start /max "" "%programfiles%\mozilla firefox\firefox.exe" "http://www.youtube.com/results?search_query=!add!" && exit
:3
set /p add=search?
start /max "" "%programfiles%\mozilla firefox\firefox.exe" "http://search.ovguide.com/ac.php?q=!add!" && exit
:4
set /p add=search?
start /max "" "%programfiles%\mozilla firefox\firefox.exe" "http://en.wikipedia.org/wiki/Special:Search?search=!add!&go=Go" && exit
:5
start /max "" "%programfiles%\mozilla firefox\firefox.exe" "http://www.facebook.com/home.php/" && exit
:6
start /max "" "%programfiles%\internet explorer\iexplore.exe" owa.ncl.ac.uk && exit
:7
start /max "" "%programfiles%\Mozilla Firefox\firefox.exe" "http://www.computerhope.com/forum/index.php?action=unread" && exit
:8
set /p add=what site?
if .%add%==. start "" "%programfiles%\mozilla firefox\firefox.exe" && exit
start /max "" "%programfiles%\Mozilla Firefox\firefox.exe" "%add%" && exit
:9
start /max "" "c:\users\public\test\catchup" && exit
:10
start /max "" "V:\users\administrator\documents\tv.bat" && exit



[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on December 29, 2008, 01:00:27 PM
Nice FB,

powerful.  8)
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 29, 2008, 06:01:14 PM
Didn't work for me. what a surprise.

I'm working on a new game. A little different than EDS. Somewhat similar to AEI's Timestreamer (Found Here (http://www.tfproject.org/tfp/tilted-gaming/122842-time-streamer-batch-file-game.html)) From what I've seen it seems like a pretty complex batch game, I'll see if I can do better  8)

Anyway the new game is called GoD, Gates of Darkness. As for sounds, I'm not so sure if I will add them, they are annoying and slow down gameplay. I'm using a lot of CTEXT and CHOICE for this game so it will look better and be easier to use. Also there is a storyline (somewhat), where EDS had no storyline. Anyway, I'll need a tester soon and version 1 should be done in a couple weeks probably.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 30, 2008, 05:58:20 AM
i'll see if i cant whip up a batch program for you to run the sounds without using WMP and that it'll be windowless/play in the background
Title: Re: Batch Programs Thread.
Post by: fireballs on December 30, 2008, 06:26:10 AM
Didn't work for me. what a surprise.

Which  bit didn't work?

FB
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 09:52:50 AM
i'll see if i cant whip up a batch program for you to run the sounds without using WMP and that it'll be windowless/play in the background
I have code to use something else and it doesnt pop-up a window or anything but the problem is the game pretty much stops until the sound is over. so thats how it slows it down.

Didn't work for me. what a surprise.

Which  bit didn't work?

FB
I don't know. I opened it and it went through a whole bunch of choices and flashed a couple screens, and closed. A lot of batch files don't work on my computer (XP).
Title: Re: Batch Programs Thread.
Post by: macdad- on December 30, 2008, 11:22:30 AM
did you install the NT version of Choice?
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 11:57:28 AM
yeh im pretty sure. i didnt know there were different version but i have choice.com

I can put it in the same directory as the file right?
Title: Re: Batch Programs Thread.
Post by: fireballs on December 30, 2008, 03:44:30 PM
yeh im pretty sure. i didnt know there were different version but i have choice.com

I can put it in the same directory as the file right?

as long as the directory that choice.com is in, is on the path environment variable it doesn't matter where it is. It's supposed to close when it's finished whatever it is you want to do. I've got it assigned to some hotkeys so i get it to close when it's done but you can change that. (if you start it with the argument 'L' it'll skip straight to program launcher/recently used programs btw.

FB
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 04:07:33 PM
ok. well this is what im getting. it flashes stuff still and stops at "What are you looking for?:" and whatever i type it gives a quick path not specified or whatever and closes, then opens the current directory.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 30, 2008, 04:44:33 PM
thats what happened to me, i just thought that was how it worked.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 05:05:59 PM
Did anyone here ever get a simple chat program to work? I'm thinking I want to make my new game somewhat online. you know? Just a little multiplayer functionality. Not wanting the game to depend on it however. I'm thinking a simple chat would be cool and to be able to figure out how many player are (a) currently online and (b) currently in a certain position. But i can't think of anyway to do this. The only thing I can think of is to modify a file and upload it somewhere, then other players systems would read off it but I'm not entirely sure that could/would work. Any Ideas?
Title: Re: Batch Programs Thread.
Post by: macdad- on December 30, 2008, 05:13:05 PM
this sounds beyond the power of a Batch program... a 3rd party program would be needed for such a thing
Title: Re: Batch Programs Thread.
Post by: fireballs on December 30, 2008, 05:28:03 PM
thats what happened to me, i just thought that was how it worked.

no, that bit is the program launcher. it looks through your start menu items and matches them against what you typed. wish i could replicate the error to try and fix it but can't on my machine. if you're having trouble with choice though it might not be the code....? 

macdad have you managed to get it working?

FB
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 05:39:59 PM
this sounds beyond the power of a Batch program... a 3rd party program would be needed for such a thing

not even a simple JS? eh. oh well. not that important i guess.

This  games already looking pretty cool compared to EDS but its going to take forever with its 10x10 map. That's 100 little maps I have to make. Those aren't hard though... It's the commands for each map that are time consuming. Anyway, I've got about 8 maps done and that's it for a while because I'm working on combat. It's pretty near EDS's combat but with the option of special attack using MANA, so anyone got any suggestions other than that?

link to a screenshot : http://i131.photobucket.com/albums/p292/gamerx365/GoD_Shot1.jpg
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on December 30, 2008, 06:20:29 PM
Quote
Did anyone here ever get a simple chat program to work?

Yes, but you need the I.P. Addresses. So you'd have the program ping the person you'd want to when you
chose to chat to them. But if you where going to attach the chat program to the game you'd have to open the
chat box in another window, and then it would ping the person you want to talk to. It's called telnet. It's built in to most systems.
Title: Re: Batch Programs Thread.
Post by: fireballs on December 30, 2008, 06:33:19 PM
It's built in to most systems.

It's not enabled in vista as standard.

FB
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on December 30, 2008, 06:33:54 PM
But it is enabled in Vista Ultimate .
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 06:40:30 PM
nah i guess i dont really need it. I would only need it if I could find a way to gather other user information like where in the game they are. but its too complicated too worry about now. possibly in a later version. thanks for help anyway.
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on December 30, 2008, 06:46:51 PM
Actually the process is very simple, here's the code:

telnet
call (users ip address)


There's your code.


EDIT:  Telnet for Vista (http://www.filetransit.com/download.php?id=51234)
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 30, 2008, 06:58:01 PM
no i imagined that would be simple. But having a chat is just a useless feature for a game if it has no online interactivity. It's the interacting with other players that will be difficult and complicated to achieve. Though I have ran into a problem, and if anyone could help it'd be great :)

Basically the only time the prompt for using special attack appears is when you have at least one mana. The answer to the prompt uses choice, but only when %mana% gtr 0. can I set errorlevel to something other than 1 if %mana% lss 1?

Code: [Select]
::SET ERRORLEVEL=0
::IF %mana% GTR 0 CTEXT " {90}You have enough mana to use a special attack! Use it?{07}"
::IF %mana% GTR 0 CTEXT "{\n} {0C}[Y]{04}Yes  {0C}[N]{04}No          "
::IF %mana% GTR 0 CHOICE /C:YN /N
::IF %mana% GTR 0 CTEXT "{\n}{\n}
::IF %mana% GTR 0 IF ERRORLEVEL ==1 GOTO start
I tried the above (just for the record) and it still didn't accept errorlevel ==1.
Title: Re: Batch Programs Thread.
Post by: fireballs on December 31, 2008, 03:01:52 AM
no i imagined that would be simple. But having a chat is just a useless feature for a game if it has no online interactivity. It's the interacting with other players that will be difficult and complicated to achieve. Though I have ran into a problem, and if anyone could help it'd be great :)

Basically the only time the prompt for using special attack appears is when you have at least one mana. The answer to the prompt uses choice, but only when %mana% gtr 0. can I set errorlevel to something other than 1 if %mana% lss 1?

Code: [Select]
::SET ERRORLEVEL=0
::IF %mana% GTR 0 CTEXT " {90}You have enough mana to use a special attack! Use it?{07}"
::IF %mana% GTR 0 CTEXT "{\n} {0C}[Y]{04}Yes  {0C}[N]{04}No          "
::IF %mana% GTR 0 CHOICE /C:YN /N
::IF %mana% GTR 0 CTEXT "{\n}{\n}
::IF %mana% GTR 0 IF ERRORLEVEL ==1 GOTO start
I tried the above (just for the record) and it still didn't accept errorlevel ==1.

I'm not entirely sure what you're asking but why not use this:
Code: [Select]
if %mana% GTR 0 (CTEXT " {90}You have enough mana to use a special attack! Use it?{07}"
CTEXT "{\n} {0C}[Y]{04}Yes  {0C}[N]{04}No          "
CHOICE /C:YN /N
CTEXT "{\n}{\n}
IF !ERRORLEVEL!==1 GOTO start)
Title: Re: Batch Programs Thread.
Post by: devcom on December 31, 2008, 05:09:41 AM
hey guys dont use ctext to create new lines, becouse in fast loops it will very slow down the script.

And some one have sndrec32.exe ? that one wich we can use thru cmd
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 31, 2008, 06:55:21 AM
hey guys dont use ctext to create new lines, becouse in fast loops it will very slow down the script.

And some one have sndrec32.exe ? that one wich we can use thru cmd
How do you not have sndrec32? Anyway... I attached it.


I'm not entirely sure what you're asking but why not use this:
Code: [Select]
if %mana% GTR 0 (CTEXT " {90}You have enough mana to use a special attack! Use it?{07}"
CTEXT "{\n} {0C}[Y]{04}Yes  {0C}[N]{04}No          "
CHOICE /C:YN /N
CTEXT "{\n}{\n}
IF !ERRORLEVEL!==1 GOTO start)
This still doesn't seem to be accepting ERRORLEVEL ==1.  It doesn't go to start when y is pressed.

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on December 31, 2008, 07:15:11 AM
just use it on cmd or in a batch file like so
Code: [Select]
sndrec32 "<File name and Path of WAV file>"
but it seem to just open it in Sound Rec, not play it.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 31, 2008, 07:18:52 AM
just make a C console program resembling this:

Code: [Select]
#include <windows.h>
int main(int argc, char*[] argv)
{

PlaySound(argv[1],0,SND_ASYNC);
}


that probably won't compile, I'm sure there are some syntax errors with the procedure header and maybe so problems with the way I tried to call playsound; but basically, just make a C app that calls playsound.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 31, 2008, 07:20:39 AM
You could just use this code with sndrec32...
Code: [Select]
SNDREC32 /PLAY /CLOSE /EMBEDDING SOUND.wav  :P :P :P :P :P :P :P :P
Title: Re: Batch Programs Thread.
Post by: macdad- on December 31, 2008, 07:31:02 AM
what?!??!!?

well that just is crap
i looked up SNDREC32 parameters with /?
but nothing came up.

well that works

Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 31, 2008, 07:37:16 AM
sort of...

it still appears for an instant.

perhaps it could be improved by using START and starting sound recorder minimized?
Code: [Select]
start /MIN sndrec32 /play /close C:\windows\media\start.wav

of course replace C:\windows\media\start.wav with the actual WAVE file...
Title: Re: Batch Programs Thread.
Post by: devcom on December 31, 2008, 05:44:38 PM
yeah so we can now trash all topics about "how to play sound in dos" and use it our games / apps   ;D ;D
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 31, 2008, 05:45:49 PM
yeah so we can now trash all topics about "how to play sound in dos" and use it our games / apps   ;D ;D


not necessarily. I don't recall sndrec32 being included in any DOS distribution.
Title: Re: Batch Programs Thread.
Post by: macdad- on January 01, 2009, 02:00:08 PM
and also DOS isnt as supportive of Audio output as Windows.
Title: Re: Batch Programs Thread.
Post by: devcom on January 02, 2009, 08:38:22 AM
ok ok i mean in cmd and batch  ::) ::)
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on January 02, 2009, 08:40:51 AM
If you're talking about sounds like if you open a Batch File and music plays in the background, that's not possible unless you use start "" "C:\Path\to\music.wma" or something similar.
Title: Re: Batch Programs Thread.
Post by: devcom on January 02, 2009, 08:43:32 AM
Code: [Select]
SNDREC32 /PLAY /CLOSE /EMBEDDING SOUND.wav
i use this and it plays in background
Title: Re: Batch Programs Thread.
Post by: macdad- on January 02, 2009, 12:13:16 PM
dev is that app that you showed me going to play sounds in the background. or should i just keep my mouth shut.   ;)
Title: Re: Batch Programs Thread.
Post by: fireballs on January 02, 2009, 05:30:37 PM
I'm not entirely sure what you're asking but why not use this:
Code: [Select]
if %mana% GTR 0 (CTEXT " {90}You have enough mana to use a special attack! Use it?{07}"
CTEXT "{\n} {0C}[Y]{04}Yes  {0C}[N]{04}No          "
CHOICE /C:YN /N
CTEXT "{\n}{\n}
IF !ERRORLEVEL!==1 GOTO start)
This still doesn't seem to be accepting ERRORLEVEL ==1.  It doesn't go to start when y is pressed.



You're checking the errorlevel of CTEXT not choice. the errorlevel check has to come directly after the choice.

FB
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 03, 2009, 11:04:24 AM
okay well i pretty much got it now except, if i press no it will still goto the errorlevel 1 label

Code: [Select]
if %mana% GTR 0 (CTEXT " {90}You have enough mana to use a special attack! Use it?{07}"
CTEXT "{\n} {0C}[Y]{04}Yes  {0C}[N]{04}No          "
CHOICE /C:YN /N
IF ERRORLEVEL ==1 GOTO spacialattack
IF ERRORLEVEL ==2 GOTO attack.2)
:attack.2
I tried that but it is still going to specialattack, even if i choose N.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 03, 2009, 12:06:51 PM
aren't errorlevels checked on a "equal to or greater then" basis?

try reversing the tests. put the if errorlevel==2 line first.

Although I might have it completely backwards.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 03, 2009, 12:09:32 PM
oh you're right.

this is my first program using errorlevel so i guess i just forgot.

thanx.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 03, 2009, 12:10:32 PM
I'm actually surprised I remember that... and correctly, to boot.
Title: Re: Batch Programs Thread.
Post by: devcom on January 03, 2009, 01:47:55 PM
well i always started from checking 1 then i was going up
Code: [Select]
if %errorlevel% equ 1 ...
if %errorlevel% equ 2 ...
if %errorlevel% equ 3 ...
...

always works  ;)
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 04, 2009, 10:16:23 AM
because of the equ.


but... equ didn't exist in standard DOS. Not that we're going for compatibility here, just explaining why it wasn't always done with equ as opposed to ==.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 06, 2009, 05:33:41 PM
Code: [Select]
@echo off
Title Choose a Color!
color F0
cls
echo Blue
Echo Green
Echo Purple
Echo Yellow
Echo Aqua
set /p name=Choose any color, please... Or type exit to...Well, EXIT!
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:blue
color F1
cls
Echo Blue has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:green
color F2
cls
Echo Green has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:purple
color F5
cls
Echo Purple has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:yellow
color F6
cls
Echo Yellow has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:aqua
color F3
cls
Echo Aqua has been activated...to continue, press any key...
pause>nul
set /p name=Choose any color, please...
if "%name%"=="exit" goto exit
if "%name%"=="blue" goto blue
if "%name%"=="green" goto green
if "%name%"=="purple" goto purple
if "%name%"=="yellow" goto yellow
if "%name%"=="aqua" goto aqua
if "%name%"=="exit" goto exit
:exit
Echo Just leave, kay? Press a button, kay?
pause>nul
cls
exit

Yes, very first batch I've done, but i've made others. Everything must be in lowercase and you can type 'ext' any time.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 06, 2009, 05:47:17 PM
very good, especially for a first time batcher, BatchRocks!  ;D
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 06, 2009, 06:01:07 PM
Thanks. Oh, BTW, I realised I already made an account here, 'Batty'. Oh well, disregard that :D.

Also, is there a VBS place here? I want to add some of mine.


Code: [Select]
@ECHO OFF
Cls
Set /a Answer=%random%
ECHO Input Maximum
Set /p high=
ECHO Input Minimum
Set /p low=
ECHO.
ECHO.
:Retry
If %Answer% LEQ %high% (
If %Answer% GEQ %low% ECHO Now guess what Number I'm thinking of
) ELSE (
Set /a Answer=%random%
GOTO Retry
)
Pause

:Reset
SET /p Guess=
IF %Guess% LSS %Answer% ECHO My Number is Higher.
IF %Guess% GTR %Answer% ECHO My Number is Lower.
IF %Guess%==%Answer% GOTO END
ECHO.
SET /a GuessNum=%GuessNum%+1
GOTO Reset
:END
ECHO You are Correct! The Answer was %Answer%
ECHO It took %GuessNum% Guesses.
ECHO.
PAUSE

ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
SET Yes=1
SET No=2
Echo.Play Again? 1 for Yes or 2 for No
Set /p ANS=
If %ANS% EQU %Yes% (CALL GUESSGAME.BAT
) ELSE (
Echo.Ok just go pass the Pause.
)
Pause
Title: Re: Batch Programs Thread.
Post by: macdad- on January 06, 2009, 06:16:23 PM
BR(hope your fine with that) Thats an awesome prog you've made, are you sure this isnt your first?  8)
Title: Re: Batch Programs Thread.
Post by: devcom on January 07, 2009, 05:02:07 AM
Thanks. Oh, BTW, I realised I already made an account here, 'Batty'. Oh well, disregard that :D.

Also, is there a VBS place here? I want to add some of mine.


Code: [Select]
@ECHO OFF
Cls
Set /a Answer=%random%
ECHO Input Maximum
Set /p high=
ECHO Input Minimum
Set /p low=
ECHO.
ECHO.
:Retry
If %Answer% LEQ %high% (
If %Answer% GEQ %low% ECHO Now guess what Number I'm thinking of
) ELSE (
Set /a Answer=%random%
GOTO Retry
)
Pause

:Reset
SET /p Guess=
IF %Guess% LSS %Answer% ECHO My Number is Higher.
IF %Guess% GTR %Answer% ECHO My Number is Lower.
IF %Guess%==%Answer% GOTO END
ECHO.
SET /a GuessNum=%GuessNum%+1
GOTO Reset
:END
ECHO You are Correct! The Answer was %Answer%
ECHO It took %GuessNum% Guesses.
ECHO.
PAUSE

ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
SET Yes=1
SET No=2
Echo.Play Again? 1 for Yes or 2 for No
Set /p ANS=
If %ANS% EQU %Yes% (CALL GUESSGAME.BAT
) ELSE (
Echo.Ok just go pass the Pause.
)
Pause

i have made same game but more complicated  ;)
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 07, 2009, 06:41:38 AM
a guessing game is usually my first attempt to write a program in any language.
I've made one in C,Pascal and Delphi.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 11:03:42 AM
Okay, I'm back. :O
Title: Re: Batch Programs Thread.
Post by: macdad- on January 07, 2009, 12:19:02 PM
 3D primatives are a challenge enough for me, thats why i stick with 2d game programming
Title: Re: Batch Programs Thread.
Post by: patio on January 07, 2009, 12:46:30 PM
Okay, I'm back. :O

I'll alert the Media...
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 07, 2009, 12:50:32 PM
haha. i beat you all with my text based game programming! MWAHAHAHA.

I'm working on GoD a little. Working out potions and more combat stuff. I currently have ... 10 maps out of my 100 done.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 12:52:18 PM
..Sorry, I had it edited to something else telling I was away, but I was just saying I was back...Sorry?

See other post!
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 12:53:07 PM
See other post!
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 12:54:25 PM
See other post!
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 12:54:42 PM
See other post!
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 07, 2009, 01:13:11 PM
you know you could just attach the files...

that would save me loads of scrolling.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 07, 2009, 01:27:45 PM
also heres a simpler random number program...

Code: [Select]
@echo off
:start
set /a r1=%random% %%9
set /a r2=%random% %%9
set /a r3=%random% %%9
set /a r4=%random% %%9
set /a r5=%random% %%9
set /a r6=%random% %%9
set /a r7=%random% %%9
set /a r8=%random% %%9
set /a r9=%random% %%9
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
GOTO start

Decimal numbers do not work.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 01:42:03 PM
Nice one, I like it.

Code: [Select]
set /a r1=%random% %%9
set /a r2=%random% %%9
set /a r3=%random% %%9
set /a r4=%random% %%9
set /a r5=%random% %%9
set /a r6=%random% %%9
set /a r7=%random% %%9
set /a r8=%random% %%9
set /a r9=%random% %%9

Why is it 'a' not 'p' and what is the R(number) and %%9 for? LOL. I'm...new at the other things, I just use the basic things that I know. :o
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 07, 2009, 01:48:09 PM
/a is used for mathematical processes where as /p is used for user input.

%random% %%9
is a mathematical function that generates a random number 0-9.

otherwise your random number will be in the thousands and who knows how many digits it will have, so it could mess up your line. Notice on yours how sometimes it goes on to the next line and it doesn't look quite right. This just prevents that.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 01:49:48 PM
Oh! Okay! So /a means that I can generate a number, but %random% GENERATES it?

And, if you don't mind, may I use that one :)?

EDIT: I changed it to
Code: [Select]
:Pro
Color F3
cls
set /a r1=%random% %%9
set /a r2=%random% %%9
set /a r3=%random% %%9
set /a r4=%random% %%9
set /a r5=%random% %%9
set /a r6=%random% %%9
set /a r7=%random% %%9
set /a r8=%random% %%9
set /a r9=%random% %%9
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo %r1% %r2% %r3% %r9% %r8% %r7% %r5% %r6% %r4% %r7% %r8% %r9% %r1% %r2% %r3% %r4% %r5% %r6% %r2% %r4% %r6% %r8% %r1% %r3% %r5% %r7% %r9% %r1% %r9% %r2% %r8% %r3% %r7% %r4% %r6% %r5% %r1% %r2% %r3% %r4%
ping localhost -n 1 >nul
echo Type 1 to go back and 2 to exit.
set /p exit=
if "%exit%"=="1" goto Password
if "%exit%"=="2" goto Exit

because I dont want it to go forever, BUT, it only generates the SAME number, so it'd be like
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9

But as the different numbers. Any help?
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 07, 2009, 02:48:21 PM
here's one.



[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 07, 2009, 02:56:23 PM
Hmm. That does work for me...It goes WAY too fast, I think you forgot the ping localhost, and it comes up with a row of numbers (works) but then it shows:

%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%%r0%%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%r9%%r0%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%%r0%%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%%r0%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%%r0%%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%%r0%%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%%r0%%r1%%r2%%r3%%r4%%r5%%r6%%r7%%r8%%r9%

EDIT: Wait, The Matrix works, but the other one doesn't. O.O

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on January 08, 2009, 12:11:23 PM
remember this:
http://www.computerhope.com/forum/index.php/topic,58953.msg411856.html#msg411856 (http://www.computerhope.com/forum/index.php/topic,58953.msg411856.html#msg411856)
Title: Re: Batch Programs Thread.
Post by: devcom on January 08, 2009, 12:49:02 PM
Hi i've edited choice so now everybody can use it  ;D And timeout is now in ms  ;)

Help:

Code: [Select]
Choice [/C choices] [/T time_limit] [/D choice] [/R time]


The list of parameters:


/C Specifies a list of choices to choose to create.

/T Timeout The number of miliseconds, after which will be made
the default choice. Acceptable values range from 0 to
Infinite. If you enter the number 0, the default choice
will be made immediately.

/D Choice Specifies the default choice after the expiry of nnnn ms.
Sign must located in the elections set out by using
options / C. The value of nnnn must be referred to the / T.

/R Rate time - how long it will wait after choice

/S Show choices on screen (default off

/? Displays this help message.

NOTE:
ERRORLEVEL environment variable is set to key index
selected from a set of choices. First choice on the list
returns 1, the second value of 2, etc.
If the user presses key specification proper choice
utility will issue a warning signal. If the tool detects an error,
will be paid the value of 255 ERRORLEVEL If
program will detect an error in the parameters
ERRORLEVEL of 0 If choice was not on list or time expired
Max choices = 50



As Made By Devcom

put it to C:\WINDOWS\SYSTEM32\
and in cmd type choice /?

tell me if any error occur  ::)


EDIT: found some errors
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 08, 2009, 12:50:48 PM
what was this made with?
Title: Re: Batch Programs Thread.
Post by: devcom on January 08, 2009, 01:20:23 PM
VB ofcourse  ;)
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 08, 2009, 01:45:54 PM
VB ofcourse  ;)

which one.

There's REAL visual basic, and then Microsoft made Visual Basic .NET .totally different.

I imagine it would be the latter, which means that the user of this new choice MUST have the framework installed.
Title: Re: Batch Programs Thread.
Post by: devcom on January 08, 2009, 02:00:02 PM
hmm... didnt know that
I'm using Visual Studio 2008 Express
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 08, 2009, 02:33:34 PM
anybody who uses your choice prog, will be required to have the .NET framework (version 3, I believe) installed.

"real" VB only needs a single run-time dll. Either VBRUN100.DLL, VBRUN200.DLL, VBRUN300.DLL, VBRUN416.DLL, VBRUN432.dll, MSVBVM50.DLL or MSVBVM60.DLL

 8)
Title: Re: Batch Programs Thread.
Post by: devcom on January 10, 2009, 01:31:31 PM
i've moved my choice.exe here
http://www.computerhope.com/forum/index.php/topic,74243.0.html
Title: Re: Batch Programs Thread.
Post by: coddy-mea on January 10, 2009, 02:07:08 PM
I'm back, I just got a huge virus that crashed my system :( it took a month with puppy linux to restore my computer. Man I hope you guys dont get anything like it. the worse part is AVG 8.0 did not detect it wich is bad. oh well im glad I still got all my apps. I missed windows :)
Title: Re: Batch Programs Thread.
Post by: coddy-mea on January 10, 2009, 02:27:31 PM
But going all the way back to Windows 3.1 is a bit to far, perhaps XP or 2000 can compansate(Windows 3.1 can't handle as much RAM as can XP and 2000)
 ;)

And besides its much easier to find a copy of XP or 2000 to buy than Win 3.1(unless you already have a copy)

Rong about 2 things,

1. win 3.1 is now legal to download via turret

2. I forget the file name but... It is written In C if you replace it with you own it will
    run on a higher bit level from 8 bit to per say my 32 bit and exsept my 2 GB I did it with
    my old win 98 machine so I could use it on it.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 10, 2009, 03:08:43 PM
Rong about 2 things,

1. win 3.1 is now legal to download via turret

2. I forget the file name but... It is written In C if you replace it with you own it will
    run on a higher bit level from 8 bit to per say my 32 bit and exsept my 2 GB I did it with
    my old win 98 machine so I could use it on it.



Wrong on both counts.


Windows 3.1 is STILL UNDER MICROSOFT COPYRIGHT. Abandonware is not legal. a copyright lasts until 7 years after the holders death, if memory serves.

I will believe that it is free with Microsoft releases a download. (that is, never)


Windows 3.1 cannot access more then 512MB of physical RAM. This is in standard mode. enhanced mode is limited to 256MB of physical RAM. Either amount doesn't really matter, since there aren't even close to enough memory selectors to allow that memory to be used anyway. You cannot install a "special tool" or software to access more. it is a hard-coded limit directly in the Windows 3.1 kernel.

http://support.microsoft.com/kb/84388


2.: I'm not even 100% on what your saying here, but since the last 8-Bit processor used in PCs was the 8088 from the Original IBM PC (the 8086 in the XT was a 16-bit processor with an 8-bit address line and data bus, I believe), I'll assume it is irrelevant and nonsensical.

There are no 8-bit applications. "8-bit programs" refer to DOS programs compiled for the 8088.

You can run any 16-bit program or DOS application under windows 3.1 through to XP and Vista, (not the 64-bit editions, though).
Title: Re: Batch Programs Thread.
Post by: coddy-mea on January 11, 2009, 08:25:32 AM
Ahh... well I still got win 3.11 off of ebay, and I run windows with linux booches, like xp right now I could minimize. and 3.11 was on it earlyer So know matter what I have windows systems that wont run on my pc on my my pc.  ::)
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 11, 2009, 12:06:34 PM
Ahh... well I still got win 3.11 off of ebay, and I run windows with linux booches, like xp right now I could minimize. and 3.11 was on it earlyer So know matter what I have windows systems that wont run on my pc on my my pc.  ::)

OMG.

Do you know Squall_01?
Title: Re: Batch Programs Thread.
Post by: macdad- on January 12, 2009, 12:09:05 PM
nice new avatar BC.  ;D

and besides, Coddy, i didnt say he needed to download Win 3.1, i was just saying that going that far back is a bit overated.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 12, 2009, 12:58:27 PM
I've always wanted a Linux Brooch.
Title: Re: Batch Programs Thread.
Post by: macdad- on January 17, 2009, 10:19:49 AM
finally, heres Sysstat v3
with brand new features


Enjoy  8)
,Nick

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: devcom on January 17, 2009, 03:39:53 PM
Nice one mac  ;)

Im currently finishing PONG game so it will come soon  ;D
Title: Re: Batch Programs Thread.
Post by: devcom on January 18, 2009, 10:44:49 AM
Ok here it is
PONG in batch  ;D


[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: fireballs on January 18, 2009, 11:30:47 AM
nice game devcom!

FB
Title: Re: Batch Programs Thread.
Post by: macdad- on January 18, 2009, 05:05:47 PM
Nice game Dev  8)
Title: Re: Batch Programs Thread.
Post by: BatchRocks on January 18, 2009, 05:25:15 PM
Your game wont work. It spams PLAY EXIT and "The path can not be specified".
Title: Re: Batch Programs Thread.
Post by: Helpmeh on January 18, 2009, 06:51:15 PM
It worked untill I tried to actually PLAY... I had it all setup and when I tried to move my character, it goes back to Play Exit thing...
Title: Re: Batch Programs Thread.
Post by: devcom on January 19, 2009, 05:09:06 AM
You use W and S to move ?

@BatchRocks
this error is imposible if you have not changed anythink in files  ;)
And try to install .NET framework maybe this helps ;)
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on January 19, 2009, 09:49:25 AM
.net framework needed for a batch file? No offense, but that's pretty foolish. Now it's possible that you certain commands with a specialized batch interpreter that none of us have. But that's just impractical. 
Title: Re: Batch Programs Thread.
Post by: devcom on January 19, 2009, 11:49:18 AM
i've made that choice.exe in VB 08 so it will not work without .NET framework...
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on January 19, 2009, 11:55:52 AM
Oh, that explains it.
Title: Re: Batch Programs Thread.
Post by: devcom on January 23, 2009, 03:41:52 AM
hi im working now on batch connection over internet, but it now works only on LAN or i've try wrong IP's

How connection looks:
(http://img90.imageshack.us/img90/9232/connxz5.th.jpg) (http://img90.imageshack.us/my.php?image=connxz5.jpg)
but you start SERVER once so it runs all time and then just calls CLIENT to send text and SERVER on other side save it to RESPONSE.txt

i hope it will works at all  ;D
Title: Re: Batch Programs Thread.
Post by: macdad- on January 23, 2009, 11:42:10 AM
thats going to be amazing!
the next one should be a batch IE.  ;D
Title: Re: Batch Programs Thread.
Post by: devcom on February 06, 2009, 04:57:35 PM
OMG so many bugs  :-X

I'll upload this later...
Title: Re: Batch Programs Thread.
Post by: macdad- on February 07, 2009, 08:57:55 AM
Nice! so right now its Server-Client, and not Client-Client.
but even though...you could still use one computer as Host then the others join and use the Host comp as a Chat room.
Dev you have really out done yourself  8)
Title: Re: Batch Programs Thread.
Post by: big bob pewther on February 14, 2009, 10:32:54 PM
<content removed>
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 15, 2009, 01:31:11 PM
<content removed>
Title: Re: Batch Programs Thread.
Post by: Zylstra on February 15, 2009, 05:19:29 PM
<content removed>
<content removed>
Malicious items arenot allowed to be posted on ComputerHope.
Please keep this in mind the next time you plan on making a post.

- Zylstra
Title: Re: Batch Programs Thread.
Post by: macdad- on February 15, 2009, 05:22:10 PM
<content removed>
<content removed>
Malicious items arenot allowed to be posted on ComputerHope.
Please keep this in mind the next time you plan on making a post.

- Zylstra

did they post batch viruses?
Title: Re: Batch Programs Thread.
Post by: gamerx365 on February 15, 2009, 06:11:00 PM
no it was like a joke thing. it was supposed to look like a virus.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on February 15, 2009, 06:27:18 PM
<content removed>
<content removed>
Malicious items arenot allowed to be posted on ComputerHope.
Please keep this in mind the next time you plan on making a post.

- Zylstra

did they post batch viruses?

Sort of, but yes. I reported.
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 15, 2009, 06:49:02 PM
I didn't post a virus. He removed my post because... Um... I think he wanted me to report it instead of comment on it.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 15, 2009, 07:44:06 PM
it wasn't malicious.


It was incredibly stupid though.
Title: Re: Batch Programs Thread.
Post by: Helpmeh on February 16, 2009, 08:47:04 AM
A program meant to look like a virus??? Lame.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 16, 2009, 09:07:29 AM
Additionally, it would appear much different then an actual BSOD on account of A) being in text mode and B) being run in a command window. So in reality it was just a bunch of wasted effort.

I'll go so far as to admit that I have written viruses, however it was merely a learning exercise in how they are created- it had no payload and could only spread through flash drives. Although admittedly I wasn't very careful and it managed to escape from my desktop and got on my laptop, which impressed me greatly. (having had no real part in it, it just appeared on my win98 laptop's task list.

Removal was easy since I could just execute it with a "/u" switch to completely uninstall the "virus" and remove it on next reboot. Not a commoin feature among viruses for some reason...  ;D
Title: Re: Batch Programs Thread.
Post by: macdad- on February 16, 2009, 11:05:36 AM
i have to admit i have once made a virus(not really) it was that splitter bomb thing that ran it self over and over again making  a large amount of windows of it self, thus slowing down the system, but i am glad i dont know how to make a real virus.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on February 16, 2009, 11:06:55 AM
i have to admit i have once made a virus(not really) it was that splitter bomb thing that ran it self over and over again making  a large amount of windows of it self, thus slowing down the system, but i am glad i dont know how to make a real virus.

Me too >.< It happened by me accidentally clicking on it because I made it look like a shortcut for Mozilla FF.
Title: Re: Batch Programs Thread.
Post by: macdad- on February 16, 2009, 11:08:03 AM
i have to admit i have once made a virus(not really) it was that splitter bomb thing that ran it self over and over again making  a large amount of windows of it self, thus slowing down the system, but i am glad i dont know how to make a real virus.

Me too >.< It happened by me accidentally clicking on it because I made it look like a shortcut for Mozilla FF.
the infinite loop, acciedent that is a common error in alot of prototype programs.
Title: Re: Batch Programs Thread.
Post by: BatchRocks on February 16, 2009, 11:08:29 AM
i have to admit i have once made a virus(not really) it was that splitter bomb thing that ran it self over and over again making  a large amount of windows of it self, thus slowing down the system, but i am glad i dont know how to make a real virus.

Me too >.< It happened by me accidentally clicking on it because I made it look like a shortcut for Mozilla FF.
the infinite loop, acciedent that is a common error in alot of prototype programs.

Meh.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 16, 2009, 11:37:07 AM
an infinite loop is just a lack of foresight on the part of the programmer- check preconditions before defining loop exit conditions.

Now multiple threads, synchronization and Deadlocks, those are a tricky beast to tackle...

 it would be easier to simply duplicate a form and show it over and over. less code too.
Title: Re: Batch Programs Thread.
Post by: macdad- on February 16, 2009, 01:12:30 PM
it would be easier to simply duplicate a form and show it over and over. less code too.

as long as you have that loop controlled, or else it will do the windows splitter bomb thing(forgot what its called)
Title: Re: Batch Programs Thread.
Post by: patio on February 16, 2009, 01:23:09 PM
Well i made a Trojan once...and now i have 2 kids.
I also made a worm once...and never caught a fish....
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 16, 2009, 01:35:01 PM
I made a trojan once as well, I went in the backdoor, and hoped to heck I didn't hit a log....
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 16, 2009, 02:04:55 PM
Quote
I made a trojan once as well, I went in the backdoor, and hoped to heck I didn't hit a log....

Lets rephrase that

Quote
I made nothing  once as well, I went in the backdoor, and hoped to heck I didn't hit something....
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 16, 2009, 02:06:46 PM
Quote
I made a trojan once as well, I went in the backdoor, and hoped to heck I didn't hit a log....

Lets rephrase that

Quote
I made nothing  once as well, I went in the backdoor, and hoped to heck I didn't hit something....


hey, don't get *censored*. LOL
Title: Re: Batch Programs Thread.
Post by: macdad- on February 16, 2009, 02:07:13 PM
Quote
I made a trojan once as well, I went in the backdoor, and hoped to heck I didn't hit a log....

Lets rephrase that

Quote
I made nothing  once as well, I went in the backdoor, and hoped to heck I didn't hit something....

thanks for the translation  :D Jk
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 16, 2009, 02:08:21 PM
Sadly, I think BFC missed the secondary meaning in my post. He actually took it literally, which is actually kind of sad.
Title: Re: Batch Programs Thread.
Post by: macdad- on February 16, 2009, 02:12:12 PM
anywho back on topic....dont really have a latest Batch program i've made(been focused on my website)
Title: Re: Batch Programs Thread.
Post by: BatchRocks on February 19, 2009, 10:40:48 AM
No one has made one :o.
Title: Re: Batch Programs Thread.
Post by: macdad- on February 19, 2009, 11:59:36 AM
i think Dev has been working on that Batch chat thing...haven't seen him for a while
Title: Re: Batch Programs Thread.
Post by: BatchRocks on February 19, 2009, 12:06:00 PM
Oh.
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 21, 2009, 09:56:02 AM
There has been lots of chat batch files out there, the only difference is that none of them were 1st class good ones. The problem is, that you could only have 2 people on at one time.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 21, 2009, 10:04:30 AM
a chat program in batch is like writing a windows GUI application in assembly. Possible, but your fingers, head, and likely your but will hurt afterwards.
Title: Re: Batch Programs Thread.
Post by: macdad- on February 21, 2009, 10:11:05 AM
i dont have any batch progs...but i do have an idea on the next Batch Utility(like FINFO)

SNDCON: Sound Control

you simply type it in, in CMD or you batch prog with the Frequency of the note and duration and it plays the specified frequency for how long you specified. plus you can repeat it twice if you want by just adding a /R switch to it.

its fool proof!(i already have all the code frags and just need to put it together.)
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 21, 2009, 11:24:39 AM
I actually forgot. I have a program that creates a batch file registering system. It is quite simple, I think it would be a good combination if I combined that with a login system.
Title: Re: Batch Programs Thread.
Post by: devcom on February 21, 2009, 01:38:44 PM
i've today made this:  ;D
(http://img3.imageshack.us/img3/2580/orly.jpg)

and still cant pass one bug in TCP connection  ???
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 21, 2009, 02:39:01 PM
That's extremely impressive.
Title: Re: Batch Programs Thread.
Post by: macdad- on February 21, 2009, 02:47:33 PM
insane(in a good way)  ;D
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 21, 2009, 07:06:25 PM
isn't that just taking a text file generated via a picture to ASCII program and typing it?
Title: Re: Batch Programs Thread.
Post by: BatchRocks on February 21, 2009, 09:44:59 PM
I'm not being a jerk, but I can do that...I'm good at it.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on February 21, 2009, 09:47:18 PM
I'm not being a jerk, but I can do that...I'm good at it.

but can you do it faster then a program that analyzes the ratio between on and off pixels and then maps each of the 16,777,216 possible bitmap colours to a character that accurate represents the grayscale value of that pixel or group of pixels within an ASCII art image?
Title: Re: Batch Programs Thread.
Post by: devcom on February 22, 2009, 08:26:37 AM
yeah !  ;D I finally made this   ;D It must work right now (i shoot it will not work but whatever)  ;D

TcpServer.exe
Code: [Select]
TcpServer [/I IP] [/P PORT] [/F [FILENAME]] [/NO]

/P PORT  Port to connect (default 8000)
/I IP    Your local ip adress (default 127.0.0.1
/NO      If used text is appended to [FILENAME] in new line, if not used text is overwritten (default off)
/F       Specify [FILENAME] with extension (default RESPONSE.txt)

TcpClient.exe
Code: [Select]
TcpClient [/I IP] [/P PORT] [/T text]

/I   IP Your EXTERNAL IP
/P PORT  Port to connect
/T text  Text to send


If your TcpServer is receiving null lines you may need to turn off firewall or your PC is to slow (Yes, on my sister laptop i was trying to send text about 5 times in second witch was creating sometimes null lines, but when i was trying to send text 5 times per second to my computer i haven't any null line, need optimization  ;))


In attachment there is a preview chatlike program, TcpServer.exe , TcpClient.exe,  GETIP.exe and Choice.exe


Here is example connection for it:
Code: [Select]
                  Example connection over LAN

------------PC_1------------      ------------PC_2------------

Second PC ip:  192.168.0.196      Second PC ip:  192.168.0.189
Second PC port:  8001               Second PC port:  8000
Your ip:  192.168.0.189              Your ip:  192.168.0.196
Your port:  8000                       Your port:  8001

----------------------------      ----------------------------

I haven't tested this over Internet but over LAN delay is about 5-15 ms

PS.
VirusTotal scan for guys who think im posting viruses
Code: [Select]
http://www.virustotal.com/pl/analisis/97f0792685070586a48fcac0050a0106
[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on February 22, 2009, 01:06:07 PM
dev...you have truely out done yourself  8)
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on February 24, 2009, 03:18:50 PM
Awesomeness I tell you  :o. But, have you made a 100 KB program yet ?
Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 12:48:52 AM
Hi
You seem to know what you are doing.
I need to create a batch file that copy's a file into the start up folder.
So when windows starts the file runs
But needs to work on xp and vista
thanks
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on March 01, 2009, 01:11:24 AM
Wernerbreedt:
this isnt a help post, its where you post batch programs you've made if you want to share them.

And besides, what is the point?

Just copy the file you want started on startup to the startup folder manually.
Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 02:59:10 AM
soz
I need it  in a batch file(i need a file to be copied on multipal systems)
Title: Re: Batch Programs Thread.
Post by: Dias de verano on March 01, 2009, 03:11:50 AM
soz
I need it  in a batch file(i need a file to be copied on multipal systems)

That's what all the virus writers say.
Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 05:55:05 AM
if i was writing a virus do you think i would ask for advice ?
it's a program for a company that they want to start everytime.
Lots of pc's little time
Title: Re: Batch Programs Thread.
Post by: devcom on March 01, 2009, 05:59:09 AM
why not ?
Title: Re: Batch Programs Thread.
Post by: Dias de verano on March 01, 2009, 06:02:33 AM
if i was writing a virus do you think i would ask for advice ?

Yes. It happens here quite often. Usually schoolkids wanting to play pranks or spy on relatives or classmates, we think.

Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 06:09:11 AM
Wat would be the whole point in writing a virus,that you helped me with,that would mean it would easily be detected and removed
i work in an it shop,stil learning about IT and would like to make my job faster.
i understand your point in it might be for a virus  and thank you for at least replying
Title: Re: Batch Programs Thread.
Post by: Dias de verano on March 01, 2009, 06:15:57 AM
Not a virus maybe, but perhaps a batch file to get around a company's security policy and copy confidential data or do something else not intended.
Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 06:36:13 AM
if i wanted to do that i would rather just go the pc and manually copy the batch there.
Title: Re: Batch Programs Thread.
Post by: Dias de verano on March 01, 2009, 06:44:23 AM
if i wanted to do that i would rather just go the pc and manually copy the batch there.


Yes, but email is quicker.
Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 07:03:26 AM
emails is also traceable
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on March 01, 2009, 09:10:03 AM
emails is also traceable

So you don't want it to be tracable? How oddly contradictory to your stated intentions...
Title: Re: Batch Programs Thread.
Post by: Dias de verano on March 01, 2009, 09:16:04 AM
Quote from: BCP
How oddly contradictory to your stated intentions...

He's from South Africa, where, he says, because of the "way politics are", people get jobs they can't do...

Title: Re: Batch Programs Thread.
Post by: wernerbreedt on March 01, 2009, 10:16:56 AM
emails is also traceable

Thats the whole point why would i want to email them if i was writing a virus.
Title: Re: Batch Programs Thread.
Post by: macdad- on March 01, 2009, 03:33:45 PM
dont get any ideas on asking us on how to make one  >:(
Title: Re: Batch Programs Thread.
Post by: BatchFileCommand on March 01, 2009, 06:58:36 PM
Quote
Thats the whole point why would i want to email them if i was writing a virus.

That's like saying: Why would I want to kill the guy I want to kill if I was going to kill him?

You might want to take some grammar lessons.
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on March 01, 2009, 11:57:38 PM
In the time spent here, I'm sure you would have already finished doing what you wanted to do manually.
Title: Re: Batch Programs Thread.
Post by: devcom on March 29, 2009, 03:32:24 PM
i have nothing else to do so i created array creating script  ::)

Code: [Select]
@echo off
if '%1' equ '/?' goto HELP

if not '%1' equ '/2' (
set varName=%1
set varTo=%2
goto 1da
) else (
set varName=%2
set varTo1=%3
set varTo2=%4
goto 2da
)

:1da
for /L %%C in (0,1,%varTo%) do (
set %varName%[%%C]=test
)
goto END

:2da
for /L %%B in (0,1,%varTo1%) do (
for /L %%C in (0,1,%varTo2%) do (
set %varName%[%%B][%%C]=test
)
)
goto END

:HELP
echo.ARRAY [/2] ArrayName ArrayLength [ArrayHeight]
echo.
echo.EXAMPLE:
echo.
echo.array position 2
echo.Will create this variables:
echo.
echo.position[0]
echo.position[1]
echo.position[2]
echo.
echo.
echo.array /2 position 2 1
echo.Will create this variables:
echo.
echo.position[0][0] position[0][1]
echo.position[1][0] position[1][1]
echo.position[2][0] position[2][1]
echo.
pause
goto END

:END
Title: Re: Batch Programs Thread.
Post by: macdad- on March 29, 2009, 03:34:08 PM
Nice one dev
Title: Re: Batch Programs Thread.
Post by: Helpmeh on April 01, 2009, 05:30:43 PM
That's like saying: Why would I want to kill the guy I want to kill if I was going to kill him?

You might want to take some grammar lessons.

All werner needs is a punctuation lesson.

Quote
Thats the whole point. Why would i want to email them if I was writing a virus?

That works?
Title: Re: Batch Programs Thread.
Post by: Woogi on April 14, 2009, 01:06:39 PM
So I am looking for some help. I need to do an IF THEN in a batch file. I currently have the below script removing some printers and installing others. But I would like to add an IF THEN so that if the new printer is installed, the bat file ends.

Any ideas?

Quote
@echo off
REM Date: 01/29/2009
REM Created By: John Wilganowski
REM Comments:
REM
REM The Example removes
REM the Calpine machine that was
REM connected to hou-02svr and
REM connect the calpine on hou-17svr.
REM It uses the PRNMNGR.vbs that comes with windows
REM It will use the local copy of PRNMGR.vbs

REM EXAMPLE BELOW:

REM Cscript %windir%\system32\Prnmngr.vbs -d -p "\\hou-02svr\HOU-CalPine-PCL"
REM Cscript %windir%\system32\prnmngr.vbs -ac -p "\\hou-17svr\HOU-Calpine-PS"
REM exit




Cscript %windir%\system32\Prnmngr.vbs -d -p "\\hou-02svr\HOU-WhiteHouse-PCL"
Cscript %windir%\system32\Prnmngr.vbs -d -p "\\hou-02svr\HOU-WhiteHouse-PS"
Cscript %windir%\system32\prnmngr.vbs -ac -p "\\hou-02svr\HOU-Parthenon"
exit

Title: Re: Batch Programs Thread.
Post by: Dias de verano on April 14, 2009, 01:10:46 PM
So I am looking for some help.

Better if you start your own thread. This one is for stupid banter, you won't get the right help here.


Title: Re: Batch Programs Thread.
Post by: devcom on April 14, 2009, 02:55:40 PM
Better if you start your own thread. This one is for stupid banter, you won't get the right help here.

I see you hate us ;)
Title: Re: Batch Programs Thread.
Post by: patio on April 14, 2009, 04:56:33 PM
He hates no one...just gets impatient when people can't read 22 pages of info and help themselves...
Title: Re: Batch Programs Thread.
Post by: Helpmeh on April 18, 2009, 05:04:48 PM
He hates no one...just gets impatient when people can't read 22 pages of info and help themselves...
23 lol...
Title: Re: Batch Programs Thread.
Post by: devcom on April 26, 2009, 02:38:13 PM
Well, i've just created script to download all foto's from some user from http://photobucket.com/
But i dont know if someone need this so i will post it later  ;)
Title: Re: Batch Programs Thread.
Post by: Ädamas on April 28, 2009, 01:31:07 AM
to devcom
can it work for http://www.deviantart.com/
because one of my friend would like that one a lot
Title: Re: Batch Programs Thread.
Post by: devcom on April 28, 2009, 06:29:15 AM
well, I've used wget to get HTML code of page and then i filtered it to leave only links to photos and then used wget again...
but http://www.deviantart.com/ HTML code is in one line so its nearly impossible to do this in batch ;)
Title: Re: Batch Programs Thread.
Post by: Ädamas on April 30, 2009, 12:21:14 AM
here is a batch file to create a password protected folder
just replace all of the § with what ever name you chose
and the ¶ with your password (can only be one word so "pass word" wont work.)

p.s i did not make this batch file it was made by 101computergeek101 http://www.youtube.com/user/101computergeek101

Code: [Select]
cls
@ECHO OFF
title Folder §
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST § goto MDLOCKER
:CONFIRM
echo Are you sure u want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren § "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock folder
set /p "pass=>"
if NOT %pass%==¶ goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" §
echo Folder unlocked successfully
goto End
:FAIL
echo Invalid password
goto UNLOCK2
:FAIL2
echo Invalid password
goto end
:MDLOCKER
md §
echo Folder created successfully
goto End
:UNLOCK2
echo Last chance to enter correct password to unlock folder
set /p "pass=>"
if not %pass%==¶ goto FAIL2
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" §
echo Folder unlocked successfully
:End
Title: Re: Batch Programs Thread.
Post by: Xenfire on April 30, 2009, 10:49:35 PM
Works great.
I detect a new pron folder.
Title: Re: Batch Programs Thread.
Post by: Icecold on May 03, 2009, 01:04:20 AM
Yeah i'm trying to do the same thing...i mean i got it to work on my other computer the taskkill explorer thing but the cmd pops up for a sec and goes away...it only worked once...i want to know how to do this to do a prank on my friend at his house :D
i know a little about batch files like the basics and deleting stuff...but i cant really get down the taskkilll... please can anyone help? TY!
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on May 03, 2009, 01:19:19 AM
Yeah i'm trying to do the same thing...i mean i got it to work on my other computer the taskkill explorer thing but the cmd pops up for a sec and goes away...it only worked once...i want to know how to do this to do a prank on my friend at his house :D
i know a little about batch files like the basics and deleting stuff...but i cant really get down the taskkilll... please can anyone help? TY!

First, this is a thread for posting Batch programs.

Second, we will not help you create prank programs.
Title: Re: Batch Programs Thread.
Post by: macdad- on May 03, 2009, 11:40:07 AM
Sent a PM to me, asking for the same...

But he's another post and run.
Title: Re: Batch Programs Thread.
Post by: Tan_Za on May 04, 2009, 03:51:58 AM
Wow this has really moved ahead in so many ways.

Sad really, it is still amazing that you can do this stuff with batch. You can do it with any other programming language as well but I guess it is just extremely impressive to see something like this done in batch.

Devcom I am surprised that you haven't figured out how to use the mouse in batch. I made a nice little program that makes it so you can click 3 buttons and they just open different txt documents. Oh well, ill give you a hint, it is something to do with serial ports if you take apart a normal old mouse it will have a certain number and via using this number in a batch file with certain instructions it will allow the user to use the mouse. I don't know how to use a usb mouse because it is all so complicated. I have an old laptop so I can experiment on that. Dev since you know how to use choice properly this should be a piece of cake for you, as long as you use the windows 98 version. Mainly because it is easier to use, and I hate anything to do with vista.

Have a shot I know you will get it,
Tan_Za

PS: I will not post my program because of reasons that can't be put into the general public.
Title: Re: Batch Programs Thread.
Post by: macdad- on May 04, 2009, 06:48:51 AM
Hey Tan_Za,

Haven't seen ya for a while, but welcome back!
Title: Re: Batch Programs Thread.
Post by: Tan_Za on May 05, 2009, 01:51:40 AM
Ya you guys have progressed with over 20 pages of random talk about batch and posting batch programs, very nice. So how have you all been anyways, I have just completed a few projects of my own using other programming languages, that is kinda why I haven't been here. Just in case I got distracted.

Tan_Za
Title: Re: Batch Programs Thread.
Post by: macdad- on May 05, 2009, 06:14:04 AM
We've been doing fine, still working on my third version of SysStat.  ;D
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on May 05, 2009, 10:36:23 AM
BCScript, BASeParser, BCFile, and BASeMetry projects here  ;D
Title: Re: Batch Programs Thread.
Post by: macdad- on May 05, 2009, 12:05:48 PM
Except retarded Virut hit me and BC  :P
Title: Re: Batch Programs Thread.
Post by: gamerx365 on May 08, 2009, 08:21:27 AM
I started work on EDS:The Chronicles of Adult Content. It will never be released unfortunatley. XD
Title: Re: Batch Programs Thread.
Post by: macdad- on May 08, 2009, 11:12:58 AM
ESRB Rating: A  ;)
Title: Re: Batch Programs Thread.
Post by: Ädamas on May 10, 2009, 05:30:58 AM
i have made a menu opens a web browser and it then asks for a web site or if you want a blank page (it also has a self edit option, but it does not work all the time)
Code: [Select]
@echo off
:run
cls
echo type command
echo edit
echo chrome
echo end

set/p "cho=>"
if %cho%==edit start notepad program_menu.bat
if %cho%==chrome goto chrome
if %cho%==end goto end
goto run

:chrome
echo type website or blank
set /p "cho3=>"
if %cho3%==blank goto just run chrome
cd "C:\Documents and Settings\%userprofile%\Local Settings\Application Data\Google\Chrome\Application"
start chrome.exe www.%cho3%
goto run

:just run chrome
cd "C:\Documents and Settings\%userprofile%\Local Settings\Application Data\Google\Chrome\Application"
start chrome.exe
goto run

:end



i could make it do a sort of goolge sarch thing more on that later (i need to go now)
Title: Re: Batch Programs Thread.
Post by: devcom on May 10, 2009, 11:50:32 AM
my old project, 'Searcher'

Code: [Select]
@echo off

setlocal enabledelayedexpansion

set Sch_choice=,Google,Youtube,Yahoo,
set Sch=Google
set save_history=1

:LOOP
echo.
echo.= Menu =================================================
echo.
for /f "tokens=1,2,* delims=_ " %%A in ('"findstr /b /c:":menu_" "%~f0""') do echo.  %%B  %%C
echo.
echo.========================================================
choice /C:123 >nul
set choice=%errorlevel%
call :menu_%choice%
goto LOOP

:menu_1   Search Type: '!Sch!' [!Sch_choice:~1,-1!]
call :NIL Sch "!Sch_choice!"
cls
exit /b

:menu_2   Search
call :Search "!Sch!"
cls
exit /b

:menu_3   History
call :History
cls
exit /b

:NIL

set lst=%~2
set dlm=%lst:~-1%
set old=!%~1!
set fst=
for /f "delims=%dlm%" %%a in ("%lst%") do set fst=%%a
set lll=!lst:%dlm%%old%%dlm%=%dlm%@%dlm%!%fst%%dlm%
for /f "tokens=2 delims=@" %%a in ("%lll%") do set lll=%%a

for /f "delims=%dlm%" %%a in ("%lll%") do set new=%%a

SET %~1=%new%

exit /b


REM --------------------------------------------------------------

:Search
echo.
echo.
set type=%~1
if '%type%' equ '' EXIT /b
choice /C:YN /M "Search %type% ??"
echo.
if not %errorlevel% equ 1 EXIT /b
set /p Schtxt=Search:

call set Schtxt=%%Schtxt: =+%%
call :Config

call start %%%type%%%

if %save_history% equ 1 echo.%date% %time% %type% %Schtxt% >>SearchHistory.log
exit /b

:Config
set Google=http://www.google.com/search?q=%Schtxt%
set Youtube=http://www.youtube.com/results?search_query=%Schtxt%
set Yahoo=http://search.yahoo.com/search?p=%Schtxt%
exit /b

REM --------------------------------------------------------------

:History
cls
echo.HISTORY:
echo.
type SearchHistory.log
echo.
echo.
pause
exit /b

you can add your sites if you know how to ;)

PS. you need Vista choice...
Title: Re: Batch Programs Thread.
Post by: macdad- on May 10, 2009, 03:00:18 PM
Nice one Dev!

Very well developed.  8)
Title: Re: Batch Programs Thread.
Post by: Helpmeh on May 10, 2009, 03:25:40 PM
i have made a menu opens a web browser and it then asks for a web site or if you want a blank page (it also has a self edit option, but it does not work all the time)
Code: [Select]
@echo off
:run
cls
echo type command
echo edit
echo chrome
echo end

set/p "cho=>"
if %cho%==edit start notepad program_menu.bat
if %cho%==chrome goto chrome
if %cho%==end goto end
goto run

:chrome
echo type website or blank
set/p "cho3=>"
if %cho3%==blank goto just run chrome
cd C:\Documents and Settings\jason\Local Settings\Application Data\Google\Chrome\Application
start chrome.exe www.%cho3%
goto run

:just run chrome
cd C:\Documents and Settings\jason\Local Settings\Application Data\Google\Chrome\Application
start chrome.exe
goto run

:end



i could make it do a sort of goolge sarch thing more on that later (i need to go now)
Won't work unless you replace C:\Documents and Settings\jason with %userprofile%, and you wrap it in quotes...you'll get an error otherwise.
Title: Re: Batch Programs Thread.
Post by: Ädamas on May 11, 2009, 01:46:08 AM
you mean it wont work on your computer cause it works on mine
Title: Re: Batch Programs Thread.
Post by: macdad- on May 11, 2009, 05:56:36 AM
A space is needed between the Set and /P  ;)
Title: Re: Batch Programs Thread.
Post by: devcom on May 19, 2009, 07:49:41 AM
it makes list of specified folders and then you can use this to jump there fast everywhere on your disks like games movies etc.

Code: [Select]
@echo off
mode 50,100
setlocal enabledelayedexpansion

REM <!-- SETUP

set selIco=[%%]
set unselIco= %%
set yourDir="E:\MEDIA\" "F:\MEDIA\"

REM PUT "" ON ALL DIRS & PUT \ AT THE END

REM -->

set num=1
for /f "tokens=*" %%a in ('dir /b %yourDir%') do (
set Ico!num!=%unselIco%
set word!num!=%%a
set /a num+=1
)

set /a maxnum=%num%-1
set Ico1=%selIco%
set num=1
set selNum=1

:ECHO
cls
set num=1
echo.#############################
echo.
for %%a in (%yourDir%) do (
echo.------------------------- %%a
for /f %%b in ('dir /b %%a') do (
call set tmpw=%%Ico!num!%%%%word!num!%%%
echo !tmpw!
set /a num+=1
)
echo.
)
call echo.Selected: %selNum% %%word%selNum%%%
echo.#############################
choice.exe /C wsd >nul

if %errorlevel% equ 1 goto UP
if %errorlevel% equ 2 goto DN
if %errorlevel% equ 3 goto START
goto ECHO

:UP
set Ico%selNum%=%unselIco%
set /a selNum-=1
if %selNum% lss 1 set selNum=%maxnum%
set Ico%selNum%=%selIco%
goto ECHO


:DN
set Ico%selNum%=%unselIco%
set /a selNum+=1
if %selNum% gtr %maxnum% set selNum=1
set Ico%selNum%=%selIco%
goto ECHO

:START
call set tmpa=%%word%selNum%%%
for %%a in (%yourDir%) do (
set tmpb=%%~a
if exist "!tmpb!\%tmpa%" set openDir=!tmpb!
)

start explorer "%openDir%%tmpa%"
exit

PS well i dont speek english so good to tell you this script do but try it ;)

EDIT: ofc you need choice.exe
Title: Re: Batch Programs Thread.
Post by: Helpmeh on May 19, 2009, 07:30:36 PM
you mean it wont work on your computer cause it works on mine
But because you posted it here, it is meant to be used by others. Userprofile is the variable for C:\Documents and Settings\USERNAME , and changes for each computer allowing any computer which runs it to use it.
Title: Re: Batch Programs Thread.
Post by: macdad- on May 21, 2009, 06:16:57 AM
Finished SysStat v3.

With new features:
-Format Floppies
-Check Processor Type, ID, etc.
-Operation History(This show what features you have used in the past)
-Error Notification

There is also a Temp folder created at first run to store the operation log.

Enjoy

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Reno on May 22, 2009, 06:57:12 AM
A space is needed between the Set and /P  ;)

wrong, the following will work
set/p var=enter value:
no space needed between set and /p

quotes for pathname containing space is needed for copy, move, ren, dir, del, etc..etc..
quotes for pathname containing space is optional for cd
Title: Re: Batch Programs Thread.
Post by: Helpmeh on June 02, 2009, 04:30:20 PM
ESRB Rating: A  ;)
AO...Adult Only.
Title: Re: Batch Programs Thread.
Post by: devcom on June 03, 2009, 01:50:18 PM
i've just finished audio player ;D it plays only .mp3 files, you can create your playlist and it will auto play them ;)

this is how it looks:

Code: [Select]
================================================================
LIST:
28 - ZZ Top - La Grange.mp3
34 - Tenacious D - The Metal.mp3
37 - Slipknot - Before I Forget.mp3
52 - Dragonforce - Through The Fire And The Flames.mp3
================================================================
Now playing:

Artist  :       Dragonforce
Title   :       Through the Fire and Flames
Genre   :

428s. <> [##                                                  ]
================================================================
O - open new file
P - stop played file & pause
C - clear temp
D - next file

tell me an errors... ;)


EDIT:

you can find it here :http://www.computerhope.com/forum/index.php/topic,59426.msg565578.html#msg565578 (http://www.computerhope.com/forum/index.php/topic,59426.msg565578.html#msg565578)
Title: Re: Batch Programs Thread.
Post by: macdad- on June 03, 2009, 06:58:05 PM
Seems to be missing Playlist.lst
Title: Re: Batch Programs Thread.
Post by: devcom on June 04, 2009, 03:53:08 AM
you can create it when you select .mp3 file to play
Title: Re: Batch Programs Thread.
Post by: macdad- on June 04, 2009, 01:34:37 PM
Oh wait I see the problem, Dev,

For the parts of the code with variable CurDir, make sure you surround it in quotes, and also Choice seems to be corrupt.
Title: Re: Batch Programs Thread.
Post by: devcom on June 04, 2009, 03:29:43 PM
ok here is player again with working choice.exe but i dont know how to call it when dir have space in in... ???

so this will not work:

Code: [Select]
"%curDir%\DATA\choice.exe" /C asdf

you can put it to C:\PLAYER for example and it will work ;)




@mac
i see that vista choice.exe work only on vista  ::)

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on June 04, 2009, 05:17:12 PM
Thanks for the fix  ;)
Title: Re: Batch Programs Thread.
Post by: devcom on June 16, 2009, 11:19:35 AM
Another "game", MasterMind: About (http://en.wikipedia.org/wiki/Mastermind_(board_game))

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on June 16, 2009, 04:39:02 PM
Pretty good game, dev  8)
Title: Re: Batch Programs Thread.
Post by: mattf2171 on June 17, 2009, 10:46:24 AM
Im sorry...totally new to the forum.

What i am in need of is a batch file that looks at the date stamps of a particular file.

We are supposed to get new files from a vendor daily, and I want to use my monitoring program to run the batch file to determine if we have recieved a new file in the last 2 days.

Im totally not a programmer!! HA..

Thanks in advance.

Title: Re: Batch Programs Thread.
Post by: macdad- on June 17, 2009, 10:48:21 AM
Please Post a seperate thread outside of this one:

this isnt a help post, its where you post batch programs you've made if you want to share them.
Title: Re: Batch Programs Thread.
Post by: devcom on June 19, 2009, 12:32:09 PM
here is my today project still alpha ;)

its what TanZa said about mouse in cmd, so i crated small app in VB.net to get mouse pos.

Basically its menu where you use your mouse, its a little bit tricky and buggy right now but i want to share this with you ;)


EDIT:

here it is again but its not menu its just shows where your cursor is or where you click, im goint to make game with that ;)
fixed some bugs

[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on June 24, 2009, 07:27:36 AM
BATCH EDITOR



UPDATE

I added the /I switch to all if commands that involve the input of letters

WHY I MADE THE BATCH EDITOR

I made the batch editor first for me, so I could make batch files really easy
but I decided that I would put It on the internet, after some kind people helped me out on a problem with the batch editor.


ABOUT THE BATCH EDITOR,

The batch editor is a program that lets you use shortcut words to make batch files.
This is the first version, and I will be working on updates.

(If you have any comments, questions or suggestions please feel free to post them.)

THE DOWNLOAD

The download size is 7.6KB
 


 


[attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: macdad- on June 24, 2009, 10:27:00 AM
batchmaster,

Very good program, and I have some tips for you:

On the lines with Yes/No/Menu

You can add the /I switch to the If statement to tell if to be Case-Insensitive.
That way you can avoid any Errors with choice selection.

,Nick(macdad-)
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on June 25, 2009, 04:32:07 PM
Thank you I will definitely make an update. ;D

Is there a way to make it so you can backspace In my program?

and is there also a way to like say move to the middle of the command line and add commands there?
Title: Re: Batch Programs Thread.
Post by: macdad- on June 26, 2009, 03:31:47 PM
Why dont you use Notepad?
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on June 26, 2009, 08:10:06 PM
I do
Title: Re: Batch Programs Thread.
Post by: macdad- on June 27, 2009, 09:52:57 AM
And yes you can backspace and move around with the arrow keys if you use the Set /P command
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on June 27, 2009, 12:45:03 PM
But you cant use set /p with the type command.
Title: Re: Batch Programs Thread.
Post by: macdad- on June 27, 2009, 03:07:39 PM
Oh, that's what you're doing.

If you mean by editing the file with the Type command, then no that doesn't work
Type only displays file content.
Title: Re: Batch Programs Thread.
Post by: devcom on July 25, 2009, 06:50:16 AM
Quote
this isn't a help post, its where you post batch programs you've made if you want to share them.

please make another thread
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on July 25, 2009, 06:50:52 AM
Start a new topic. This is for posting batch files, not to ask questions.
Title: Re: Batch Programs Thread.
Post by: smeezekitty on August 25, 2009, 07:38:59 PM
i wrote this batch file
its alittle buggie but its fairly neat
it helps you find files
here it is:
Code: [Select]
:BEGIN
echo off
cls
set /P direct="What drive and directory would you like to explorer?[DRIVE:\DIR] "
cd /D %direct%>nul
if %errorlevel% equ 1 echo Drive or directory doesnt exist & exit
:START
cls
echo type CHGD to goto a diffrent drive and/or directory
set /P FM="type in the first letter of the filename, ^ to quit "
if %FM% equ ^ goto END
if %FM% equ CHGD goto RAW
:FNF
cls
dir /B %FM%???????.* | more
echo Type filename as seen above or 'BACKSTART' to choose another letter
set /P FM="type ^ to quit "
if %FM% equ BACKSTART goto START
if %FM% equ ^ goto END
if not exist %FM% echo FILE NOT FOUND & PAUSE & goto BEGIN
%FM%
goto START
:RAW
goto BEGIN
:END
Title: Re: Batch Programs Thread.
Post by: macdad- on August 27, 2009, 04:42:20 PM
Very nice, a multi-drive file searcher.
Title: Re: Batch Programs Thread.
Post by: Undernerd on November 30, 2009, 05:56:19 PM
well i think you dont have choice.exe becouse it use it to move smother than typeing single letter and press enter.
here is a link to choice.exe
http://hp.vector.co.jp/authors/VA007219/dkclonesup/choice.html
simply put it to C:\windows\system32

Thanks Devcom,
I've been pulling my hair out trying to make a batch file using CHOICE and have been rather upset that XP isn't running it.
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 05, 2009, 09:08:33 PM
I hope no one minds I posted this in another thread but it seems fitting to put the link to said thread here...

Eternal Death Slayer 2! (beta)

http://www.computerhope.com/forum/index.php/topic,66827.msg651063.html#msg651063

If the double post is a problem contact me and I will delete it. I figured maybe some users here don't peruse the off topic boards and this topic really fits this thread.

Thanx.
-Seth
Title: Re: Batch Programs Thread.
Post by: macdad- on December 06, 2009, 03:08:29 PM
Long time no see Gamer.

Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 06, 2009, 05:51:13 PM
I know. it's been a while since I've deemed myself worthy to post on computerhope :D
Title: Re: Batch Programs Thread.
Post by: Ujujboypiano on December 11, 2009, 02:03:15 PM
I have made a java compiling program. I don't know why you would need it- just saying. If you press y, it will tell the program "Yes, I have typed a file to compile as an argument.". If you press n, it will do the opposite. Although, you have to download Java for it to work. You should find "javac" in the bin folder. Also, just make the "cd" statement at the end the address of your Java file. I am NOT very experienced with MS-DOS, so I don't think this will help much.

@echo off
:start
set choice=
set /p choice="Have you typed a filename? Press y for yes, n for no. (then press enter)"
if '%choice%' == 'y' ..\bin\javac %1
if '%choice%' == 'n' cls
cd C:\Program Files\Java\jdk1.6.0_16\test
Title: Re: Batch Programs Thread.
Post by: aiko on December 18, 2009, 12:31:49 PM
bleep.bat
Code: [Select]
@echo off
cls
:bleep
title bleep
start bleep.vbs
goto bleep

bleep.vbs
Code: [Select]
Set oWS +
Wscript.CreateObject("WScript.shell")
oWS.Run "%compec% /c echo "  & Chr(07), 0,True
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 18, 2009, 03:29:13 PM
beep.bat

Code: [Select]
@echo ^G

^G= control G.
Title: Re: Batch Programs Thread.
Post by: macdad- on December 19, 2009, 07:02:46 AM
How did you add that in, seems to be that you can only add ^G in EDIT or if you append it to the file from CMD itself(It doesn't add it in Notepad though, and all other GUIs due to the fact of keyboard shortcuts)
Title: Re: Batch Programs Thread.
Post by: Ujujboypiano on December 22, 2009, 02:11:47 PM
Code: [Select]
PRESS CTRL+F  AND THEN CTRL+M! THEN, TRY CTRL+B AND CTRL+M!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 22, 2009, 05:41:26 PM
How did you add that in, seems to be that you can only add ^G in EDIT or if you append it to the file from CMD itself(It doesn't add it in Notepad though, and all other GUIs due to the fact of keyboard shortcuts)

you can still edit it in notepad- just edit up to the point where Control-G is required, and then append it using echo:

Code: [Select]
echo ^G >> mybatch.bat
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 23, 2010, 11:03:04 PM
i am creating a batch program that takes the current user's password and allows you to modify it as long as you have admin privileges. what i want to know is that i am trying to make the program have a random option and want it to obtain a random numerical value then recall and input that value in another part of the program. any suggestions? here's the program without the random option.

<code removed>
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on January 23, 2010, 11:39:37 PM
Sorry bud, but we don't do that kinda stuff here.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 24, 2010, 07:00:48 AM
weird, I don't remember putting a classified add up; "wanted: one douchebag"
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 24, 2010, 12:48:33 PM
weird, I don't remember putting a classified add up; "wanted: one douchebag"


that would be in regards to my post? I was not intending to use the batch maliciously it's for my class. I go to a career center called Mid-East for Computer Support Technology. If I were able to pull this off i can acquire some extra credit. I just figured this being a batch programs thread i could get some much need advice. Sorry for any inconvenience I may have caused.
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 24, 2010, 01:55:46 PM
Never mind, I figured out how to do it. Although, in the future, if I need any help on other subjects I will return. Until then tschüs!

Sie werden sich hinsetzen. Sie werden ruhig sein. Sie werden Deutschland nicht beleidigen!

I'm not from Germany but i have at least 50% German in my blood.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 24, 2010, 02:45:38 PM
great. Totally not looking forward to it.
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 24, 2010, 05:18:21 PM
Have I done something to deserve your incessant hostility?
Title: Re: Batch Programs Thread.
Post by: Helpmeh on January 24, 2010, 08:07:44 PM
Have I done something to deserve your incessant hostility?
He might be in one of his "moods". My advice: stay quite until a mod can clean up anything truly offencive.
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 24, 2010, 09:17:01 PM
thank you for your hospitality. i was about to quit using this forum as the first few posts i made got some unintended replies to say the least. i thought that if this is how people are going to greet me then this is not a truly helpful place. however, i will return for future advice. thank you and it's nice to see that there are people who want to help other people. i will do the same if the situation arises. if the world were filled with more people thinking that way everything would change. ;D
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 24, 2010, 09:44:13 PM
however, i will return for future advice.

Just so long as it's not related to passwords; or more precisely, changing them.

Anyway, regarding the previous:

A:) this is an old topic that has very little in common with your request

and B:, the big one: almost every single person that registered with a nick that contains "hacker" has been a specific troll that is consistently banned. (RalphSpencer). And either complaining about chat or trying to get hacking help. Although I suppose I should have realized that you weren't him since you're able to spell properly, so sorry for the mix-up.
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on January 24, 2010, 10:33:55 PM
Well put, BC. ;)
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 25, 2010, 05:21:17 AM
i will keep that in mind. thank you BC for realizing who I'm not, if that makes sense. I'm sorry if I caused a mix-up, no big deal. I promise I will not ask for anymore help on the subject. And, yes, I spell correctly because it irritates me to no extent when people start using bad grammar and think they can get hardcore with their keyboard. thank you for the advice, no hacking tips. I am not one of those people who do things just for the *censored* of it. i try to help people. i don't hack per se, i simply come up with solutions to common problems. I assure you, I am not malicious, I have had it happen to me too many times before to unleash something like that on an innocent person. Add me to your buddy list if you please and you will find I'm a very nice person.

P.S. I was able to do the task i wanted using variables. Don't know why I didn't think of that in the first place. :P
set var=%random%
then later,   %var%. I guess I got my extra credit. I should explain. My teacher, for that CST class i mentioned earlier was trying to find a simple way to change the password for the students because some people lose them, we need to move to a new computer, etc. He wanted to do it from one computer and not 25.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on January 25, 2010, 07:07:51 AM
My teacher, for that CST class i mentioned earlier was trying to find a simple way to change the password for the students because some people lose them, we need to move to a new computer, etc. He wanted to do it from one computer and not 25.

They should be using domains! much easier to manage roaming profiles and users :)
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 25, 2010, 08:20:22 PM
yea i thought of that originally but he said that the software for the " module " program isn't on our domain. Besides, our network admin, Gary, is an idiot anyway. :D
Title: Re: Batch Programs Thread.
Post by: gamerx365 on January 26, 2010, 09:24:13 PM
I like how your name says hacker yet you don't hack. lol. Maybe the 420's a lie too.

Anyway...
Welcome to the most awesome computer forums anywhere. If you're truly interested in batch programs, I would recommend checking out our batch games. I'm not sure but I think mine was the first batch RPG on the site and I started to notice a few other users posting their own. I left for a while and came back with a sequel beta for mine and no one to test it. But yeah have a look at some of the games, they have inspiring and pretty cool code. Look for Realms of *censored* on here somwhere, it's pretty cool. And you can find mine at http://gamerx365.webs.com. It would be amazing if you, or anyone would beta test that bad boy, but it's cool if you don't want to. I just thought I'd share the info I have on batch games.
Title: Re: Batch Programs Thread.
Post by: HellaciousHacker_420 on January 27, 2010, 04:38:51 PM
ehh, what's in a name? Oh, and trust me the 420 is not a lie lol.
Title: Re: Batch Programs Thread.
Post by: danyelle on February 19, 2010, 11:51:17 AM
Does anyone here have experience with modifying text files via batch?  I would like to create a .BAT that can be executed via Shell Wait in MS Access 2003.  The text file needs to be modified/overwritten to remove lines of text that presently represent headers/footers causing problems with MS Access import specifications.  The file originates as a UNIX print spooler file that I have retrieved via ftp and saved to the Windows box as an ASCII .txt file.

Please respond with "dummy" instructions.  My DOS is very old rusty knowledge and will require some hand holding to implement.
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on February 19, 2010, 08:04:22 PM
Yes, you can do that. The FOR command in DOS is very powerful and and manipulate items in a text file.
First, you indicate these files are from a UNIX system. We need to know if the file format will be compatible with DOS. UNIX does not have line feed. DOS does.
Next we need to know if the headers you want to modify are only at the start of each file, or do they show up  again.
And maybe you could show us a small text file of about five to ten lines and indicate what material would be removed. We need to find a 'delimiter' to identify the part you want to change.
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on February 19, 2010, 08:23:11 PM
Have a question? Need some help?
Start a new topic.

http://www.computerhope.com/forum/index.php?action=post;board=2.0
Title: Re: Batch Programs Thread.
Post by: danyelle on February 20, 2010, 12:29:32 PM
Yes, you can do that. The FOR command in DOS is very powerful and and manipulate items in a text file.
First, you indicate these files are from a UNIX system. We need to know if the file format will be compatible with DOS. UNIX does not have line feed. DOS does.
Next we need to know if the headers you want to modify are only at the start of each file, or do they show up  again.
And maybe you could show us a small text file of about five to ten lines and indicate what material would be removed. We need to find a 'delimiter' to identify the part you want to change.

The files although they originally reside on a UNIX box, for my purposes their original form I don't believe will be a problem.  I have already devised a means to retrieve the print spooler representative of the input file that needs converting and through windows ftp command language it has been transfered and saved via ASCII ftp command.  I'm not certain if pasting the output here would preserve the file character formats but if you wish to I could attach and send via email.  Yes the headers are at the begining of the file, They appear within the first 6 lines of the output and the footer is always the last 2 lines of the file that I need to remove.

I have pasted below what I can, however I do think email might prove to be a more efficient means if you desire.



06:51:58am  19 Feb 2010                              Master Claims Aging Report (By Queue)                              Page    1
                                                           SUMMARY Claims
                                     Last Build Performed on: 02-19-2010 at 06:43am by kgorsuch

Queue.........................         -99/-9       -8/-7       -6/-5       -4/-3       -2/-1         0/0      1-Over    Total

Totals for Area 54                     0   0%      0   0%      0   0%      0   0%      0   0%      0   0%      0   0%        0


138 records listed.

I should note the # of records listed in the statement above isn't always the same and there are other files similar to this that I'll need to repeat this process for...not all of which are seperated as the "Queue" line appears above.  That is to say, there may be no delimeter within the line that is of use but rather just searching for the special character that sepeartes the lines may be more beneficial of a delimeter to focus our attentions on.

Thanks in adavance for your assistance.
Title: Batch Programs Thread.
Post by: alienware on February 26, 2010, 08:58:35 AM
hi...
....i have a problem....i edited that below..it's from computerhope.com .....i edited it to copy some files to and from my PC...the problem is that it doesn't copy the file on that adress..:
XCOPY I:\Stick\Short\*.* C:\Documents and Settings\All Users\Start Menu\Programs\Startup\ /S/Y
and on the screan apears "Invalid number of parameters".....
...why is that...i dont know to much on this...please someone help me !!!!!! :)

Code: [Select]
ECHO OFF
CLS
:MENU
ECHO.
ECHO .............................................................
ECHO PRESS 1 or 2 to select your task, or 3 to EXIT
ECHO .............................................................
ECHO.
ECHO 1 - Import Files from PERSONAL DRIVE (H:) to COMPUTER
ECHO 2 - Export Files from COMPUTER to PERSONAL DRIVE (H:)
ECHO 3 - EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO IMPORT
IF %M%==2 GOTO EXPORT
IF %M%==3 GOTO EOF
:IMPORT
XCOPY I:\Stick\Iass\*.* C:\WINDOWS\Iass\ /S/Y
XCOPY I:\Stick\Short\*.* C:\Documents and Settings\All Users\Start Menu\Programs\Startup\ /S/Y
GOTO MENU
:EXPORT
XCOPY C:\WINDOWS\Iass\notepad.txt I:\Favorites\ /S/Y
GOTO MENU
Title: Re: Batch Programs Thread.
Post by: Carbon Dudeoxide on February 26, 2010, 10:17:55 AM
Have a question? Need some help?
Start a new topic.

http://www.computerhope.com/forum/index.php?action=post;board=2.0
Title: Re: Batch Programs Thread.
Post by: alienware on February 26, 2010, 01:00:14 PM
hi...
....i have a problem....i edited that below..it's from computerhope.com .....i edited it to copy some files to and from my PC...the problem is that it doesn't copy the file on that adress..:
XCOPY I:\Stick\Short\*.* C:\Documents and Settings\All Users\Start Menu\Programs\Startup\ /S/Y
and on the screan apears "Invalid number of parameters".....
...why is that...i dont know to much on this...please someone help me !!!!!! :)

Code: [Select]
ECHO OFF
CLS
:MENU
ECHO.
ECHO .............................................................
ECHO PRESS 1 or 2 to select your task, or 3 to EXIT
ECHO .............................................................
ECHO.
ECHO 1 - Import Files from PERSONAL DRIVE (H:) to COMPUTER
ECHO 2 - Export Files from COMPUTER to PERSONAL DRIVE (H:)
ECHO 3 - EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO IMPORT
IF %M%==2 GOTO EXPORT
IF %M%==3 GOTO EOF
:IMPORT
XCOPY I:\Stick\Iass\*.* C:\WINDOWS\Iass\ /S/Y
XCOPY I:\Stick\Short\*.* C:\Documents and Settings\All Users\Start Menu\Programs\Startup\ /S/Y
GOTO MENU
:EXPORT
XCOPY C:\WINDOWS\Iass\notepad.txt I:\Favorites\ /S/Y
GOTO MENU


i solve it...thanks Computerhope.com
http://www.computerhope.com/forum/index.php/topic,100845.0.html (http://www.computerhope.com/forum/index.php/topic,100845.0.html)
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on March 05, 2010, 08:44:58 AM
Here it is ....... B_OS (Batch Operating System). It is a work in progress so if you find any glitches or want to make any suggestions please Private Message me.

Thank you for trying my program,

batchmaster60



The download is right here
vvvvvvvvvvvvvvvvvvvvvvvv

[Saving space, attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: Helpmeh on March 05, 2010, 04:12:28 PM
Is there any way to prevent it from BEEPING if I press the wrong key? Also, every time it "boots", it asks if I want to overwrite computer_name.txt
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on March 05, 2010, 05:42:42 PM
The beeping that happens when you press the wrong key is caused by choice.exe which I cannot change unless I got the source to choice.exe.

I will fix the computer_name.txt overwrite thing at once.

I will post the new version in a little bit....... sit tight...... lol
Title: Re: Batch Programs Thread.
Post by: batchmaster60 on March 05, 2010, 05:55:43 PM
OK I here is the fixed B_OS.

The only thing that stays the same is the beeping when you press the wrong key.

If any one could give me any open source alternative to choice.exe please Private Message me.



Here is the download.
vvvvvvvvvvvvvvvvvv

[Saving space, attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: ghostdog74 on March 21, 2010, 08:18:11 PM
Yes, you can do that. The FOR command in DOS is very powerful and and manipulate items in a text file.
if you are saying this, you have not seen awk/sed/Perl/Python yet. for manipulating files with certain complexity, DOS batch is the LAST choice.
Title: Re: Batch Programs Thread.
Post by: ghostdog74 on March 21, 2010, 08:20:08 PM
The files although they originally reside on a UNIX box, for my purposes their original form I don't believe will be a problem.  I have already devised a means to retrieve the print spooler representative of the input file that needs converting and through windows ftp command language it has been transfered and saved via ASCII ftp command.  I'm not certain if pasting the output here would preserve the file character formats but if you wish to I could attach and send via email.  Yes the headers are at the begining of the file, They appear within the first 6 lines of the output and the footer is always the last 2 lines of the file that I need to remove.

I have pasted below what I can, however I do think email might prove to be a more efficient means if you desire.



06:51:58am  19 Feb 2010                              Master Claims Aging Report (By Queue)                              Page    1
                                                           SUMMARY Claims
                                     Last Build Performed on: 02-19-2010 at 06:43am by kgorsuch

Queue.........................         -99/-9       -8/-7       -6/-5       -4/-3       -2/-1         0/0      1-Over    Total

Totals for Area 54                     0   0%      0   0%      0   0%      0   0%      0   0%      0   0%      0   0%        0


138 records listed.

I should note the # of records listed in the statement above isn't always the same and there are other files similar to this that I'll need to repeat this process for...not all of which are seperated as the "Queue" line appears above.  That is to say, there may be no delimeter within the line that is of use but rather just searching for the special character that sepeartes the lines may be more beneficial of a delimeter to focus our attentions on.

Thanks in adavance for your assistance.

did you solve this yet?
Title: Re: Batch Programs Thread.
Post by: mat123 on April 01, 2010, 09:19:21 PM
here is one random wallpaper on restart
Code: [Select]
@echo off
:1
if exist 1.jpg goto 2
set fix=1
goto ren

:2
if exist 2.jpg goto 3
set fix=2
goto ren


:3
if exist 3.jpg goto 4
set fix=3
goto ren


:4
if exist 4.jpg goto 5
set fix=4
goto ren


:5
if exist 5.jpg goto 6
set fix=5
goto ren

:6
if exist 6.jpg goto 7
set fix=6
goto ren

:7
if exist 7.jpg goto 8
set fix=7
goto ren

:8
if exist 8.jpg goto 9
set fix=8
goto ren

:9
if exist 9.jpg goto postpare
set fix=9
goto ren

:postpare

del random.jpg
goto change

:ren
ren random.jpg %fix%.jpg
goto change

:change
Set /a c=(%Random% %%9)+1
ren %c%.jpg random.jpg
;D
Title: Re: Batch Programs Thread.
Post by: Frozen2Dream on April 04, 2010, 03:40:53 AM
Here is a "Computer Won't Start Without Password" batch.  Just for fun and laughs.
This contains two different batches.



Batch1.
Code: [Select]
@Echo Off
Start Batch2.bat /MIN >nul
Title Welcome.
Echo Welcome, please enter your password to continue.
Set /P PW=
if "%PW%"=="Password" goto CLR

CLS
Echo Password is wrong.  You have one more try.
Set /P PW=
if "%PW%"=="Password" goto CLR

CLS
Echo Wrong password again, shutting down.
Shutdown


:CLR
CLS
taskkill /fi "WINDOWTITLE eq TK" >nul
Echo Welcome back (put name here)
pause
exit



Batch2.
Code: [Select]
@Echo Off
Title TK
:Kill
Echo Task Killer Active. . .
Taskkill /F /IM taskmgr.exe
Taskkill /F /IM explorer.exe
Goto Kill

The task killer thing is simple. And of course someone can just easily close it. (Alt+Tab. Alt+F4)
But I myself have Hstart or something,  which lets me hide command prompts.  So while batch1 is running,  batch2 is running in the background too so you cant see it. XP

Its made to simply keep killing off Task Manager (so you cant manually start Explorer.exe) and Explorer.  so you pretty much cant use the computer until you put in a password.
When the password is finally said currectly,  it will kill off the prompt that is running Task Killer.



-
And so I dont double post:
A random wallpaper and random .mp3 on startup batch.  Kinda like the one above me.
This assumes you have mp3 and wall folders in the same folder as the batch.
And the walls and mp3's are named like 1-9. . .lol

Code: [Select]
@Echo Off
Echo The number generator is working its magic,  give this a second. . .
:tryagn
set num=%random%
if /i %num% GTR 9 goto tryagn
if /i %num% LSS 1 goto tryagn
start MP3\%num%.mp3 /MIN
reg add "hkcu\control panel\desktop" /v wallpaper /t REG_SZ /d "Walls\%num%.BMP" /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
CLS
Echo Done!
Pause
exit
IF THE ABOVE CODE DOESNT WORK ON THE WALLPAPER,  ITS PROBABLY BECAUSE EITHER YOU USED SOMETHING OTHER THEN A .BMP FORMATTED WALLPAPER,  OR YOU HAVE A DIFFERENT OS (different OS means the Registry value may be different. My OS is WindowsXP Media SP2.)



It's a little cleaner ;)
Title: Re: Batch Programs Thread.
Post by: Helpmeh on April 04, 2010, 10:09:05 AM
Quote
@Echo Off
Echo The number generator is working its magic,  give this a second. . .
:tryagn
set num=%random%
if /i %num% GTR 9 goto tryagn
if /i %num% LSS 1 goto tryagn
start MP3\%num%.mp3 /MIN
reg add "hkcu\control panel\desktop" /v wallpaper /t REG_SZ /d "Walls\%num%.BMP" /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
CLS
Echo Done!
Pause
exit
There's one small issue with that code, highlighted in red. Now, %random% outputs to a number between 0 and 32767. That is 32768 numbers. Now, since you are trying to get a number between 1 and 9. So, there are 9 chances in 32768-1 (-1 because no 0, so it's out of 32767) to get your desired option. Look at the length of time that code will take to execute, just to get the desired number, compared to faster version:

Code: [Select]
@echo off
echo Start 1: %time%
:loop
set rnd=%random%
if %rnd% GTR 9 goto loop
if %rnd% LSS 1 goto loop
echo Random Number 1: %rnd%
echo End 1: %time%
echo Start 2: %time%
set /a rnd=%random%%%10+1
echo Random Number 2: %rnd%
echo End 2: %time%
pause
Output:
Quote
Start 1: 12:10:10.75
Random Number 1: 6
End 1: 12:10:18.07
Start 2: 12:10:18.07
Random Number 2: 7
End 2: 12:10:18.07
Press any key to continue . . .

The difference might not seem like much, but 8 seconds can really add up.
Title: Re: Batch Programs Thread.
Post by: Frozen2Dream on April 04, 2010, 02:45:08 PM
Oh nice.   Thanks XP

There are like, a few different ways to generate random numbers with the %Random%.
I just found the small one I used and decided it was okay enough.

Your version of it is better,  thanks for the tip.
Title: Re: Batch Programs Thread.
Post by: Helpmeh on April 04, 2010, 03:01:10 PM
Oh nice.   Thanks XP

There are like, a few different ways to generate random numbers with the %Random%.
I just found the small one I used and decided it was okay enough.

Your version of it is better,  thanks for the tip.
I used that technique before, too. Then I found this one, and it is great.
Title: Re: Batch Programs Thread.
Post by: ---saster--- on April 09, 2010, 07:35:24 AM
a matrix effect

Code: [Select]
@echo off

setlocal enabledelayedexpansion

title Matrix Effect
mode con cols=40 lines=20
color 0A

set "var=%random:~-1%"
:first
ping localhost -n 1 >nul
for /f "tokens=*" %%_ in ("%var%") do (
<nul set/p "=%%~_ "
echo.&echo.
)
if ["%cont%"]==["9"] (call:llen "0") else (set/a "cont+=1"&goto:first)
goto:first

:llen
set "cont=%*"
for /l %%_ in (9,-1,0) do (set "var=!var:%%_=%random:~-1%!")
set "var=%var% %random:~-1%"
goto:first
Title: Re: Batch Programs Thread.
Post by: Helpmeh on April 25, 2010, 07:37:42 PM
Well, a while ago I got in trouble and had to talk to the school principal (which is a pretty big deal, most students only talk with a vice principal). Anyway, it turns out that one of my experiments went a little bit faster than expected and almost crashed a server which stores files for 5 schools in my area. So, the principal said I should try using my talents for something a little bit more useful (and hinted at less experimental), so I have devised two scripts which are quite helpful to one who plays a MMORPG called Runescape (http://www.runescape.com). Let me explain.

Runescape has a "Grand Exchange", much similar to the stock market. Prices for various items fluctuate daily (hourly even). One script will take information from the market website and display it in a handy log file (for later examination). It takes ID numbers (which represents an item, similar to a ticker [GOOG] would represent a company [GOOGLE]) and a common URL to scrape information off the webpage. The second script will be very helpful as it can provide an ID code for a desired item. Both scripts use CURL (c) 1996 - 2010, Daniel Stenberg (included), a program which allows the downloading of files via the command-line.

To start you off, I added 4 different items, 3 which would probably be commonly bought or sold, and one which is the most expensive item in Runescape, the Christmas Cracker. To modify the items displayed, look in "Pricechecker.bat" starting at the 7th line.

[Download]
Pricechecker.zip
     1. CURL
     2. Pricechecker.bat
     3. Search.bat
 (http://www.mediafire.com/?r5yoj0w0rx0)[/Download]

[recovering disk space - old attachment deleted by admin]
Title: Re: Batch Programs Thread.
Post by: mat123 on April 30, 2010, 09:55:15 PM
here is a cpu test utility
after a while it gives you a score lower is better
mine was 72

Code: [Select]
@echo off
title 50000to0
echo ^<-------------------------^>
echo ^<---50,000 to zero test---^>
echo ^<-------------------------^>
echo.
echo press any key to scan or "Q" to quit
set /p scn=
if %scn%==Q exit
if %scn%==q exit
if %scn%=="Q" exit
if %scn%=="q" exit
:top
cls
echo.
echo format of numbers will be
echo.
echo ^| time ^| number of caculations left ^| total caculations to be preformed ^|
:1
set SS=%TIME:~6,2%
if %SS%==00 goto b
if %SS%==10 goto b
if %SS%==20 goto b
if %SS%==30 goto b
if %SS%==40 goto b
if %SS%==50 goto b
goto 1
:b
set /a x=50000
set /a x3=0
set /a xs=0
set /a x2=0
set /a x2s=0

set /a x3=%x%
set /a HH=0
set /a MM=0
set /a SS=0
set /a HM=0
set /a MS=0
set /a HS=0
set /a SA=0
set HH1=%TIME:~0,2%
set MM1=%TIME:~3,2%
set SS1=%TIME:~6,2%
:a
if %x% leq 0 goto answer
echo ^| %time% ^| %x% ^| %x3% ^|
set /a x2s=%x2%
set /a xs=%x%
set /a x2=%x%+%x2s%
set /a x=%xs%-1
goto a

:answer
cls
set SS2=%TIME:~6,2%
set HH2=%TIME:~0,2%
set MM2=%TIME:~3,2%
set /a HH=%HH2%-%HH1%
set /a MM=%MM2%-%MM1%
set /a SS=%SS2%-%SS1%
if %HH%==0 goto alt
if %MM%==0 goto alt1
set /a HM=%HH%*60
set /a MS=%MM%*60
set /a HS=%HM%*60
set /a SA=%HS%+%MS%+%SS%
echo your score is: %SA%
goto C

:alt
if %MM%==0 goto alt1
set /a MS=%MM%*60
set /a SA=%MS%+%SS%
echo your score is: %SA%
goto C

:alt1
set /a SA=%SS%
echo your score is: %SA%

:C
echo press any key to rescan or "Q" to quit
set /p scn=
if %scn%==Q exit
if %scn%==q exit
if %scn%=="Q" exit
if %scn%=="q" exit

:quit
exit
Title: Re: Batch Programs Thread.
Post by: helix512 on May 17, 2010, 01:44:52 PM
not sure where i need to post this BUT here goes.

i made a batch file to delete a file in my world of warcraft folder there is more then just me who use this batch file i make an addon pack for me and a few friends. There is one addon we use that before you start wow you need to delete a cache file so that it works correctly. now here is my batch and what i want to do with it. every thing here is fine BUT i want to know if for some reason you ran it and you had already deleted the file but forgot some how that it was gone i want to GOTO command to to skip the section that says that it deleted the fiel casue if its not there then you did not delete it again. if this makes any sence at all

Code: [Select]
@Echo off
REM This file will Delete the creaturecache.wdb file so _NPCScanc works correctly
REM
@Echo This will Delete World of Warcraft creaturecache.wdb file
REM
cd C:\Users\Public\Games\World of Warcraft\Cache\WDB\enUS
del creaturecache.wdb
REM
@ECHO -------------------------------------------
@ECHO The creaturecache.wdb file has been deleted
@ECHO -------------------------------------------
REM
@ECHO This Window will CLOSE when you
REM
@PAUSE

Title: Re: Batch Programs Thread.
Post by: Helpmeh on May 17, 2010, 03:54:10 PM
Code: [Select]
@Echo off
REM This file will Delete the creaturecache.wdb file so _NPCScanc works correctly
REM
@Echo This will Delete World of Warcraft creaturecache.wdb file
REM
cd C:\Users\Public\Games\World of Warcraft\Cache\WDB\enUS
del creaturecache.wdb
REM
@ECHO -------------------------------------------
@ECHO The creaturecache.wdb file has been deleted
@ECHO -------------------------------------------
REM
@ECHO This Window will CLOSE when you
REM
@PAUSE
Why did you keep adding @ in front of echo and pause? There is no need after @echo off.
Title: Re: Batch Programs Thread.
Post by: helix512 on May 19, 2010, 11:19:09 AM
been almost 20 yeasr sicne i ever played with batch files and i dont ever pretend to remember much about them to be honest lol. but i removed then now i hope i can find the help i was asking for LOL thanks for let me know to remove the other @ from the file
Title: Re: Batch Programs Thread.
Post by: mat123 on May 25, 2010, 09:48:40 PM
quick and dirty exe to bat
a bat file compressed to an exe decompressor
Code: [Select]
@echo off
start /min %1
dir /s C:\%~n1.bat | find "Directory of" > dir.txt
for /f "tokens=1-2*" %%a in (dir.txt) do (
  cd /d "%%c"
start notepad %~n1.bat
)
Title: Re: Batch Programs Thread.
Post by: marvinengland on June 01, 2010, 05:49:18 PM
quick and dirty exe to bat
a bat file compressed to an exe decompressor


Convert exe to bat

http://fixunix.com/ms-dos/539963-converting-exe-file-bat-file.html


How to convert exe file to bat file?

Simple, here's an example:

Code: [Select]
@echo off
REM tested
ren myfile.exe myfile.bat 


Another example:

@echo off
REM results cause problems in some OS's
ren Buddist.exe Christian.bat
Title: Re: Batch Programs Thread.
Post by: mat123 on June 02, 2010, 06:21:37 AM
marvin your method gives something like this


MZ       ÿÿ  ¸       @                                   €   º ´   Í!¸LÍ!This program cannot be run in DOS mode.

$       PE  L $+I        à  2 P        @à       ð    @                                                             tó  è   ð  t                                                                                                          UPX0                             €  àUPX1     P       L                 @  à.rsrc       ð      N              @  À3.03 UPX!
   
 ·AÔÉÌå¶mÉ   @   Œ  & @ 40üsãö*»Í›B]hFÄBxýæÈ—¹ /G•03ÃÚséPïÀbV
œY4+l““¢žöN·]t#†o.W;ºÑ$nl1ã+áÑ‹½y‡ºâ[½j¬ö[∦   aáÜ;”ë 5Ã6ñã¡O"«“{_­þ/o&°óW¼ÌRá`‘/ChlØC‰/ž|΃Ðq®r®ÉóïÓíÊ-ò{Cqû>©R*dâ¾æ’äȢ §¿ƒÄî8óÑ*X4}² ¸!VŸëDLŸI!lF±¼
kp•5ƒï”»h¾53Áñ4©8QŠŸT‡èÖÄ=—ÅY   É%ß&~ä6²{Žr¿\Ë8=µ»Óä-`îud…ÉG”â®%×Ôê440)zï_BA ã}ÎPfrd y§‹^ wkxS ÎñŠ—uÊ(®-tpþô&ˆ¢Ò°Ò@








while mine gives

Code: [Select]
@echo off
:A
ipconfig /renew > nul
sleep 1800
goto a
                                                                               
Title: Re: Batch Programs Thread.
Post by: foxhound on June 12, 2010, 09:04:09 AM
Here is a simple password protected shutdown timer script I wrote. I've only got into batch scripting(or any other programming for that matter) a few weeks ago. What do you think?  ;D

1) It creates a directory to save log files and vbs script
2) After five consecutive wrong passwords, it generates a vbs script to give an error dialog and then a lock.vbs to lock
the batch file
Code: [Select]
::Simple password protected batch shutdown script
:: By Foxhound
@echo off
if not exist C:\webscripts\ mkdir C:\webscripts\
cd C:\webscripts\
if exist lock.vbs goto lock
mode con cols=59 lines=10
echo File first accessed at %date% %time% >>log.txt
title Scripts Console v-1.0
color 0A
set password=323461
set varlim=5
set vars=0
cls
:PASSS
if %vars%==%varlim% GOTO FAILURE
color 0A
cls
echo Please enter your password:
set /P vari=""
if %vari%==yourpasswordhere GOTO begin
goto INCOR
:INCOR
color 0c
cls
set /A vars+=1
echo Inccorect Password. Logged!
echo Inccorect password attempted at %date% at %time% Password attempted:%vari% >>"C:\webscripts\log.txt"
pause >nul
GOTO PASSS
:FAILURE
cls
color 0c
echo Program terminated due to five consecutive password errors at %time% %date% >>"C:\webscripts\log.txt"
echo MsgBox "Program terminated due to five consecutive password errors.", vbExclamation >>"C:\webscripts\error.vbs"
cd "c:\program files\webscripts\"
start /w error.vbs
echo MsgBox("ACCESS DENIED") >"C:\webscripts\lock.vbs"
GOTO EOF

:begin
cls
echo Successfully Logged in at %date% >>C:\webscripts\log.txt
echo Successfully logged in.
pause >nul
:shutset
cls
set /p minutes= How many minutes before shutdown?
set /p rep= What message?
cls
set /a seconds=%minutes%*60
:FINALWARN
set /p shutwarn=So you want to shut down the PC in %minutes% minutes?y/n
if %shutwarn%==y goto shutdown
if %shutwarn%==n goto shutset
goto finalwarn
:shutdown
shutdown /s /c "%rep%" /t "%seconds%"
color 0c
cls
echo Shutting down in %minutes% minutes!!!
pause >nul
exit
:lock
start lock.vbs
exit

Title: Re: Batch Programs Thread.
Post by: mat123 on June 12, 2010, 10:52:53 AM
just wondering what does this do
Title: Re: Batch Programs Thread.
Post by: macdad- on June 19, 2010, 11:11:01 AM
foxhound,

Just some words of advice:

1.When it comes to security(such as password protection), Batch is the worst.
     A workaround is to compile the bat into an exe:
     http://www.computerhope.com/issues/ch000435.htm (http://www.computerhope.com/issues/ch000435.htm)

2.Using the REM command instead of :: can prevent you from execution errors, although it is always the programmer's choice, like in C++, the choice between
Code: [Select]
/* Comment...Blah Blah */ and
Code: [Select]
//Comment to the end of this line
3.You can add a /I switch to the If command to make it case-insensitive:
Code: [Select]
if /I %shutwarn%==y goto shutdown
if /I %shutwarn%==n goto shutset

Other than that, It is a pretty professional batch script(First time I've seen the mode command used in a batch script  8) )

,Nick(macdad-)
Title: Re: Batch Programs Thread.
Post by: foxhound on June 27, 2010, 04:54:47 PM

3.You can add a /I switch to the If command to make it case-insensitive:
Code: [Select]
if /I %shutwarn%==y goto shutdown
if /I %shutwarn%==n goto shutset

Other than that, It is a pretty professional batch script(First time I've seen the mode command used in a batch script  8) )

,Nick(macdad-)
Thanks for the tip. It means a lot.  :D

One question:

1) Is there any way to make sure the user enters either only strings or integers in the set command?
Title: Re: Batch Programs Thread.
Post by: vilasshende on June 27, 2010, 08:14:08 PM
have any command for shutdown the computer?
Title: Re: Batch Programs Thread.
Post by: foxhound on June 27, 2010, 08:32:55 PM
have any command for shutdown the computer?

Code: [Select]
@echo off
REM By Foxhound
title Simple Shutdown Script
:shutset
cls
set /p minutes= How many minutes before shutdown?
set /p rep= What message?
cls
set /a seconds=%minutes%*60
:FINALWARN
cls
set /p shutwarn=So you want to shut down the PC in %minutes% minutes?y/n
if /I %shutwarn%==y goto shutdown
if /I %shutwarn%==n goto shutset
goto finalwarn
:shutdown
shutdown /s /c "%rep%" /t "%seconds%"
color 0c
cls
:exitwarn
cls
echo Shutting down in %minutes% minutes!!!
cls
echo 1. Cancel Shutdown
echo 2. Exit
set /p exit=
if %exit%==1 (
shutdown -a
cls
echo Shutdown Cancelled. Press any key to exit.
pause >nul
goto eof
)
if %exit%==2 GOTO EOF
GOTO exitwarn

if you just want the shutdown alone
Code: [Select]
shutdown /p
Title: Re: Batch Programs Thread.
Post by: macdad- on June 28, 2010, 08:25:26 AM
Thanks for the tip. It means a lot.  :D

No problem

1) Is there any way to make sure the user enters either only strings or integers in the set command?

Unfortunately not, in Batch there are no variable types, everything is a string, so it would be very hard to check if it was a string or integer, you could try to pass the variable to a VB Script to determine whether it was a string or integer then return a value to the batch script, but I don't know much VBS.
Title: Re: Batch Programs Thread.
Post by: mat123 on June 28, 2010, 03:25:21 PM
1) Is there any way to make sure the user enters either only strings or integers in the set command?
Code: [Select]
@echo off
set /p str=type here
cls
set b=0
for /l %%a in (0,1,9) do (
echo %str%|find "%%a" >nul
if ERRORLEVEL 0 set b=1
)
if %b%==1 goto num
echo no numbers
pause
exit
:num
echo numbers
pause
exit
Title: Re: Batch Programs Thread.
Post by: Sidewinder on June 28, 2010, 03:59:10 PM
Using a regular expression may make the code easier to read:

Code: [Select]
@echo off
set /p value=Enter value:
echo %value%|findstr /r "[^0-9]" > nul
if errorlevel 1 (echo %value% is numeric) else (echo %value% not numeric)

Good luck. 8)
Title: Re: Batch Programs Thread.
Post by: Helpmeh on June 28, 2010, 08:02:09 PM
everything is a string
Strings or integers. You can't do math on a string.

Title: Re: Batch Programs Thread.
Post by: BC_Programmer on June 28, 2010, 08:09:26 PM
Strings or integers. You can't do math on a string.



Batch doesn't have the concept of a data type. Everything is a string.

when you use

Code: [Select]
set /a 15+15

"15+15" is still a string. it is only parsed into an integer from within cmd.exe's set command sub-routine.

Environment variables are <never> regarded as integers or any sort of number. they are always stored as a sequence of character strings in the environment block.

Title: Re: Batch Programs Thread.
Post by: Helpmeh on June 28, 2010, 08:42:23 PM
Ohh...
Title: Re: Batch Programs Thread.
Post by: ghostdog74 on June 28, 2010, 11:12:21 PM
Code: [Select]
@echo off
set /p str=type here
cls
set b=0
for /l %%a in (0,1,9) do (
echo %str%|find "%%a" >nul
if ERRORLEVEL 0 set b=1
)
if %b%==1 goto num
echo no numbers
pause
exit
:num
echo numbers
pause
exit

you sure this works?
Title: Re: Batch Programs Thread.
Post by: macdad- on June 29, 2010, 08:16:09 AM
Using a regular expression may make the code easier to read:

Code: [Select]
@echo off
set /p value=Enter value:
echo %value%|findstr /r "[^0-9]" > nul
if errorlevel 1 (echo %value% is numeric) else (echo %value% not numeric)

Good luck. 8)

Never thought of that, Good job  8)
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on June 29, 2010, 08:43:20 AM
Quote
if errorlevel 1 (echo %value% is numeric) else (echo %value% not numeric)/quote]

I didn't think the old DOS if errorlevel format allows else clauses?


Title: Re: Batch Programs Thread.
Post by: Salmon Trout on June 29, 2010, 09:49:23 AM
correction...

Quote
if errorlevel 1 (echo %value% is numeric) else (echo %value% not numeric)

I didn't think the old DOS if errorlevel format allows else clauses?
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on June 29, 2010, 02:14:22 PM
It seems to...
Title: Re: Batch Programs Thread.
Post by: mat123 on July 08, 2010, 02:54:31 PM
i just created XIF short for  eXtended IF. it supports all 6 of the
logic operators (OR, AND, NOR, NAND, XOR, NXOR)
Code: [Select]
if 0%1==0 exit
if 0%el%==0 exit
set el=0
set or=0
set and=0
set nand=0
set nor=0
set xor=0
set nxor=0
if %4==or goto or
if %4==and goto and
if %4==nand goto nand
if %4==nor goto nor
if %4==xor goto xor
if %4==nxor goto nxor
exit
:or
if %1 %2 %3 set el=1
if %5 %6 %7 set el=1
goto end
:and
if %1 %2 %3 if %5 %6 %7 set el=1
goto end
:nor
if not %1 %2 %3 set nor=1
if %nor%==1 if not %5 %6 %7 set el=1
goto end
:nand
if not %1 %2 %3 set nand=1
if %nand%==1 if not %5 %6 %7 set el=1
goto end
if %1 %2 %3 set if not %5 %6 %7 set el=1
goto end
if %5 %6 %7 if not %1 %2 %3 set el=1
goto end
:xor
if %1 %2 %3 set xor=1
if %xor%==1 if not %5 %6 %7 set el=1
goto end
if %5 %6 %7 set xor=1
if %xor%==1 if not %1 %2 %3 set el=1
goto end
:nxor
if not %1 %2 %3 set nxor=1
if %nxor%==1 if not %5 %6 %7 set el=1
goto end
if %1 %2 %3 if %5 %6 %7 set el=1
goto end
:end
set or=
set and=
set nand=
set nor=
set xor=
set nxor=
Syntax: call xif %l% equ %m% or %l% equ %m%
then after that
if %el%==1 do something
NOTE: You must have an el varible allredy set and you cant use a varible with the name of logic operators
P.S if you no of any more logic operators could you tell me
Title: Re: Batch Programs Thread.
Post by: foxhound on July 20, 2010, 12:39:28 PM
Keep a process open:
Opens a specified process and checks every five seconds to see if its still running. If not it opens it again.
Code: [Select]
@echo off
mode con cols=35 lines=10
title Keep a process open.
set /p ppath=Enter the folder where the process is located in:
cls
set /p pname=Enter the exact name of the process you wish to keep open:
cd %ppath%
:loop
cls
tasklist | find "%pname%" >nul
if %errorlevel%==1 (
color 0c
echo Program not found. Starting %pname%
start %pname%
goto wait
)
if %errorlevel%==0 (
color 0a
echo Program found. Skipping start.
goto wait
)
:wait
timeout /t 5 /NOBREAK >nul
goto loop
I believe timeout command is for Vista and up, you might want to use the localhost ping trick for the delay for XP or below.
Title: Re: Batch Programs Thread.
Post by: foxhound on July 20, 2010, 02:06:56 PM
Keep a process closed:
A variant of the above. Checks every second to see if a process is running. If so, it kills the process.

Code: [Select]
@echo off
mode con cols=55 lines=10
title Keep process closed.
set /p ppath=Enter the folder where the process is located in:
cls
set /p pname=Enter the exact name of the process you wish to keep open:
cd %ppath%
:loop
cls
tasklist | find "%pname%" >nul
if %errorlevel%==1 (
color 0c
echo Process not found...
goto wait

)
if %errorlevel%==0 (
color 0a
echo Process found. Killing it.
taskkill /FI "IMAGENAME eq %pname%" >nul
goto wait
)
:wait
REM replace timeout with "ping localhost -n 1" for Windows XP and below.
timeout /t 1 /NOBREAK >nul
goto loop
Title: Re: Batch Programs Thread.
Post by: cloudy3 on August 11, 2010, 01:45:57 AM
it looks complicated
Title: Re: Batch Programs Thread.
Post by: mat123 on August 12, 2010, 07:47:31 PM
what looks complicated
Title: Re: Batch Programs Thread.
Post by: Sionach on August 14, 2010, 05:20:09 AM
This is part of a batch file that I am using.
Is it possible to have the file recognise "SP134125-8mm SV" and ignore the "-a" as this variable may change in the future?

The file being exported will contain "SP134125-8mm SV-a"



"C:\Prolink\SPC Office Buddy 3.2\SPCOfficeBuddy.exe" /batch; database=C:\Prolink\QC-CALC 3.3\data\SP134125-8mm SV-a.Qcc; exceljob=Medtronic Wave Form4; recfilter=LastRec; dimfilter=Arc RadBot


Thank you in advance to any one who can help.
Title: Re: Batch Programs Thread.
Post by: MattPwns on August 17, 2010, 04:09:29 PM
this isnt a help post, its where you post batch programs you've made if you want to share them.


*Sigh*, clearly you didn't even read the first post...
Title: Re: Batch Programs Thread.
Post by: shanked on November 26, 2010, 12:18:08 AM
I made this not that long ago (not that advanced) and just looked at other batch files and learned :D So far this is what i made... You get the option of choosing your color and counting forward and backward etc. Pretty useless, i was just bored. Some beginners could look at it and make something out of it.

I know there are things i could improve on so please help out :D


Code: [Select]
title %username%
:front1
@echo off
color 0f
set /a var=%var%
set /a var2=%var2%
set /a var3=%var3%
set /a var4=%var4%

::~~~~~~~~~~~~~~~~~COLORS
:front
cls
Echo Type in what color you want in the [ ]...
echo.
echo The options are...
echo.
echo.
echo Yellow [Yellow]
echo.
echo Dark Blue [Dblue]
echo.
echo Dark Green [Dgreen]
echo.
echo Dark Red [Dred]
echo.
echo Dark Purple [Dpurple]
echo.
echo White (Keeps the same as now) [White]
echo.
echo Normal Blue (Awesome) [Blue]
echo.
echo Neon Green (Awesome) [Green]
echo.
echo Baby Blue [Bblue]
echo.
echo Bright Red [Red]
echo.
echo PINK [Pink]
echo.
echo Or Press [R] for random...
echo.
echo.

set /p color=
if '%color%'=='yellow' goto :yellow
if '%color%'=='dblue' goto :darkb
if '%color%'=='dgreen' goto :darkg
if '%color%'=='dred' goto :darkr
if '%color%'=='dpurple' goto :darkp
if '%color%'=='white' goto :white
if '%color%'=='blue' goto :blue
if '%color%'=='green' goto :green
if '%color%'=='bblue' goto :baby
if '%color%'=='red' goto :red
if '%color%'=='pink' goto :pink
if '%color%'=='r' goto :random

if '%color%'=='Yellow' goto :yellow
if '%color%'=='Dblue' goto :darkb
if '%color%'=='Dgreen' goto :darkg
if '%color%'=='Dred' goto :darkr
if '%color%'=='Dpurple' goto :darkp
if '%color%'=='White' goto :white
if '%color%'=='Blue' goto :blue
if '%color%'=='Green' goto :green
if '%color%'=='Bblue' goto :baby
if '%color%'=='Red' goto :red
if '%color%'=='Pink' goto :pink
if '%color%'=='R' goto :random
) else (
goto :errorCOLOR
)
)

:errorCOLOR
cls
color 0f
echo That color was not found...
echo Please try again...
echo.
echo Press Enter to return to the pervious screen...
pause >nul
goto :front

:yellow
color 0e
goto :blank

:darkb
color 01
goto :blank

:darkg
color 02
goto :blank

:darkr
color 04
goto :blank

:darkp
color 05
goto :blank

:white
color 0f
goto :blank

:blue
color 09
goto :blank

:green
color 0a
goto :blank

:baby
color 0b
goto :blank

:red
color 0c
goto :blank

:pink
color 0d
goto :blank

::~~~~~~~~~~~~~~~~~~~~~CHOOSING RANDOM COLOR
:random
@echo off
cls
:1
set /a R=%random%%%6+1
@echo off
cls
set /a R=%random%%%6+1

if '%R%'=='1' goto :yellow
if '%R%'=='2' goto :blue
if '%R%'=='3' goto :green
if '%R%'=='4' goto :baby
if '%R%'=='5' goto :red
if '%R%'=='6' goto :pink


::~~~~~~~~~~~~~~~~~~~CHOICES ON COUNTING
:blank
cls
echo Do you want to count forwards (1)
echo.
echo Or count backwards (2)
echo.
echo Press (3) to count as fast as possible forwards
echo.
echo Press (4) to count as fast as possible backwards
echo.
echo.

echo Press (5) to choose a different color
echo.
echo.
set /p which=
if '%which%'=='1' goto :repeat1
if '%which%'=='2' goto :repeat2
if '%which%'=='3' goto :forward
if '%which%'=='4' goto :backward
if '%which%'=='5' goto :front1
) else (
goto :blank
)
)

::~~~~~~~~~~~~~~~~~~~FORWARD FAST

:forward
cls
echo Type in the number you want to start with
echo.
set /p var3=
cls
echo Now type in the number you want it to go to (The 'goal' number)
echo.
echo To work correctly, this number should be higher that the pervious number.
echo.
echo (TIP) Make the number really high (10-20,000+)
echo.
set /p goal3=
if %goal3% lss %var3% goto :error3

cls
echo Finally, type in the number you want it to count up by (by 1s, 2s, 3s etc.)
echo.
echo (TIP) The number 1 is recommened :D
echo.
set /p amountok=
cls


:set3
set /a var3=%var3% +%amountok%
echo %var3%
if %var3%==%goal3% goto :wow
goto :set3

::~~~~~~~~~~~~~~~~BACKWARDS FAST
:backward
cls
echo Type in the number you want to start with
echo.
echo (TIP) Choose a really high number thats positive (10,000 to 20,000+)
echo.
set /p var4=
cls
echo Now type in the number you want it to go to (The 'goal' number)
echo.
echo To work correctly, this number should be lower that the pervious number.
echo.
echo (TIP) Make the number really low (Negative)  (-10,000 to -20,000+)
echo.
echo Do not include the negative sign.
echo.
set /p goal4=
if %goal4% geq %var4% goto :error4

cls
echo Finally, type in the number you want it to count down by (by 1s, 2s, 3s etc.)
echo.
echo (TIP) The number 1 is recommened :D
echo.
set /p amountok2=
cls


:set4
set /a var4=%var4% -%amountok2%
echo %var4%
if %var4%==%goal4% goto :wow
goto :set4

::~~~~~~~~~~~~~~~~~~FORWARD 1 BY 1
:repeat1
cls
echo Type in the number you want to start with
echo.
set /p var=
cls
echo Now type in the number you want it to go to (The 'goal' number)
echo.
echo To work correctly, this number should be higher that the pervious number.
echo.
set /p goal=
if %goal% lss %var% goto :error

cls
echo Finally, type in the number you want it to count up by (by 1s, 2s, 3s etc.)
echo.
echo.
set /p amount1234=


:set
cls
set /a var=%var% +%amount1234%
echo %var%
if %var%==%goal% goto :wow
pause >nul
goto :set

::~~~~~~~~~~~~~~~~~~~~BACKWARD 1 BY 1

:repeat2
cls
echo Type in the number you want to start with
echo.
set /p var2=
cls
echo Now type in the number you want it to go to (The 'goal' number)
echo.
echo To work correctly, this number should be lower that the pervious number.
echo.
set /p goal2=
if %goal2% geq %var2% goto :error2

cls
echo Finally, type in the number you want it to count down by (by 1s, 2s, 3s etc.)
echo.
echo.
set /p amount123=

:set2
cls
set /a var2=%var2% -%amount123%
if %var2%==%goal2% goto :wow
echo %var2%
pause >nul
cls
goto :set2

::~~~~~~~~~~~~~~~~~~~~THE ENDING REPLY

:wow
echo.
echo.
echo You can count :D
@ECHO OFF
set wait=0
:pause1
set /a wait=%wait%+1
if %wait% leq 1000 goto pause1
echo.
echo Press enter to continue...
echo.
pause >nul
:restart1
cls
echo Restart? Yes or No
echo.
set /p restart=
if '%restart%'=='yes' goto :front
if '%restart%'=='no' goto :exit
) else (
goto :restart1
pause >nul

:exit
cls
echo Bye :D
pause >nul
exit

::~~~~~~~~~~~~~~~~~~~~~ERRORS

:error3
cls
echo The number must be higher than the previous number
echo.
echo Press enter to return to the pervious screen...
pause >nul
goto :forward

:error4
cls
echo The number must be lower than the previous number
echo.
echo Press enter to return to the pervious screen...
pause >nul
goto :backward

:error
cls
echo The number must be higher than the previous number
echo.
echo Press enter to return to the pervious screen...
pause >nul
goto :repeat1

:error2
cls
echo The number must be lower than the previous number
echo.
echo Press enter to return to the pervious screen...
pause >nul
goto :repeat2
Title: Re: Batch Programs Thread.
Post by: shanked on November 26, 2010, 12:37:13 AM
Heres another batch file i made...a lot simpler than the one above. It just asks for a password and lists the number of tries. (Obviously the pass is listed inside the batch ;)  )


Code: [Select]
@echo off
color 0a
title 3 Tries
set /a tries=3
:start
echo Whats the secret code?    You have %tries% tries left.
if %tries%==1 (
echo LAST TRY!
)

set /p pass=
if %pass%==shanked.is.pro (
goto :right
)


set /a tries=%tries -1
if %tries%==0 (
goto :fail
)

cls
goto :start

:fail
cls
echo You fail gtfo.
pause >nul
pause >nul
exit

:right
cls
echo YES I AM :D
pause >nul
pause >nul
Title: Re: Batch Programs Thread.
Post by: shanked on November 26, 2010, 12:43:13 AM
Another batch, this one is unbeatable RPS (Rock, Paper, Scissors) lol :P

Code: [Select]
@echo off
color 0a
title RPS

ECho ROCK PAPER OR SCISSORS!
@ECHO OFF
set wait=0
:pause19
set /a wait=%wait%+1
if %wait% leq 1000 goto pause19
goto :set





:set
cls
color 0a
echo Choose Rock, Paper, or Scissors
echo.
echo 1 is Rock
echo 2 is Paper
echo 3 is Scissors
echo.

set /p option=
if '%option%'=='1' goto :paper
if '%option%'=='2' goto :sci
if '%option%'=='3' goto :rock
) else (
goto :choose
)
)

:choose
cls
color 0f
echo Pick 1,2, or 3 ONLY
pause >nul
goto :set

:paper
cls
echo.
echo You chose Rock?
echo.
@echo off
set wait=0
:pause6
set /a wait=%wait%+1
if %wait% leq 1000 goto pause6

echo.
echo I chose Paper!
echo.
echo HAHA I win :D
echo.
echo.
@ECHO OFF
set wait=0
:pause7
set /a wait=%wait%+1
if %wait% leq 1000 goto pause7
goto :chooose

:sci
cls
echo.
echo You chose Paper?
echo.
@echo off
set wait=0
:pause4
set /a wait=%wait%+1
if %wait% leq 1000 goto pause4
echo I chose Scissors!
echo.
echo HAHA LOSER! :D
echo.
echo.
@ECHO OFF
set wait=0
:pause8
set /a wait=%wait%+1
if %wait% leq 1000 goto pause8
goto :chooose

:rock
cls
echo.
echo You chose Scissors?
echo.
@echo off
set wait=0
:pause5
set /a wait=%wait%+1
if %wait% leq 1000 goto pause5
echo I chose Rock!
echo.
echo HAHA YOU LOST! :D
echo.
echo.
@ECHO OFF
set wait=0
:pause9
set /a wait=%wait%+1
if %wait% leq 1000 goto pause9
goto :chooose

:chooose
cls
echo Want to play again? Y/N

set /p equ=
if '%equ%' =='y' goto :set
if '%equ%' =='n'
goto :what
) else (
goto :chooose
)
)

:what
color 0f
cls
Echo So you don't want to play anymore?
@ECHO OFF
set wait=0
:pause2
set /a wait=%wait%+1
if %wait% leq 1500 goto pause2
echo Too bad- Play it again
@ECHO OFF
set wait=0
:pause3
set /a wait=%wait%+1
if %wait% leq 1500 goto pause3
goto :set



Title: Re: Batch Programs Thread.
Post by: shanked on November 26, 2010, 01:58:08 AM
Heres another RPS (rock, paper, or scissors) i just made. It should be random and it keeps score so enjoy :D

If any bugs/any mistakes just fix it or whatever/ PM me.

Here you go :
Code: [Select]
@echo off
title RPS!
set /a tries=0
set /a ctries=0
color 0a
echo Please enter you name:
echo.
set /p name=
:top
if %tries%==15 (
goto :winner
)
if %ctries%==15 (
goto :loser
)

cls
echo ROCK PAPER OR SCISSORS!
echo First one to reach 15 points WINS!
echo.
echo.
echo %name% has %tries% points.
echo The computer has %ctries% points.
echo.
if %tries%==14 (
echo One more point for %name%!
)
if %ctries%==14 (
echo One more point for the computer!
)

echo.
echo Choose Rock, Paper, or Scissors
echo.
echo R is Rock
echo P is Paper
echo S is Scissors
echo.

set /p option=
if '%option%'=='r' goto :rock
if '%option%'=='p' goto :paper
if '%option%'=='s' goto :scissors
if '%option%'=='R' goto :rock
if '%option%'=='P' goto :paper
if '%option%'=='S' goto :scissors
) else (
goto :top
)
)

goto :top

::~~~~~~~~~~~~~~~~~~ROCK


:rock
@echo off
cls
set /a rock123=%random%%%3+1
@echo off
cls
set /a rock123=%random%%%3+1

@echo off
cls
set /a TV=%random%%%3+1
@echo off
cls
set /a TV=%random%%%3+1

if %TV% gtr %rock123% goto :greaterrock
if %TV% equ %rock123% goto :equalrock
if %TV% lss %rock123% goto :lessrock

:greaterrock
cls
echo %name% chose Rock and Computer chose Paper
echo.
echo Computer wins
set /a ctries=%ctries +1
echo.
echo Computer gets a point
pause >nul
goto :top

:equalrock
cls
echo %name% chose Rock and Computer chose Rock too
echo.
echo It's a TIE
echo No points awarded
pause >nul
goto :top


:lessrock
cls
echo %name% chose Rock and Computer chose Scissors
echo.
echo %name% wins
set /a tries=%tries +1
echo.
echo %name% gets a point
pause >nul
goto :top

::~~~~~~~~~~~~~~~~~PAPER

:paper
@echo off
cls
set /a paper123=%random%%%3+1
@echo off
cls
set /a paper123=%random%%%3+1

@echo off
cls
set /a TV1=%random%%%3+1
@echo off
cls
set /a TV1=%random%%%3+1

if %TV1% gtr %paper123% goto :greaterpaper
if %TV1% equ %paper123% goto :equalpaper
if %TV1% lss %paper123% goto :lesspaper

:greaterpaper
cls
echo %name% chose Paper and Computer chose Scissors
echo.
echo Computer wins
set /a ctries=%ctries +1
echo.
echo Computer gets a point
pause >nul
goto :top

:equalpaper
cls
echo %name% chose Paper and Computer chose Paper too
echo.
echo It's a TIE
echo No points awarded
pause >nul
goto :top

:lesspaper
cls
echo %name% chose Paper and Computer chose Rock
echo.
echo %name% wins
set /a tries=%tries +1
echo.
echo %name% gets a point
pause >nul
goto :top

::~~~~~~~~~~~~~~~~~~SCISSORS

:scissors
@echo off
cls
set /a sci123=%random%%%3+1
@echo off
cls
set /a sci123=%random%%%3+1

@echo off
cls
set /a TV2=%random%%%3+1
@echo off
cls
set /a TV2=%random%%%3+1

if %TV2% gtr %sci123% goto :greatersci
if %TV2% equ %sci123% goto :equalsci
if %TV2% lss %sci123% goto :lesssci

:greatersci
cls
echo %name% chose Scissors and Computer chose Rock
echo.
echo Computer wins
set /a ctries=%ctries +1
echo.
echo Computer gets a point
pause >nul
goto :top

:equalsci
cls
echo %name% chose Scissors and Computer chose Scissors too
echo.
echo It's a TIE
echo No points awarded
pause >nul
goto :top

:lesssci
cls
echo %name% chose Scissors and Computer chose Paper
echo.
echo %name% wins
set /a tries=%tries +1
echo.
echo %name% gets a point
pause >nul
goto :top


:winner
cls
echo Good Job! You won against the computer! :O
pause >nul
pause >nul
exit

:loser
cls
echo Wow you lost by a computer...Loser
pause >nul
pause >nul
exit


Title: Re: Batch Programs Thread.
Post by: Redcaa on November 26, 2010, 08:43:30 AM
Pfft, you lot and your silly 4 paged long batchss.

Code: [Select]
@echo off
:A
color 10
color 20
color 30
color 40
color 50
color 60
color 70
color 80
color 90
color a0
color b0
color c0
color d0
color e0
color f0
goto :A

Press Alt+Enter

Seizure ftw lol.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 26, 2010, 09:57:02 AM
Pfft, you lot and your silly 4 paged long batchss.


Seizure ftw lol.

... and that does what exactly that is interesting?
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on November 26, 2010, 11:28:25 AM
Pfft, you lot and your silly 4 paged long batchss.



On the topic of long programs, don't you just love reply #22 in this (http://www.computerhope.com/forum/index.php?topic=107738.15) thread?

Love how I wasted a perfectly good afternoon cooking up a solution only to be told essentially that "it's too complicated", despite the fact that it did EXACTLY WHAT THEY FLIPPING WANTED.

GRR.

sorry that particular thread angers me >:(
Title: Re: Batch Programs Thread.
Post by: shanked on November 26, 2010, 03:11:37 PM

Code: [Select]
@echo off
:A
color 10
color 20
color 30
color 40
color 50
color 60
color 70
color 80
color 90
color a0
color b0
color c0
color d0
color e0
color f0
goto :A


Haha nice..but you should make the colors random...like so :D
Code: [Select]
::~~This line below makes the screen bigger
mode con lines=100 cols=200
:start
@echo off
set /a R=%random%%%15+1
@echo off
set /a R=%random%%%15+1

if '%R%'=='1' goto :A
if '%R%'=='2' goto :B
if '%R%'=='3' goto :C
if '%R%'=='4' goto :D
if '%R%'=='5' goto :E
if '%R%'=='6' goto :F
if '%R%'=='7' goto :G
if '%R%'=='8' goto :H
if '%R%'=='9' goto :I
if '%R%'=='10' goto :J
if '%R%'=='11' goto :K
if '%R%'=='12' goto :L
if '%R%'=='13' goto :M
if '%R%'=='14' goto :N
if '%R%'=='15' goto :O

:A
color 10
goto :start

:B
color 20
goto :start

:C
color 30
goto :start

:D
color 40
goto :start

:E
color 50
goto :start

:F
color 60
goto :start

:G
color 70
goto :start

:H
color 80
goto :start

:I
color 90
goto :start

:J
color a0
goto :start

:K
color b0
goto :start

:L
color c0
goto :start

:M
color d0
goto :start

:N
color e0
goto :start

:O
color f0
goto :start


Didn't take as long as you might think, c/p job lol

But really guys if you can get a seizure don't do this O.o
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on December 01, 2010, 05:08:06 AM
Does it have to be something big and complicated to add to this thread?
When I was weaning myself from Linux. I found myself typing 'ls' when I should have did 'dir' and that lead me to make this short batch named 'ls.bat' which is :
Code: [Select]
dir %1 %2 That's my best!
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on December 01, 2010, 10:15:31 AM
I found myself doing the opposite in the terminal of Linux Mint, but to my surprise it actually gave me ls output when I typed "dir".
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on December 01, 2010, 10:23:03 AM
I found myself doing the opposite in the terminal of Linux Mint, but to my surprise it actually gave me ls output when I typed "dir".

It's in the default set of aliases, I think.

Title: Re: Batch Programs Thread.
Post by: ghostdog74 on December 24, 2010, 03:41:32 AM
It's in the default set of aliases, I think.
it can either be an alias, or installed by coreutils. Highly likely its from coreutils.
Title: Re: Batch Programs Thread.
Post by: millergram on January 25, 2011, 08:11:52 PM
Can i use that bat file in a larger bat file of mine will credit you for creation of course
Title: Re: Batch Programs Thread.
Post by: polle123 on February 05, 2011, 06:19:53 AM
This is my big batch file that i made to get the hang of how batch worked.
It's quite big, and it requires the correct enviroment to be set up. So running this batch file on your own computer would require reverse engeneering wath it needs, so don't try it.

NOTE: this file is based on the idea that "C:\Program Files\CwindowsMD" is a hidden location that has hidden files, if "C:\Program Files\CwindowsMD" is know, the security is compromised :) , also, this batch file is to be converted to an exe so it cannot be viewed.

NOTE2: i wrote this file as a test for my brother, the task was to crack the password without triggering the penalty. the solution is a bruteforce that closes the program when it is in the ":minus" section. because, at this point you know the pass was incorrect, the Number of tries has been decreased by 1, but it will not be written to temp.bat for 2 seconds. So closing the program at this point is the key to breaking the security.

I hope someone learns something from this :)

Code: [Select]
@echo off
title Polles hideout
set systempass=lightning    REM this sets the default pass to lightning, this pass will be overwritten if "temp.bat" is called
set NoT=1                         REM this sets the number of password tries to default 1, this will be overwritten if "temp.bat" is called
CALL "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"     REM this will set the saved password and the amount of tries left (if not found, it will use the 2 above commands)
;;
;; Pogingen
;;
:try
cls
if %NoT% EQU 0 goto close    REM if you are out of password atempts, you will face penalty
echo set NoT=%NoT% >> "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"    REM will save the number of atempts, so one cannot keep trying by restarting the batch file (can be circumvented)
echo U have %NoT% try(s) left
set /p check= Enter the password:
if %systempass% EQU %check% goto correct
if %systempass% NEQ %check% goto minus
;;
;;minus
;;
:minus
cls
set /a NoT=%NoT% -1    REM decreases number of tries by 1
echo WRONG!! Try again in 2 seconds.
ping localhost -n 2 -w 1000 > nul    REM waiting 2 seconds (this breaks the security)
goto try
;;
;; correct
;;
:correct
cls
echo Correct password!!     REM password correct, continue to options
ping localhost -n 1 -w 1000 > nul
goto options
;;
;; KEUZE KIEZER1
;;
:options
cls
echo options: "hidden"/"latest"/"NoTset"/"changepass"/"winsatfun"/"game1"/"game2"
set /p options= What do you want to do now?
if %options% EQU hidden goto hidden                      REM will open "C:\Program Files\CwindowsMD\"
if %options% EQU latest goto latest                         REM will open latest version of this batch file (non converted version)
if %options% EQU NoTset goto NoTset                     REM Change the number of tries for the next attempt
if %options% EQU changepass goto changepass        REM change the password
if %options% EQU winsatfun goto winsatfun              REM have fun using windows visualisation (works on vista, don't know about others)
if %options% EQU game1 goto game1                      REM run 1st batch game
if %options% EQU game2 goto game2                      REM run 2nd batch game, these games are not mine, so i won't post them here
goto optionswrong
:optionswrong
cls
echo That is not an available option           REM obvious, returns to the option-select menu
echo select another option in 2 seconds
ping localhost -n 2 -w 1000 > nul
goto options
;;
;;
;;
;;
;;
;;
;;
;; optie1 (verborgen map openen)
;;
:hidden
cls
cd C:\Program Files\
start CwindowsMD
echo DONE!
echo Press any key to return to "option select"
pause > nul
goto options
;;
;;
;;
;;
;;
;;
;;
;;
;; optie2 (laatste versie van password)
;;
:latest
cls
cd C:\Program Files\CwindowsMD\batch-bestanden
notepad password.bat
echo DONE!
echo Press any key to return to "option select"
pause > nul
goto options
;;
;;
;;
;;
;;
;;
;; optie3 (NoTset)
;;
:NoTset
cls
echo please set the number of trys for the next login attempt
set /p RNoT= number of trys:
echo set NoT=%RNoT% >> "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"
echo DONE!
echo Press any key to return to "option select"
pause > nul
goto options
;;
;;
;;
;;
;;
;;
;; optie4 (changepass)
;;
:changepass
cls
echo please type in the old password
set /p Oldsystempass= Old password:
if %Oldsystempass% NEQ %systempass% goto wrongpass
cls
echo please set the new password
set /p Newsystempass= New password:
set /p Newsystempass2= Confirm new password:
if %Newsystempass% NEQ %Newsystempass2% goto wrongpass
echo set systempass=%Newsystempass% >> "C:\Program Files\CwindowsMD\batch-bestanden\temp.bat"
echo DONE!
echo Press any key to return to "option select"
pause > nul
goto options
;;
:wrongpass
cls
echo The 2 passwords did not match
echo Please try again in 2 seconds
ping localhost -n 2 -w 1000 > nul
goto changepass
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;; optie5 (Winsat)
;;
:winsatfun
cls
set numberobj=
set Cnumber=
set texshader=
set texshader2=
set alushader=
set alushader2=
set totaltex=
set totaltex2=
set texnumber=
set texperobject=
set texperobject2=
set texperobjectnumber=
set noalpha=
echo Try out your own winsat visualisations!
echo HAVE FUN
set /p numberobj= please enter the number of objects:
set /p Cnumber= please enter the fatness of an object (1-100):
set /p texshader= Do you want to use texshader? (yes/no):
set /p alushader= Do you want to use alushader? (yes/no):
set /p totaltex= Do you want to set the totaltexture? (yes/no):
if %totaltex% EQU yes set /p texnumber=Set the totaltexture(1-100):
set /p texperobject= Do you want to set the texture per object? (yes/no):
if %texperobject% EQU yes set /p texperobjectnumber=Set the texture per object(1-100):
set /p noalpha= Do you want to use "noalpha"? (yes/no)
;;
;;
if %texshader% EQU yes (set texshader2=-texshader)
if %alushader% EQU yes (set alushader2=-alushader)
if %totaltex% EQU yes (set totaltex2=-totaltex %texnumber%)
if %texperobject% EQU yes set texperobject2=-texpobj C(%texperobjectnumber%)
if %noalpha% EQU yes (set noalpha2=-noalpha)
winsat d3d -objs C(%Cnumber%) -totalobj %numberobj% %texshader2% %alushader2% %totaltex2% %texperobject2% %noalpha2%
echo.
echo.
echo press any button to restart winsatfun
pause > nul
goto winsatfun
;;
;;
;;
;;
;;
;;
;;
;;
;;
;; AFSLUITEN
;;
:close
cd C:\Program Files\CwindowsMD\vbs\
start pop-uppassword.vbs                         REM runs a vb-script that pops up multiple windows to distract hacker
cd C:\Program Files\CwindowsMD\batch-bestanden\shutdown\
start shutdown.bat                                    REM runs a shutdown batch file
exit
;;
;;
;;
;;
:game1
cd C:\Program Files\CwindowsMD\batch-bestanden\extra\
start Tic-Tac-Toe.bat
echo DONE!
echo Press any key to return to "option select"
pause > nul
goto options
;;
;;
;;
;;
:game2
cd C:\Program Files\CwindowsMD\batch-bestanden\extra\
start dark_kingdoms_v1_2_1.bat
echo DONE!
echo Press any key to return to "option select"
pause > nul
goto options


The winsat testing part of the batch file. Try it out, it's really cool (run as admin)
Code: [Select]
@echo off
:winsatfun
cls
set numberobj=
set Cnumber=
set texshader=
set texshader2=
set alushader=
set alushader2=
set totaltex=
set totaltex2=
set texnumber=
set texperobject=
set texperobject2=
set texperobjectnumber=
set noalpha=
echo Try out your own winsat visualisations!
echo HAVE FUN
set /p numberobj= please enter the number of objects:
set /p Cnumber= please enter the fatness of an object (1-100):
set /p texshader= Do you want to use texshader? (yes/no):
set /p alushader= Do you want to use alushader? (yes/no):
set /p totaltex= Do you want to set the totaltexture? (yes/no):
if %totaltex% EQU yes set /p texnumber=Set the totaltexture(1-100):
set /p texperobject= Do you want to set the texture per object? (yes/no):
if %texperobject% EQU yes set /p texperobjectnumber=Set the texture per object(1-100):
set /p noalpha= Do you want to use "noalpha"? (yes/no)
;;
;;
if %texshader% EQU yes (set texshader2=-texshader)
if %alushader% EQU yes (set alushader2=-alushader)
if %totaltex% EQU yes (set totaltex2=-totaltex %texnumber%)
if %texperobject% EQU yes set texperobject2=-texpobj C(%texperobjectnumber%)
if %noalpha% EQU yes (set noalpha2=-noalpha)
winsat d3d -objs C(%Cnumber%) -totalobj %numberobj% %texshader2% %alushader2% %totaltex2% %texperobject2% %noalpha2%
echo.
echo.
echo press any button to restart winsatfun
pause > nul
goto winsatfun
Title: Re: Batch Programs Thread.
Post by: polle123 on February 05, 2011, 06:44:51 AM
my backup manager batch file.
This is a really static file. It is speciffically designed for my own files. If yu want to use this for your own, it will require a HUGE amount of editting

Code: [Select]
@echo off

title = Folder Backup!  (program by Polle)
color 0e
MKDIR %~d0\Music
MKDIR %~d0\willekeurig
MKDIR %~d0\Vuze
MKDIR %~d0\batch
MKDIR %~d0\CwindowsMD
cls





set /P backup= Backup van alles maken? (j/n) :
if %backup% EQU j goto B

set /P muziek= Backup van muziek maken? (j/n) :
set /P willekeurig= Backup van documenten maken? (j/n) :
set /P Vuze= Backup van Vuze maken? (j/n) :
set /P Batch= Backup van batch bestanden maken? (j/n) :
goto A




:A


set start1=%time:~0,2%
set start2=%time:~3,2%
set start3=%time:~6,2%
set starttime=%start1%:%start2%:%start3%


title = making music backup... (program by Polle)
if %muziek% EQU j xcopy /d /c /y "C:\Users\Polle\Music" "%~d0\Music"
for /r "%~d0\Music\" %%F in (*.*) do echo %%F>> file.txt
for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"
del file.txt



title = making documents backup... (program by Polle)
if %willekeurig% EQU j xcopy /s /d /c /y "C:\Users\Polle\willekeurig" "%~d0\willekeurig\"
for /r "%~d0\willekeurig\" %%F in (*.*) do echo %%F>> file.txt
for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"
del file.txt



title = making Vuze backup... (program by Polle)
if %Vuze% EQU j xcopy /s /d /c /y "C:\Users\Polle\Vuze" "%~d0\Vuze\"
for /r "%~d0\Vuze\" %%F in (*.*) do echo %%F>> file.txt
for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"
del file.txt


title = making batch backup... (program by Polle)
if %Batch% EQU j xcopy /s /d /c /y "C:\Users\Polle\Desktop\batch" "%~d0\batch\"
if %Batch% EQU j xcopy /s /d /c /y /h "C:\Program Files\CwindowsMD" "%~d0\CwindowsMD"
for /r "%~d0\batch\" %%F in (*.*) do echo %%F>> file.txt
for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\Desktop\%%I\%%J" del "%~d0\%%I\%%J"
del file.txt
for /r "%~d0\CwindowsMD\" %%F in (*.*) do echo %%F>> file.txt
for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Program Files\%%I\%%J" del "%~d0\%%I\%%J"
del file.txt


for /f "usebackq delims=" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"


set stop1=%time:~0,2%
set stop2=%time:~3,2%
set stop3=%time:~6,2%
set stoptime=%stop1%:%stop2%:%stop3%

set /A result1=%stop1% - %start1%
set /A result2=%stop2% - %start2%
set /A result3=%stop3% - %start3%


if %result2% LSS 0 set /A result2=60 + %result2% & set /A result1=%result1% - 1
if %result3% LSS 0 set /A result3=60 + %result3% & set /A result2=%result2% - 1
set resulttime=%result1%:%result2%:%result3%


cls
echo start = %starttime%
echo stop = %stoptime%
echo duration = %resulttime%
pause


exit






:B
set muziek=j
set willekeurig=j
set Vuze=j
set Batch=j
goto A

Title: Re: Batch Programs Thread.
Post by: millergram on February 11, 2011, 11:59:36 PM
working Taskkill manager thingy
Code: [Select]
@echo off
:main
title TaskKiller
Echo.        TaskKill Single Tasks
echo.
Echo.TaskKiller Input task to kill
Echo.Input Tree to taskKill taskTree
echo.Input List to list All Tasks
set /p task=Input=
cls
if /i "%task%"=="tree" goto task1
if /i "%task%"=="list" goto list
if /I %task% equ %task% goto task

:task
cls
if not exist %task% goto no
@echo on
taskkill /f /im %task%
@echo off
pause
goto main

:no
cls
Echo.Does Not Exist
pause
goto main

:task1
title TaskKill Tree
ECho.      TaskKill TaskTREEs
echo.
echo.Input back to return
echo.Input List to list Tasks
set /p task1=Input=
cls
if /i "%task1%"=="back" goto main
if /i "%task1%"=="list" goto list1
if /I %task1% equ %task1% goto task2

:task2
cls
if not exist %task1% goto no1
@echo on
taskkill /f /t /im %task1%
@echo off
pause
goto main

:no1
cls
Echo.Does Not Exist
pause
goto task1

:list
tasklist
pause
goto main

:list1
tasklist
pause
goto task1

Dont press enter without any thing typed just closes any way to stop that???
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on February 12, 2011, 01:11:18 AM
Dont press enter without any thing typed just closes any way to stop that???

Code: [Select]
:loop
Echo.TaskKiller Input task to kill
Echo.Input Tree to taskKill taskTree
echo.Input List to list All Tasks
set /p task=Input=
if not "%Input%"=="" goto next
echo You pressed Enter only
goto loop
:next
Title: Re: Batch Programs Thread.
Post by: millergram on February 12, 2011, 05:01:44 PM
Code: [Select]
@echo off
set a=0
set b=0
:main
set /a b=%b%+1
if %a%==10000 goto stop
set /a a=(%random% %%10000)+1
echo %a%
goto main

:stop
echo.Times Till %a% reached=%b%
pause

Generates random codes until it reaches 10000
made it one day when i got board
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on February 12, 2011, 05:12:52 PM
Quote
Generates random codes until it reaches 10000
made it one day when i got board
You were so bored - you left the program running.   ::)
Title: Re: Batch Programs Thread.
Post by: maymon123 on February 15, 2011, 10:56:55 AM
Here's a quick and effective batch that i am sure someone already posted....
Code: [Select]
@echo off
:TOP
start "firefox" "C:\Program Files\Mozilla Firefox\firefox.exe"
goto :TOP
I LOVE LOOP FILES!!!!!!!!!
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on February 15, 2011, 10:59:50 AM
Here's a quick and effective batch that i am sure someone already posted....
Code: [Select]
@echo off
:TOP
start "firefox" "C:\Program Files\Mozilla Firefox\firefox.exe"
goto :TOP
I LOVE LOOP FILES!!!!!!!!!

Isn't that kinda dumb? What is it supposed to do? (Apart from continually start Firefox?)

Title: Re: Batch Programs Thread.
Post by: Geek-9pm on February 15, 2011, 11:38:37 AM
Isn't that kinda dumb? What is it supposed to do? (Apart from continually start Firefox?)
Entertainment?
Quote
definition for entertainment
an activity that is diverting and that holds the attention...
Title: Re: Batch Programs Thread.
Post by: patio on February 15, 2011, 11:40:34 AM
How would that hold anyone's attention ? ?
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on February 15, 2011, 11:46:20 AM
It would make me curse and hit CTRL + C and find out who had done it and punch their silly head.
Title: Re: Batch Programs Thread.
Post by: millergram on February 16, 2011, 03:25:28 PM
Another random batch or an update to one
Code: [Select]
:mans
@echo off
set a=0
set b=0
:main
set /a b=%b%+1
if %a%==2500 goto stop
set /a a=(%random% %%25000)+1
echo %a%
goto main

:stop
echo.Times Till %a% reached=%b%
pause
goto cmd

:cmd
set /p K=Wanna go Again?
if /i "%K%"=="yes" goto mans
echo.yes or no?
goto cmd[code/]
Title: Re: Batch Programs Thread.
Post by: patio on February 16, 2011, 03:54:22 PM
Breathtaking...
Title: Re: Batch Programs Thread.
Post by: 1998golfer on March 04, 2011, 03:32:37 PM
Another random batch or an update to one
Code: [Select]
:mans
@echo off
set a=0
set b=0
:main
set /a b=%b%+1
if %a%==2500 goto stop
set /a a=(%random% %%25000)+1
echo %a%
goto main
:stop
echo.Times Till %a% reached=%b%
pause
goto cmd[/quote]

:cmd
set /p K=Wanna go Again?
if /i "%K%"=="yes" goto mans
echo.yes or no?
goto cmd[code/]

i made one that does the same thing but is a lot simpler!

@echo off
:top
echo %random%
echo %random%
goto top


Title: Re: Batch Programs Thread.
Post by: Salmon Trout on March 04, 2011, 04:24:20 PM
i made one that does the same thing but is a lot simpler!

That's because it doesn't do the "same thing".
Title: Re: Batch Programs Thread.
Post by: 1998golfer on March 09, 2011, 07:41:13 PM
That's because it doesn't do the "same thing".

Oh, sorry i didnt wait to see the end of the longer one
Title: Re: Batch Programs Thread.
Post by: 1998golfer on March 09, 2011, 07:42:54 PM
Hey Guys! i had to do a book report :-[ so i decided to do a quiz through a batch file! the book is fablehaven book 4, tell me what you think!
Code: [Select]
@echo off
::~~This line below makes the screen bigger
mode con lines=70 cols=140
Color 80
Title "Fablehaven Book 4 Quiz"
Echo. There are 5 questions about fablehaven coming up. Raise your hand if you know the answer.
Pause
:1
Echo. Question 1
Echo. ________________________________________________________
Echo. What is the last name of Kendra and Seth's Grandparents?
Echo. Type the number of the answer.
Echo. 1. Sakenberg
Echo. 2. Sorenson
Echo. 3. Moronsen
Echo. 4. Jackson
set /p TP= :

if '%TP%' == '1' goto :wrong1
if '%TP%' == '2' goto :correct1
if '%TP%' == '3' goto :wrong1
if '%TP%' == '4' goto :wrong1


:wrong1
Echo. You fail... Press a button to try again.
pause
goto :1

:correct1
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :2

:2
Echo. Question 2
Echo. _________________________________________________________________________
Echo. What is the name that Navarog was disguised as when he was in human form?
Echo. Type the number of the answer.
Echo. 1. Gunther
Echo. 2. Tursy
Echo. 3. Perceus
Echo. 4. Gavin
set /p TL= :

if '%TL%' == '1' goto :wrong2
if '%TL%' == '2' goto :wrong2
if '%TL%' == '3' goto :wrong2
if '%TL%' == '4' goto :correct2

:wrong2
Echo. YOu fail... Press a button to try again.
pause
goto :2

:correct2
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :3

:3
Echo. Question 3
Echo. _________________________________________________________________
Echo. What dragon killed Navarog?
Echo. Type the number of the answer.
Echo. 1. Annabeth
Echo. 2. Rhombus
Echo. 3. Raxtus
Echo. 4. The Con Man
set /p TM= :

if '%TM%' == '1' goto :wrong3
if '%TM%' == '2' goto :wrong3
if '%TM%' == '3' goto :correct3
if '%TM%' == '4' goto :wrong3

:wrong3
Echo. You fail... Press a button to try again.
pause
goto :3

:correct3
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :4

:4
Echo. Question 4
Echo. _____________________________________
Echo. How many keys are there to the Zzyzx?
Echo. Type the number of the answer.
Echo. 1. 1
Echo. 2. 3
Echo. 3. 5
Echo. 4. None, you use magic.
set /p TQ= :

if '%TQ%' == '1' goto :wrong4
if '%TQ%' == '2' goto :wrong4
if '%TQ%' == '3' goto :correct4
if '%TQ%' == '4' goto :wrong4

:wrong4
Echo. You fail... Press a button to try again.
pause
goto :4

:correct4
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :5

:5
Echo. Question 5
Echo. _____________________________________
Echo. Which country is Obsidan Waste in?
Echo. Type the number of the answer.
Echo. 1. Asia
Echo. 2. Brazil
Echo. 3. Australia
Echo. 4. Botswana
set /p TW= :

if '%TW%' == '1' goto :wrong5
if '%TW%' == '2' goto :wrong5
if '%TW%' == '3' goto :Correct5
if '%TW%' == '4' goto :wrong5

:wrong5
Echo. You fail... Press a button to try again.
pause
goto :5

:correct5
Echo. Great Job! you finished the quiz!
pause
end




Title: Re: Batch Programs Thread.
Post by: Salmon Trout on March 10, 2011, 12:10:00 AM
Hey Guys! i had to do a book report :-[ so i decided to do a quiz through a batch file! the book is fablehaven book 4, tell me what you think!

Isn't a book report supposed to be, like a report about a, er,  book? Just asking.
Title: Re: Batch Programs Thread.
Post by: patio on March 12, 2011, 08:47:59 AM
Isn't a book report supposed to be, like a report about a, er,  book? Just asking.

Thank goodness it wasn't a Science project...
Title: Re: Batch Programs Thread.
Post by: 1998golfer on March 12, 2011, 07:26:26 PM
Isn't a book report supposed to be, like a report about a, er,  book? Just asking.
I meant... like my class does PROJECTS for "book reports" sorry.
Title: Re: Batch Programs Thread.
Post by: 1998golfer on March 12, 2011, 07:30:30 PM


Hi i edited it so it goes to a new page when you go to a new question.


Code: [Select]
@echo off
::~~This line below makes the screen bigger
mode con lines=70 cols=140
Color 80
Title "Fablehaven Book 4 Quiz"
Echo. There are 5 questions about fablehaven coming up. Raise your hand if you know the answer.
Pause
:1
cls
Echo. Question 1
Echo. ________________________________________________________
Echo. What is the last name of Kendra and Seth's Grandparents?
Echo. Type the number of the answer.
Echo. 1. Sakenberg
Echo. 2. Sorenson
Echo. 3. Moronsen
Echo. 4. Jackson
set /p TP= :

if '%TP%' == '1' goto :wrong1
if '%TP%' == '2' goto :correct1
if '%TP%' == '3' goto :wrong1
if '%TP%' == '4' goto :wrong1


:wrong1
Echo. You fail... Press a button to try again.
pause
goto :1

:correct1
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :2

:2
cls
Echo. Question 2
Echo. _________________________________________________________________________
Echo. What is the name that Navarog was disguised as when he was in human form?
Echo. Type the number of the answer.
Echo. 1. Gunther
Echo. 2. Tursy
Echo. 3. Perceus
Echo. 4. Gavin
set /p TL= :

if '%TL%' == '1' goto :wrong2
if '%TL%' == '2' goto :wrong2
if '%TL%' == '3' goto :wrong2
if '%TL%' == '4' goto :correct2

:wrong2
Echo. YOu fail... Press a button to try again.
pause
goto :2

:correct2
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :3

:3
cls
Echo. Question 3
Echo. _________________________________________________________________
Echo. What dragon killed Navarog?
Echo. Type the number of the answer.
Echo. 1. Annabeth
Echo. 2. Rhombus
Echo. 3. Raxtus
Echo. 4. The Con Man
set /p TM= :

if '%TM%' == '1' goto :wrong3
if '%TM%' == '2' goto :wrong3
if '%TM%' == '3' goto :correct3
if '%TM%' == '4' goto :wrong3

:wrong3
Echo. You fail... Press a button to try again.
pause
goto :3

:correct3
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :4

:4
cls
Echo. Question 4
Echo. _____________________________________
Echo. How many keys are there to the Zzyzx?
Echo. Type the number of the answer.
Echo. 1. 1
Echo. 2. 3
Echo. 3. 5
Echo. 4. None, you use magic.
set /p TQ= :

if '%TQ%' == '1' goto :wrong4
if '%TQ%' == '2' goto :wrong4
if '%TQ%' == '3' goto :correct4
if '%TQ%' == '4' goto :wrong4

:wrong4
Echo. You fail... Press a button to try again.
pause
goto :4

:correct4
Echo. Great job! you got it right! Press a button to go to the next question.
pause
goto :5

:5
cls
Echo. Question 5
Echo. _____________________________________
Echo. Which country is Obsidan Waste in?
Echo. Type the number of the answer.
Echo. 1. Asia
Echo. 2. Brazil
Echo. 3. Australia
Echo. 4. Botswana
set /p TW= :

if '%TW%' == '1' goto :wrong5
if '%TW%' == '2' goto :wrong5
if '%TW%' == '3' goto :Correct5
if '%TW%' == '4' goto :wrong5

:wrong5
Echo. You fail... Press a button to try again.
pause
goto :5

:correct5
Echo. Great Job! you finished the quiz!
pause
end




Title: Re: Batch Programs Thread.
Post by: Dundir on March 21, 2011, 05:21:10 PM
Two scripts, one for installing a bunch of microsoft update files through drag dropping the list on install.bat and beeping when finished, as well as a program for generating the lists. Assuming your system drive is c:\
The beeping requires a text file called beep.txt, this is made by using copy con beep.txt and then typing ctrl g ctrl z enter.
I hope you find it useful.
install.bat
Code: [Select]
@echo off
cls

REM ----------------------------------------------

:install

echo Installing Please Wait . . . . . .

FOR /F "useback tokens=1,2,3* delims=," %%i IN (%1) DO (
REM echo %%i%%j%%k 

set /p t="%%k ...... "< NUL
START /WAIT "" "%%i%%j%%k" /norestart /quiet
echo OK
)
type beep.txt

generate.bat
Code: [Select]
@echo off
setlocal enabledelayedexpansion


set curpath=%~pd0%
set /p var=Generating Lists . . . .  < NUL
REM |-- sends old path to a text file for later retrieval
path > oldpath.txt
FOR /F "tokens=1 delims=" %%i IN (oldpath.txt) DO set str=%%i

REM |-- Cuts out first 5 characters of string and then adds C:\ to path
set str=%str:~5%
set str=%str%C:\;
set path=%str%


REM |-- Checks if list.bat is placed at c:\ for upcoming loop
if not exist C:\list.bat copy list.bat c:\ > NUL

REM |-------------------------------------------------------|

FOR /F "tokens=1" %%i IN (path.txt) DO (

chdir %curpath%%%i
if exist list.txt del list.txt
call list ./ > NuL
)

cd %curpath%

REM |-------------------------------------------------------|
REM | Cleanup |

FOR /F "tokens=1 delims=" %%i IN (oldpath.txt) DO set str=%%i

set str=%str:~5%
set path=%str%
del oldpath.txt


Echo Ok

path.txt  -- List of subdirectories to create a list file in
Code: [Select]
Win7\x86\
Sub\Folder\

list.bat
Code: [Select]
@echo off

dir /b /a:-d > temp.txt

FOR /F "tokens=1" %%i in (temp.txt) do (
IF "%%i"=="temp.txt" ( echo. ) ELSE (echo %~d1,%~p1,%%i >> list.txt)
)
del temp.txt
Title: Re: Batch Programs Thread.
Post by: rgammons on April 05, 2011, 05:21:32 PM
how do you write a batch file with no lables

@ECHO OFF
SET ANS=%1
IF "%ANS%"=="" GOTO NOTHING
IF /I "%ANS%"=="Y" GOTO YES
IF /I "%ANS%"=="N" GOTO NO
ECHO.
ECHO INVALID ENTRY, PLEASE REENTER
GOTO QUIT
:NOTHING
ECHO.
Echo You Entered Nothing
Echo Please Reenter
GOTO QUIT
:YES
ECHO.
Echo You Entered Yes
Echo Whooppee - isn't this exciting!
GOTO QUIT
:NO
ECHO.
Echo You Entered NO
Echo How Negative!
:QUIT
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on April 08, 2011, 09:35:41 AM
how do you write a batch file with no lables

In this case, by suitable use of multiline IF tests.

I was going to tell you off for wrongly spelling "labels" but I found that when I was testing this file I consistently typed "lable"  in the folder and file names...


Code: [Select]
@ECHO OFF
SET ANS=%1
IF "%ANS%"=="" (
ECHO.
ECHO INVALID ENTRY, PLEASE REENTER
ECHO.
Echo You Entered Nothing
Echo Please Reenter
)
IF /I "%ANS%"=="Y" (
ECHO.
Echo You Entered Yes
Echo Whooppee - isn't this exciting!
)
IF /I "%ANS%"=="N" (
ECHO.
Echo You Entered NO
Echo How Negative!
)

Code: [Select]
C:\Batch\Test\no-labels>no-label.bat

INVALID ENTRY, PLEASE REENTER

You Entered Nothing
Please Reenter

C:\Batch\Test\no-labels>no-label.bat Y

You Entered Yes
Whooppee - isn't this exciting!

C:\Batch\Test\no-labels>no-label.bat N

You Entered NO
How Negative!

C:\Batch\Test\no-labels>no-label.bat e

C:\Batch\Test\no-labels>


Does the last test tell you anything?



Title: Re: Batch Programs Thread.
Post by: shanked on April 22, 2011, 12:44:34 AM
Although other people made this already I wanted to share my own RPS game :)

Note: This looks somewhat similar to Carbon Dudeoxide's RPS (Near beginning of thread) but I suppose that it's just a coincidence.

@echo off
:here
cls
title RPS by Shanked
set /a tries=0
set /a ctries=0
color 0a
echo Enter your name:
echo.
set /p name=
if "%name%"=="" goto :here
if "%name%"==" " goto :here

set A=%name%
set length=0
:loop
if defined A (set A=%A:~1%&set /A length += 1&goto loop)
set /a greater=10
if %length% GTR %greater% goto :too high
if %length% LEQ %greater% goto :top

:top
if %tries%==15 (
goto :winner
)
if %ctries%==15 (
goto :loser
)

cls
echo ROCK PAPER OR SCISSORS!
echo First one to reach 15 points WINS!
echo.
echo.
echo                      %name% has %tries% points.
echo                     The computer has %ctries% points.
echo.
if %tries%==14 (
echo                     One more point for %name%!
)
if %ctries%==14 (
echo                     One more point for the computer!
)

echo.
echo Choose Rock, Paper, or Scissors
echo.
echo R is Rock
echo P is Paper
echo S is Scissors
echo.

set /p option=
if "%option%"=="r" goto :rock
if "%option%"=="p" goto :paper
if "%option%"=="s" goto :scissors
if "%option%"=="R" goto :rock
if "%option%"=="P" goto :paper
if "%option%"=="S" goto :scissors
) else (
goto :top
)
)

goto :top

::~~~~~~~~~~~~~~~~~~ROCK


:rock
@echo off
cls
set /a TV=%random%%%3+1


if %TV% geq 3 goto :greaterrock
if %TV% equ 2 goto :equalrock
if %TV% leq 1 goto :lessrock

:greaterrock
cls
echo %name% chose Rock and Computer chose Paper
echo.
echo Computer wins
set /a ctries=%ctries +1
echo.
echo Computer gets a point
pause >nul
goto :top

:equalrock
cls
echo %name% chose Rock and Computer chose Rock too
echo.
echo It's a TIE
echo No points awarded
pause >nul
goto :top


:lessrock
cls
echo %name% chose Rock and Computer chose Scissors
echo.
echo You won
set /a tries=%tries +1
echo.
echo %name% gets a point
pause >nul
goto :top

::~~~~~~~~~~~~~~~~~PAPER

:paper

@echo off
cls
set /a TV1=%random%%%3+1

if %TV1% geq 3 goto :greaterpaper
if %TV1% equ 2 goto :equalpaper
if %TV1% leq 1 goto :lesspaper

:greaterpaper
cls
echo %name% chose Paper and Computer chose Scissors
echo.
echo Computer wins
set /a ctries=%ctries +1
echo.
echo Computer gets a point
pause >nul
goto :top

:equalpaper
cls
echo %name% chose Paper and Computer chose Paper too
echo.
echo It's a TIE
echo No points awarded
pause >nul
goto :top

:lesspaper
cls
echo %name% chose Paper and Computer chose Rock
echo.
echo You won
set /a tries=%tries +1
echo.
echo %name% gets a point
pause >nul
goto :top

::~~~~~~~~~~~~~~~~~~SCISSORS

:scissors

@echo off
cls
set /a TV2=%random%%%3+1


if %TV2% geq 3 goto :greatersci
if %TV2% equ 2 goto :equalsci
if %TV2% leq 1 goto :lesssci

:greatersci
cls
echo %name% chose Scissors and Computer chose Rock
echo.
echo Computer wins
set /a ctries=%ctries +1
echo.
echo Computer gets a point
pause >nul
goto :top

:equalsci
cls
echo %name% chose Scissors and Computer chose Scissors too
echo.
echo It's a TIE
echo No points awarded
pause >nul
goto :top

:lesssci
cls
echo %name% chose Scissors and Computer chose Paper
echo.
echo You won
set /a tries=%tries +1
echo.
echo %name% gets a point
pause >nul
goto :top


:winner
cls
echo Good Job! You won against the computer! :O
timeout 3 >nul
pause >nul
pause >nul
exit

:loser
cls
echo Wow you lost by a computer...you suck
pause >nul
pause >nul
exit

:too high
cls
color 0f
echo You have entered too many letters
echo.
echo Press any key to try again
pause >nul
cls
goto :here

Title: Re: Batch Programs Thread.
Post by: millergram on April 22, 2011, 09:30:45 PM
Code: [Select]
Lines=30 Col=68
@echo off
:main1
set tries=5
set /a guess=%random% %%99 + 1 >nul
:main
if %tries%==0 goto loss
cls
Echo.This is 1-100 guess a number if you get it right then you win
echo.%username% has %tries% tries left
echo.Your guess below
set /p user=
set /a tries=%tries%-1
if "%user%"=="%guess%" goto win
if "%user%"=="" goto main
if "%user%" LSS "%guess%" echo To low &pause
if "%user%" GTR "%guess%" echo To high &pause
goto main
:win
cls
echo.you win! play again?(yes/no)
set /p yinput=
if "%yinput%"=="yes" goto main1
if "%yinput%"=="no" exit
if "%yinput%"=="" goto win
:loss
cls
echo.sorry you loose
echo.The number was %guess%
pause
its actually pretty fun when ur board
Title: Re: Batch Programs Thread.
Post by: millergram on July 05, 2011, 06:19:53 PM
Simpler batch timer fpr a shutdown Delays however many Hours,mins,seconds till shutdown
Code: [Select]
@echo off
title Shutdown Timer v1.00
mode con: cols=50 lines=15
:main
cls
echo.Welcome To Shutdown Timer
set /p input2=Seconds=
set /p input=Minutes=
set /p input4=Hours=
set /a input=%input%*60
set /a input4=%input4%*60*60
set /a input3=%input%+%input2%+%input4%
timeout /t %input3% /nobreak
shutdown /s
echo.shutting down!
pause>nul
welcome boda da bi bi
Title: Re: Batch Programs Thread.
Post by: foxhound on August 14, 2011, 12:47:15 PM
Code: [Select]
set /p %save%=Save as...
ffmpeg.exe -i %1 -sameq -ab 192k %save%

I rip a lot of FLV files off of video sites ( all within the public domain of course  ;) ) and then use FFmpeg  (http://'http://www.ffmpeg.org/')to convert them to MP3. This two-liner batch presets ffmpeg with my usual arguments. All I have to do is drag and drop the file into the batch file to start the process.
Title: Re: Batch Programs Thread.
Post by: labadiena112 on August 20, 2011, 11:22:32 AM
try this tutorial (there is also a game in it):

Link Removed...
Title: Re: Batch Programs Thread.
Post by: millergram on September 19, 2011, 09:50:07 PM
Shutdown Timer Perfected
Last Time im Gonna Do this i think!?

Code: [Select]
@echo off
title Shutdown Timer v1.00
mode con: cols=50 lines=15
:main
cls
echo.Welcome To Shutdown Timer
if "%input2%"=="" set input2=0
if "%input%"=="" set input=0
if "%input4%"=="" set input4=0
set /p input2=Seconds=
set /p input=Minutes=
set /p input4=Hours=
set /a input=%input%*60
set /a input4=%input4%*60*60
set /a input3=%input%+%input2%+%input4%
timeout /t %input3% /nobreak
shutdown /s
echo.shutting down!
pause>nul
Title: Re: Batch Programs Thread.
Post by: col. sanders on November 01, 2011, 11:01:27 AM
This little VBScript renames the Computer Name to it's Service Tag#/Serial Number for easier tracking of computers.  Only works for computers that ARE NOT joined to a domain.

Code: [Select]
WScript.Echo "Before selecting the OK button, please save any" & _
" documents that need to be saved."

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

For Each objSMBIOS in objWMIService.ExecQuery("Select * from Win32_SystemEnclosure")
' The below variable will be used in the next For Each statement.
Dim Name
Name = objSMBIOS.SerialNumber

Next

Set objWMIService = GetObject("Winmgmts:root\cimv2")

' This section renames the computer.
For Each objComputer in _
    objWMIService.InstancesOf("Win32_ComputerSystem")

        Result = objComputer.rename(Name)
        If Result <> 0 Then
           WScript.Echo "Rename failed. Error = " & Err.Number
        Else
           WScript.Echo "Rename successful." & _
               "  Your machine will reboot after clicking the OK button.  Once again, make sure you have saved any documents before clicking OK.  NOTE: IF YOU CLICK THE 'X' AT THE TOP RIGHT CORNER OF THE WINDOW, IT WILL REBOOT THE COMPUTER AS WELL."
        End If

Next
'Reboots the computer.
Set OpSysSet = GetObject("winmgmts:{authenticationlevel=Pkt," _     
& "(Shutdown)}").ExecQuery("select * from Win32_OperatingSystem where "_     
& "Primary=true")
for each OpSys in OpSysSet     
retVal = OpSys.Reboot()
next
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 10:57:14 AM
Hello, I'm new here and I have been searching the web for a place to put my batch files, I finally found THIS! Yay! Ok, here is my fake batch virus scanner (it's lame because I'm a total noob at batch):

Code: [Select]
@echo off
title Virus Scanner
echo Press 1 Then ENTER To Do An Advanced And Complete Scan
echo Press 2 Then ENTER To Do A Quick Scan
set /p car=
if %car% == 1 goto advcmp
if %car% == 2 goto qik
:advcmp
cls
echo Scanning
ping localhost -n 2 >nul
cls
echo Scanning.
ping localhost -n 2 >nul
cls
echo Scanning..
ping localhost -n 2 >nul
cls
echo Scanning...
ping localhost -n 2 >nul
cls
echo Virus Scanner found a few infections, press 1 to move them to the vault.
echo Press 2 to ignore them.
set /p choose=
if %choose% == 1 goto delete
if %choose% == 2 goto ignore
:delete
cls
echo Moving To Vault
ping localhost -n 2 >nul
cls
echo Moving To Vault.
ping localhost -n 2 >nul
cls
echo Moving To Vault..
ping localhost -n 2 >nul
cls
echo Moving To Vault...
ping localhost -n 2 >nul
cls
echo Virus Scanner successfully moved the infections to its vault! Press ENTER to    close this window.
pause >nul
exit
:ignore
cls
echo The infections were ignored.
pause
exit
:qik
cls
echo Virus Scanner found a few infections, press 1 to move them to the vault.
echo Press 2 to ignore them.
set /p choose=
if %choose% == 1 goto delete
if %choose% == 2 goto ignore
:delete
cls
echo Moving To Vault
ping localhost -n 2 >nul
cls
echo Moving To Vault.
ping localhost -n 2 >nul
cls
echo Moving To Vault..
ping localhost -n 2 >nul
cls
echo Moving To Vault...
ping localhost -n 2 >nul
cls
echo Virus Scanner successfully moved the infections to its vault! Press ENTER to    close this window.
pause >nul
exit
:ignore
cls
echo The infections were ignored. Press ENTER to close this window.
pause >nul
exit
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 05, 2011, 11:54:24 AM
here is my fake batch virus scanner

It's lame, but mainly because the idea of a fake virus scanner is lame. What possible point could there be in it?
Title: Re: Batch Programs Thread.
Post by: patio on November 05, 2011, 12:06:15 PM
It showed my PC as clean as a whistle...
I couldn't find the vault however...
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 01:50:30 PM
patio, about your profile:

When you say "Maud Dib", do you mean "ModDB"? As in, the mod database website?
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 05, 2011, 02:13:15 PM
When you say "Maud Dib", do you mean "ModDB"? As in, the mod database website?

I hope he won't mind me jumping in and saying "No he doesn't".

http://lmgtfy.com/?q=Maud+Dib

exposes Patio's spelling mistake... Or is it?


Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 06:06:09 PM
Here is my fake batch DNS Cache Cleaner:

Code: [Select]
@echo off
title DNS Cleaner ~by lmsmi1
color 0a
echo -----------------------------
echo -------DNS Cleaner-----------
echo -----------------------------
echo --------by lmsmi1------------
echo -----------------------------
echo .
echo .
echo Press 1 Then ENTER To Do A Quick Cleanup
echo Press 2 Then ENTER To Do A Complete Cleanup
set /p cleanup=
if %cleanup% == 1 goto qik
if %cleanup% == 2 goto cmp
:qik
REM Clear DNS Cache
cls
echo Quick clean was successfully completed! Press ENTER to close DNS Cleaner.
pause >nul
exit
:cmp
REM Clear DNS Cache
cls
echo Cleaning
ping localhost -n 2 >nul
cls
echo Cleaning.
ping localhost -n 2 >nul
cls
echo Cleaning..
ping localhost -n 2 >nul
cls
echo Cleaning...
ping localhost -n 2 >nul
cls
echo Complete clean was successfully completed! Press ENTER to close DNS Cleaner.
pause >nul
exit
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 05, 2011, 06:08:59 PM
What is the point of these fake scripts?
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 06:14:57 PM
Here is my fake internet connector: (it says it connects you to the internet :P)

Code: [Select]
@echo off
title Internet Connector ~by lmsmi1
color 0a
echo -----------------------------
echo ----Internet Connector-------
echo -----------------------------
echo --------by lmsmi1------------
echo -----------------------------
echo .
echo .
echo Press 1 Then ENTER To Connect To The Internet
echo Press 2 Then ENTER To Exit
set /p connect=
if %connect% == 1 goto cnct
if %connect% == 2 goto clr
:cnct
REM Connect To Internet
cls
echo Connecting
ping localhost -n 2 >nul
cls
echo Connecting.
ping localhost -n 2 >nul
cls
echo Connecting..
ping localhost -n 2 >nul
cls
echo Connecting...
ping localhost -n 2 >nul
cls
echo Internet Connector successfully connected to the internet! Press ENTER to close Internet Connector.
pause >nul
exit
:clr
exit
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 06:16:05 PM
Salmon Trout, the point is to get my scripts out there for everyone to use. It makes me feel more confident when I get my new programs out there.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 05, 2011, 06:18:08 PM
Did you even read my question? (By the way, we have got it that you know how to do ECHO, set /p and IF, and you know about using PING to make a delay)

Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 05, 2011, 06:18:51 PM
the point is to get my scripts out there for everyone to use.

Use for what?
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 06:24:56 PM
To use to prank or spam out someone. . .obviously you don't appreciate my work, even though this IS the "Batch Programs Thread." :'( You make me sad.
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 06:34:40 PM
Here is my fake disk defragmentor:

Code: [Select]
@echo off
title Disk Defragmentor ~by lmsmi1
color 0a
echo -----------------------------
echo ------Disk Defragmentor------
echo -----------------------------
echo --------by lmsmi1------------
echo -----------------------------
echo .
echo .
echo Press 1 Then ENTER To Defragment Your C:\ Drive
echo Press 2 Then ENTER To Exit
set /p choose=
if %choose% == 1 goto dfrg
if %choose% == 2 goto ext
:dfrg
REM Connect To Internet
cls
echo Defragmenting
ping localhost -n 2 >nul
cls
echo Defragmenting.
ping localhost -n 2 >nul
cls
echo Defragmenting..
ping localhost -n 2 >nul
cls
echo Defragmenting...
ping localhost -n 2 >nul
cls
echo Your C:\ drive was successfully defragmented! Press ENTER to close Disk
echo Defragmentor.
pause >nul
exit
:ext
exit
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on November 05, 2011, 08:00:32 PM
Now we can do Fake Batch Programs?
Is this something I could do?
Are fake programs needed for the advancement of something?
Are piratical jokes allowed? how about something for my Mother-in-law? Could a fake batch start a FAX with message saying I just won a lottery?
Can a batch file generate a FAX? Assume thane is already a dial-up or INTERNET conne3ction.  Also, assume I have two phones lines, if needed. The FAX machine is already on auto-answer.
Title: Re: Batch Programs Thread.
Post by: patio on November 05, 2011, 08:47:50 PM
patio, about your profile:

When you say "Maud Dib", do you mean "ModDB"? As in, the mod database website?

No...
Maud' Dib was the leader of the Fremen in Dune...
Title: Re: Batch Programs Thread.
Post by: Helpmeh on November 05, 2011, 09:43:29 PM
To use to prank or spam out someone. . .obviously you don't appreciate my work, even though this IS the "Batch Programs Thread." :'( You make me sad.
Man, I wish DatsiK was here to flame you.

Quote
This also includes supposedly "harmless" pranks.  This is not what Computer Hope was designed for.

Nobody likes pranks back where you came from, and they definitely don't appreciate them here.

I find it quite funny how he goes to one forum, asks where to post his fake prank programs, gets told not to do it, so he goes to another (more respectable forum) and does it anyway.

Edit: I found a nice quote.
Quote from: lmsmi1
Thanks for the suggestion [Name Withheld]. I will search the web to see if there is another forum where I can post them.
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 09:58:03 PM
This is the batch program thread, so I posted here.
Title: Re: Batch Programs Thread.
Post by: Helpmeh on November 05, 2011, 10:10:48 PM
This is the batch program thread, so I posted here.
Crap != Program

If it has no functional value whatsoever, it shouldn't be posted anywhere, let alone on here. Go back to HF so I can -3 you.
Title: Re: Batch Programs Thread.
Post by: lmsmi1 on November 05, 2011, 10:20:25 PM
*censored* man? Why -3 me? I am just trying to share my work :'( Please point me to a site where I can share my stuff.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 06, 2011, 01:19:16 AM
No...
Maud' Dib was the leader of the Fremen in Dune...

That was Muad'Dib.

http://en.wikipedia.org/wiki/Muad%27Dib



Title: Re: Batch Programs Thread.
Post by: Salmon Trout on November 06, 2011, 01:21:39 AM
*censored* man? Why -3 me? I am just trying to share my work :'( Please point me to a site where I can share my stuff.

It's not "work". It's just you noodling around. Get real.

Here's where to post it

(http://www.technotut.com/wp-content/uploads/2011/05/5-Recycle-Bin1.png)
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on November 06, 2011, 02:51:29 PM
To use to prank or spam out someone

From Computer hope forum rules (http://www.computerhope.com/forum/index.php?topic=58736.0)

Quote
If you’re looking for help with getting revenge on someone else or hacking into a program or service look elsewhere.  This also includes supposedly "harmless" pranks.  This is not what Computer Hope was designed for.



Title: Re: Batch Programs Thread.
Post by: Raven19528 on November 15, 2011, 10:26:44 AM
On to better things than "harmless pranks." I know there are a lot of mass renaming tools out there, but I thought I'd write this one just to see if I could (and I was bored and had too much coffee.)

Code: [Select]
@echo off
setlocal enabledelayedexpansion
title Renamer v1.1
mode con: cols=61 lines=15
set origdir=%~dp0
set numnam=0

call :targets
cls
call :startstring
cls
call :endstring
cls

:renaming
for /f "delims=" %%F in ('dir /s /b %tarstr%') do (
  cls
  set OldFilePathAndName=%%~dpnxF
  set OldName=%%~nF
  set OldFilePath=%%~pF
  set Extension=%%~xF
  set FileDate=%%~tF
  call :SetOldFilePath
  cls
  echo !OldName!!Extension! in !OldFilePath! folder
  echo.
  set /p Continue=Edit this filename {y,n}
  if /i "!Continue!"=="y" (
    call :EditNameSubroutine
  )
)

cls
echo You changed the name of !numnam! files
echo You can view the names that were changed
echo in the Renamelog.txt file located at
echo %origdir%
echo.
echo Thank you for using Renamer v1.1
echo.
ping 1.1.1.1 -n 1 -w 10000>nul
goto eof


:targets
:loop
cls
echo Is the directory path in the targetdirectory.txt file?
set /p yn1={y,n}
cls

if /i "%yn1%"=="y" (
  set /p tardir=<targetdirectory.txt
) else (
  echo Type full path of target directory
  set /p tardir=
)
if exist %tardir% (
  cd %tardir%
) else (
  echo Target does not exist
  echo Please try again
  ping 1.1.1.1 -n:1 -w:3000>nul
  goto loop
)

echo Is there a target string you want to enter?
set /p yn2={y,n}
if /i "%yn2%"=="y" (
  echo.
  echo Type target string for renaming
  set /p tarstr=[Target]
  set tarstr="*!tarstr!*"
  cls
  goto addtarstrques
) else (
  set tarstr=*
  goto eof
)

:addstring
cls
set /p addstr=[Target]
set addstr="*%addstr%*"
set tarstr=%addstr% %tarstr%
echo Searching for strings: %tarstr%
:addtarstrques
echo.
echo Is there an additional string you wish to look for?
set /p yn3={y,n}
if /i "%yn3%"=="y" goto addstring
goto eof


:startstring
:startloop
cls
echo Is there a standard starting string
echo to the naming convention?
set /p yn4={y,n}
if /i "%yn4%"=="y" (
  cls
  echo Enter standard start string 
  echo [Include an ending space if desired]
  echo.
  set /p startstr=
) else (
  set startstr=
  goto eof
)
echo The current start string is "%startstr%"
echo Is this okay?
set /p yn5={y,n}
if /i "%yn5%"=="n" (
  set startstr=
  goto startloop
)
goto eof


:endstring
cls
echo Is there a standard ending string to the naming convention?
set /p yn5={y,n}
if /i "%yn5%"=="n" (
  set endstr=
  goto eof 
)
cls
echo Would you like the end string to
echo include the date the file was created
set /p DateEnd=[y,n]
cls
if /i "%DateEnd%"=="y" call :DateEndFormatting
cls
echo Would you like the end string to include
echo today's date
set /p yn6={y,n}
cls
echo Enter standard end string
echo [Include spaces if desired]
set /p origendstr=
if /i "%yn6%"=="y" call :DateTodayFormatting
if "%DateEnd%"=="y" set origendstr=%origendstr%[date created]
echo The current end string is "%origendstr%"
echo Is this okay?
set /p yn7={y,n}
if /i "%yn7%"=="n" (
  set origendstr=
  goto endstring
)
if /i "%DateEnd%"=="y" set origendstr=%origendstr:~0,-14%
goto eof


:DateEndFormatting
echo In what format would you like the
echo date to appear:
echo.
echo 1. dd Mmm yy
echo.
echo 2. yyyymmdd
echo.
echo 3. Mmm dd, yyyy
echo.
echo 4. mm/dd/yy
echo.
echo 5. More...
echo.
set /p DateEndForm=Selection {1-5}-
if "%DateEndForm%"=="5" goto more
goto dateendskip
:more
cls
echo 6. dd Mmm yyyy
echo.
echo 7. yy/mm/dd
echo.
echo 8. mm/dd/yyyy
echo.
echo 9. yymmdd
echo.
set /p DateEndForm=Selection {6-9}-
:dateendskip
goto eof


:DateTodayFormatting
echo In what format would you like the
echo date to appear:
echo.
echo 1. dd Mmm yy
echo.
echo 2. yyyymmdd
echo.
echo 3. Mmm dd, yyyy
echo.
echo 4. mm/dd/yy
echo.
echo 5. More...
echo.
set /p DateTodayForm=Selection {1-5}-
if "%DateTodayForm%"=="5" goto more
goto settodayform
:more
cls
echo 6. dd Mmm yyyy
echo.
echo 7. yy/mm/dd
echo.
echo 8. mm/dd/yyyy
echo.
echo 9. yymmdd
echo.
set /p DateTodayForm=Selection {6-9}-
:settodayform
if "%date:~4,2%"=="01" set todaymonth=Jan
if "%date:~4,2%"=="02" set todaymonth=Feb
if "%date:~4,2%"=="03" set todaymonth=Mar
if "%date:~4,2%"=="04" set todaymonth=Apr
if "%date:~4,2%"=="05" set todaymonth=May
if "%date:~4,2%"=="06" set todaymonth=Jun
if "%date:~4,2%"=="07" set todaymonth=Jul
if "%date:~4,2%"=="08" set todaymonth=Aug
if "%date:~4,2%"=="09" set todaymonth=Sep
if "%date:~4,2%"=="10" set todaymonth=Oct
if "%date:~4,2%"=="11" set todaymonth=Nov
if "%date:~4,2%"=="12" set todaymonth=Dec
if "%DateTodayForm%"=="1" set origendstr=%origendstr%%date:~7,2% %todaymonth% %date:~12%
if "%DateTodayForm%"=="2" set origendstr=%origendstr%%date:~10%%date:~4,2%%date:~7,2%
if "%DateTodayForm%"=="3" set origendstr=%origendstr%%todaymonth% %date:~7,2%, %date:~10%
if "%DateTodayForm%"=="4" set origendstr=%origendstr%%date:~4,6%%date:~12%
if "%DateTodayForm%"=="6" set origendstr=%origendstr%%date:~7,2% %todaymonth% %date:~10%
if "%DateTodayForm%"=="7" set origendstr=%origendstr%%date:~12%/%date:~4,5%
if "%DateTodayForm%"=="8" set origendstr=%origendstr%%date:~4%
if "%DateTodayForm%"=="9" set origendstr=%origendstr%%date:~12,2%%date:~4,2%%date:~7,2%
goto eof


:DateEndSet
if "!FileDate:~0,2!"=="01" set month=Jan
if "!FileDate:~0,2!"=="02" set month=Feb
if "!FileDate:~0,2!"=="03" set month=Mar
if "!FileDate:~0,2!"=="04" set month=Apr
if "!FileDate:~0,2!"=="05" set month=May
if "!FileDate:~0,2!"=="06" set month=Jun
if "!FileDate:~0,2!"=="07" set month=Jul
if "!FileDate:~0,2!"=="08" set month=Aug
if "!FileDate:~0,2!"=="09" set month=Sep
if "!FileDate:~0,2!"=="10" set month=Oct
if "!FileDate:~0,2!"=="11" set month=Nov
if "!FileDate:~0,2!"=="12" set month=Dec
if "%DateEndForm%"=="1" set endstr=%origendstr%!FileDate:~3,2! !month! !FileDate:~8,2!
if "%DateEndForm%"=="2" set endstr=%origendstr%!FileDate:~6,4!!FileDate:~0,2!!FileDate:~3,2!
if "%DateEndForm%"=="3" set endstr=%origendstr%!month! !FileDate:~3,2!, !FileDate:~6,2!
if "%DateEndForm%"=="4" set endstr=%origendstr%!FileDate:~0,6!!FileDate:~8,2!
if "%DateEndForm%"=="6" set endstr=%origendstr%!FileDate:~3,2! !month! !FileDate:~6,2!
if "%DateEndForm%"=="7" set endstr=%origendstr%!FileDate:~8,2!!FileDate:~0,5!
if "%DateEndForm%"=="8" set endstr=%origendstr%!FileDate:~0,10!
if "%DateEndForm%"=="9" set endstr=%origendstr%!FileDate:~8,2!!FileDate:~0,2!!FileDate:~3,2!
goto eof


:SetOldFilePath
set OldFilePath=!OldFilePath:~-25,-1!
:filepathloop
echo !OldFilePath! | find "\" >nul
if errorlevel 1 goto eof
set OldFilePath=!OldFilePath:~1!
goto filepathloop


:EditNameSubroutine
:editname
cls
echo !OldName!
echo 012345678911111111112222222222333333333344444444445555555555
echo           01234567890123456789012345678901234567890123456789
echo.
set /p NameStart=Enter Start Position-
set /p NameEnd=Enter End Position-
set /a NameLength=1+!NameEnd!-!NameStart!

if /i "%DateEnd%"=="y" call :DateEndSet else set endstr=%origendstr%

call set NewName=%%OldName:~!NameStart!,!NameLength!%%

cls
echo !NewName!
echo Would you like to make changes to this part
echo {Start and end strings will be added later}
echo.
set /p yn10={y,n}
if /i "!yn10!"=="y" (
  call :setcaps

  cls
  echo !NewName!
  echo.
  echo Would you like to insert anything into the name
  set /p yn8={y,n}
  if /i "!yn8!"=="y" call :insertsubroutine

  cls
  echo !NewName!
  echo.
  echo Would you like to remove anything from the name
  set /p yn12={y,n}
  if /i "!yn12!"=="y" call :removesubroutine
)
cls
echo !NewName!
echo.
echo Do you need to make any other changes?
echo.
set /p yn15={y,n}
if "%yn15%"=="y" goto editname

set NewName=!startstr!!NewName!!endstr!!Extension!

cls
echo.
echo !NewName!
echo.
echo Is this correct
set /p yn9={y,n}
if /i "!yn9!"=="y" (
  echo !NewName! from !OldName!!Extension! >>%origdir%\Renamelog.txt
  ren "!OldFilePathAndName!" "!NewName!"
  set /a numnam=!numnam!+1
) else (
  cls
  echo Would you like to try again
  echo.
  set /p yn12={y,n}
  if /i "!yn12!"=="y" goto editname
)
goto eof


:setcaps
set NewName=!NewName:A=a!
set NewName=!NewName:B=b!
set NewName=!NewName:C=c!
set NewName=!NewName:D=d!
set NewName=!NewName:E=e!
set NewName=!NewName:F=f!
set NewName=!NewName:G=g!
set NewName=!NewName:H=h!
set NewName=!NewName:I=i!
set NewName=!NewName:J=j!
set NewName=!NewName:K=k!
set NewName=!NewName:L=l!
set NewName=!NewName:M=m!
set NewName=!NewName:N=n!
set NewName=!NewName:O=o!
set NewName=!NewName:P=p!
set NewName=!NewName:Q=q!
set NewName=!NewName:R=r!
set NewName=!NewName:S=s!
set NewName=!NewName:T=t!
set NewName=!NewName:U=u!
set NewName=!NewName:V=v!
set NewName=!NewName:W=w!
set NewName=!NewName:X=x!
set NewName=!NewName:Y=y!
set NewName=!NewName:Z=z!
:caps
cls
echo !NewName!
echo.
set /p caps=How many capital letters?
if "!caps!"=="0" goto eof
for /l %%i in (1,1,!caps!) do (
  cls
  echo Capital Letter %%i
  echo !NewName!
  echo 012345678911111111112222222222333333333344444444445555555555
  echo           01234567890123456789012345678901234567890123456789
  set /p capoff=At Position-
  set /a endcap=!capoff!+1
  call set before=%%NewName:~0,!capoff!%%
  call set capletter=%%NewName:~!capoff!,1%%
  call set after=%%NewName:~!endcap!%%

  set capletter=!capletter:a=A!
  set capletter=!capletter:b=B!
  set capletter=!capletter:c=C!
  set capletter=!capletter:d=D!
  set capletter=!capletter:e=E!
  set capletter=!capletter:f=F!
  set capletter=!capletter:g=G!
  set capletter=!capletter:h=H!
  set capletter=!capletter:i=I!
  set capletter=!capletter:j=J!
  set capletter=!capletter:k=K!
  set capletter=!capletter:l=L!
  set capletter=!capletter:m=M!
  set capletter=!capletter:n=N!
  set capletter=!capletter:o=O!
  set capletter=!capletter:p=P!
  set capletter=!capletter:q=Q!
  set capletter=!capletter:r=R!
  set capletter=!capletter:s=S!
  set capletter=!capletter:t=T!
  set capletter=!capletter:u=U!
  set capletter=!capletter:v=V!
  set capletter=!capletter:w=W!
  set capletter=!capletter:x=X!
  set capletter=!capletter:y=Y!
  set capletter=!capletter:z=Z!

  set NewName=!before!!capletter!!after!
)
cls
echo !NewName!
echo.
echo Are there any additional caps needed?
set /p yn14={y,n}
if /i "%yn14%"=="y" goto caps
goto eof


:insertsubroutine
:insertsub
cls
echo  !NewName!
echo 012345678911111111112222222222333333333344444444445555555555
echo           01234567890123456789012345678901234567890123456789
echo To the **right** of what position would
echo you like to insert the string?
set /p strpos=Right of Position-
echo What would you like to insert
set /p stradd=[String]
call set NewName=%%NewName:~0,!strpos!%%!stradd!%%NewName:~!strpos!%%
cls
echo !NewName!
echo.
echo Is there anything else that needs to be added
set /p yn11={y,n}
if /i "!yn11!"=="y" goto insertsub
goto eof


:removesubroutine
:removesub
cls
echo  !NewName!
echo 012345678911111111112222222222333333333344444444445555555555
echo           01234567890123456789012345678901234567890123456789
echo What are the start and end positions
echo of the string to be removed?
echo.
echo Note that the start position should be
echo the last character that you want to stay
echo and the end position the last character
echo you want deleted
echo.
set /p remstpos=Start Position-
set /p remenpos=End Position-
call set NewName=%%NewName:~0,!remstpos!%%%%NewName:~!remenpos!%%
cls
echo !NewName!
echo.
echo Do you need to remove anything else
set /p yn13={y,n}
if /i "!yn13!"=="y" goto removesub
goto eof


There's some remnants of where there was no "calling" in the program, but it works the same either way.
Title: Re: Batch Programs Thread.
Post by: patio on November 15, 2011, 06:28:53 PM
That's just perfect...why are we still even entertaining this ? ?
Title: Re: Batch Programs Thread.
Post by: ekto on December 01, 2011, 12:18:47 PM
hey guys new here, i wanted to pick your brains as im struggling to find an answer to what im looking for!

basically ive got some software that my dad had wrote by a programmer it ships with hardware he sells, (vehicle diagnostics etc) im editting his installer that runs from a usb key which also acts as a security dongle so it has to be by dongle and i cant switch to CD or DVD , it uses a batch file which i will eventually convert into a .exe as long as the code all works

the batch file works great, it all installs fine and goes thru spot on and everything is fine, the only thing i cant get to grips with is i would like to delete some driver files from the usb once it has installed once this is so people who try to steal the software once its been installed once will be missing crucial drivers(long story but go with me on this one for now!) my problem is when you put in a usb key, its normally a different drive letter everytime, so i cant link to a static drive letter to delete from  ie; C:/ D:/ etc etc, ive tried using CD\ (to go to top directory) and then DEL for delete but i cant seem to get it to work, im not overly experienced with ms dos, but ive coded in other languages so i understand the fundamentals just not the syntax,

heres what i have:

@ECHO Y
CD\
del folder/file1.dll
del folder/file2.dll
del folder/file3.dll
del folder/file4.dll

i know its probably rubbish but hey ive tried for days on this before asking for help! thanks

Steve
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on December 01, 2011, 12:53:44 PM
I expect you know about the replaceable parameters %1 to %9. Well, there is another one: %0 (that's a zero after the percent symbol). This is a special variable: it contains the batch script's identity.

If you have a batch script called Hello.bat and it contains this line:

Code: [Select]
echo This script is %0
When it runs, on the screen will be echoed:

Code: [Select]
This script is Hello.bat
You can use the same standard variable modifiers with the tilde ~ symbol that work with %1 to %9 and also with FOR variables.

Code: [Select]
    %~I         - expands %I removing any surrounding quotes (")
    %~fI        - expands %I to a fully qualified path name
    %~dI        - expands %I to a drive letter only
    %~pI        - expands %I to a path only
    %~nI        - expands %I to a file name only
    %~xI        - expands %I to a file extension only
    %~sI        - expanded path contains short names only
    %~aI        - expands %I to file attributes of file
    %~tI        - expands %I to date/time of file
    %~zI        - expands %I to size of file

The I is just a letter used for explanation purposes in the documentation for the FOR command.

So in a batch script %~d0 will expand to the drive letter of the drive that the script is on. %~d0:\ is the root directory of that drive. 





Title: Re: Batch Programs Thread.
Post by: ekto on December 01, 2011, 01:29:56 PM
thanks this makes sense, but defo aches my brain haha!
Title: Re: Batch Programs Thread.
Post by: patio on December 01, 2011, 04:54:46 PM
thanks this makes sense, but defo aches my brain haha!

Not quite sure what that means so i'll have to say i agree...
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on December 01, 2011, 06:18:05 PM
Defo. a shortening of definitely for use when responding in agreement ...

...the defo program runs on an Apple OS, not MS DOS.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on December 02, 2011, 12:12:15 AM
%~d0:\ is the root directory of that drive.

Correction: %~d0\ is the root directory of the drive on which the batch file is located. (The colon is included automatically)
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on December 02, 2011, 08:10:22 AM
Correction: %~d0\ is the root directory of the drive on which the batch file is located. (The colon is included automatically)
Where do you find this stuff?
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on December 02, 2011, 11:02:39 AM
Where do you find this stuff?

It's all in the Microsoft Command Line Reference
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on December 02, 2011, 11:32:21 AM
It's all in the Microsoft Command Line Reference
Like this?
Command-line Reference  Updated: October 25, 2010
http://technet.microsoft.com/en-us/library/cc754340%28WS.10%29.aspx
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on December 02, 2011, 11:39:07 AM
Like this?
Command-line Reference  Updated: October 25, 2010
http://technet.microsoft.com/en-us/library/cc754340%28WS.10%29.aspx

Yup.
Title: Re: Batch Programs Thread.
Post by: millergram on December 23, 2011, 02:08:24 PM
Heres A batch For a Alarm Clock :)

Code: [Select]
@echo off
Title Alarm
:Main1
set HR=00
set MN=00
set SC=00
:Main
cls
Echo.set Time
Echo.%time%
Echo.Use Time Format 00:00:00
set /p HR=Hours:
goto T1
:T1
cls
Echo.set Time
Echo.%time%
Echo.%HR%:%MN%:%SC%
set /p MN=Mins:
Goto T2
:T2
cls
Echo.set Time
Echo.%time%
Echo.%HR%:%MN%:%SC%
set /p SC=Seconds:
goto T3
:T3
cls
Echo.set Time
Echo.%time%
Echo.%HR%:%MN%:%SC%
set /p Ok=Yes:1? No:2?=
if "%Ok%"=="1" Goto Cont
if /i "%Ok%"=="yes" Goto Cont
if "%Ok%"=="2" Goto Main1
if /i "%Ok%"=="no" Goto Main1
if "%Ok%"=="" Goto T3
if "%Ok%"=="%Ok%" Goto T3
:Cont
set TT=%HR%:%MN%:%SC%.00
cls
title %TT%
echo.%time%
if "%time%"=="%HR%:%MN%:%SC%.00" goto wake
goto Cont
:wake
Echo.Wake Up!!!
cd %programfiles%
cd *windows Media*
wmplayer "Path of your audio file"
Echo.Press A Key To Turn Off.
pause>nul
Title: Re: Batch Programs Thread.
Post by: Lemonilla on June 06, 2012, 05:36:58 PM
3 floor maze

TEXT WALL WARNING  ;D
Code: [Select]
@echo off
title Maze by Lemonilla
set /p clr=<clr.maz
color %clr%
cd bin
:start
cls
echo 1 Casual
echo 2 Easy
echo 3 Moderate
echo 4 Hard
echo 5 Imposable
echo.
choice /c 12345 /n /m "Select Dificulty"
set f=1
cls
IF %errorlevel%==1 set mr=101
IF %errorlevel%==2 set mr=51
IF %errorlevel%==3 set mr=31
IF %errorlevel%==4 set mr=16
IF %errorlevel%==5 set mr=6
IF %errorlevel%==1 goto 1
IF %errorlevel%==2 goto 1
IF %errorlevel%==3 goto 1
IF %errorlevel%==4 goto 1
IF %errorlevel%==5 goto 1
goto start
:1
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 1
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 1
IF %errorlevel%==2 goto 1
IF %errorlevel%==3 goto 1
IF %errorlevel%==4 goto 3
IF %errorlevel%==5 goto 3
IF %errorlevel%==6 goto 2
goto 1

:2
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 2 
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 1
IF %errorlevel%==2 goto 2
IF %errorlevel%==3 goto 2
IF %errorlevel%==4 goto 3
IF %errorlevel%==5 goto 4
IF %errorlevel%==6 goto 5
goto 2

:3
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 3 
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 1
IF %errorlevel%==2 goto 1
IF %errorlevel%==3 goto 8
IF %errorlevel%==4 goto 9
IF %errorlevel%==5 goto 9
IF %errorlevel%==6 goto 2
goto 3

:4
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 4 
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 6
IF %errorlevel%==2 goto 2
IF %errorlevel%==3 goto 7
IF %errorlevel%==4 goto 7
IF %errorlevel%==5 goto 6
IF %errorlevel%==6 goto 5
goto 4

:5
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 5 
echo Moves Remaining: %mr%
type r2.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 2
IF %errorlevel%==2 goto 4
IF %errorlevel%==3 goto 14
IF %errorlevel%==4 goto 6
IF %errorlevel%==5 goto 7
goto 5

:6
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 6 
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 5
IF %errorlevel%==2 goto 4
IF %errorlevel%==3 goto 7
IF %errorlevel%==4 goto 7
IF %errorlevel%==5 goto 6
IF %errorlevel%==6 goto 6
goto 6

:7
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 7 
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 4
IF %errorlevel%==2 goto 4
IF %errorlevel%==3 goto 9
IF %errorlevel%==4 goto 5
IF %errorlevel%==5 goto 6
IF %errorlevel%==6 goto 6
goto 7

:8
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 8 
echo Moves Remaining: %mr%
type r5.maz
echo.
echo.
choice /c abcd /n /m "Select Door"
IF %errorlevel%==1 goto 8
IF %errorlevel%==2 goto 8
IF %errorlevel%==3 goto 9
IF %errorlevel%==4 goto 3
goto 8

:9
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 9 
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 3
IF %errorlevel%==2 goto 8
IF %errorlevel%==3 goto 9
IF %errorlevel%==4 goto 9
IF %errorlevel%==5 goto 7
IF %errorlevel%==6 goto 3
goto 9

:10
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 10
echo Moves Remaining: %mr%
type r4.maz
echo.
echo.
choice /c abcdefgh /n /m "Select Door"
IF %errorlevel%==1 goto 3
IF %errorlevel%==2 goto 3
IF %errorlevel%==3 goto 11
IF %errorlevel%==4 goto 12
IF %errorlevel%==5 goto 13
IF %errorlevel%==6 goto 14
IF %errorlevel%==7 goto 10
IF %errorlevel%==8 goto 10
goto 10

:11
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 11
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 10
IF %errorlevel%==2 goto 3
IF %errorlevel%==3 goto 6
IF %errorlevel%==4 goto 12
IF %errorlevel%==5 goto 12
IF %errorlevel%==6 goto 12
goto 11

:12
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 12
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 11
IF %errorlevel%==2 goto 11
IF %errorlevel%==3 goto 11
IF %errorlevel%==4 goto 6
IF %errorlevel%==5 goto 13
IF %errorlevel%==6 goto 10
goto 12

:13
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 13
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 14
IF %errorlevel%==2 goto 10
IF %errorlevel%==3 goto 12
IF %errorlevel%==4 goto cf%f%
IF %errorlevel%==5 goto 14
IF %errorlevel%==6 goto 14
goto 13

:14
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 14
echo Moves Remaining: %mr%
type r3.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 13
IF %errorlevel%==2 goto 13
IF %errorlevel%==3 goto 10
IF %errorlevel%==4 goto 13
IF %errorlevel%==5 goto 5
goto 14

:cf1
cls
0>nul set /p=Floor: # 
0>nul set /p=Room: #
echo Moves Remaining: %mr%
echo Congrats! You have compleated Floor 1
set /a f+=1
echo.
echo.
echo You earn an extra 10 turns!
set /a mr+=10
pause>nul
goto 15

:15
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 15
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 15
IF %errorlevel%==3 goto 15
IF %errorlevel%==4 goto 21
IF %errorlevel%==5 goto 20
IF %errorlevel%==6 goto 16
goto 15

:16
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 16
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 15
IF %errorlevel%==3 goto 20
IF %errorlevel%==4 goto 20
IF %errorlevel%==5 goto 18
IF %errorlevel%==6 goto 17
goto 16

:17
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 17
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 16
IF %errorlevel%==3 goto 18
IF %errorlevel%==4 goto 18
IF %errorlevel%==5 goto 15
IF %errorlevel%==6 goto 15
goto 17

:18
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 18
echo Moves Remaining: %mr%
type r6.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 16
IF %errorlevel%==2 goto 17
IF %errorlevel%==3 goto 17
IF %errorlevel%==4 goto 24
IF %errorlevel%==5 goto 19
goto 18

:19
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 19
echo Moves Remaining: %mr%
type r2.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 27
IF %errorlevel%==2 goto 27
IF %errorlevel%==3 goto 18
IF %errorlevel%==4 goto 23
IF %errorlevel%==5 goto 24
goto 19

:20
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 20
echo Moves Remaining: %mr%
type r6.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 16
IF %errorlevel%==3 goto 16
IF %errorlevel%==4 goto 23
IF %errorlevel%==5 goto 21
goto 20

:21
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 21
echo Moves Remaining: %mr%
type r2.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 22
IF %errorlevel%==3 goto 20
IF %errorlevel%==4 goto 23
IF %errorlevel%==5 goto 23
goto 21

:22
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 22
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 21
IF %errorlevel%==2 goto 15
IF %errorlevel%==3 goto 15
IF %errorlevel%==4 goto 15
IF %errorlevel%==5 goto 15
IF %errorlevel%==6 goto 21
goto 22

:23
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 23
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 20
IF %errorlevel%==2 goto 21
IF %errorlevel%==3 goto 15
IF %errorlevel%==4 goto 15
IF %errorlevel%==5 goto 15
IF %errorlevel%==6 goto 19
goto 23

:24
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 24
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 18
IF %errorlevel%==2 goto 19
IF %errorlevel%==3 goto 15
IF %errorlevel%==4 goto 15
IF %errorlevel%==5 goto 15
IF %errorlevel%==6 goto 15
goto 24

:25
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 25
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 15
IF %errorlevel%==3 goto 15
IF %errorlevel%==4 goto 28
IF %errorlevel%==5 goto 27
IF %errorlevel%==6 goto 26
goto 25

:26
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 26
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 15
IF %errorlevel%==2 goto 25
IF %errorlevel%==3 goto 27
IF %errorlevel%==4 goto 29
IF %errorlevel%==5 goto 15
IF %errorlevel%==6 goto 15
goto 26

:27
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 27
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 19
IF %errorlevel%==2 goto 25
IF %errorlevel%==3 goto 28
IF %errorlevel%==4 goto 15
IF %errorlevel%==5 goto 29
IF %errorlevel%==6 goto 26
goto 27

:28
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 28
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 25
IF %errorlevel%==2 goto 15
IF %errorlevel%==3 goto 15
IF %errorlevel%==4 goto 15
IF %errorlevel%==5 goto cf%f%
IF %errorlevel%==6 goto 27
goto 28

:29
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 29
echo Moves Remaining: %mr%
type r1.maz
echo.
echo.
choice /c abcdef /n /m "Select Door"
IF %errorlevel%==1 goto 26
IF %errorlevel%==2 goto 27
IF %errorlevel%==3 goto cf%f%
IF %errorlevel%==4 goto 15
IF %errorlevel%==5 goto 15
IF %errorlevel%==6 goto 15
goto 29

:cf2
cls
0>nul set /p=Floor: # 
0>nul set /p=Room: #
echo Moves Remaining: %mr%
echo Congrats! You have compleated Floor %f%
set /a f+=1
echo.
echo.
echo You earn an extra 10 turns!
set /a mr+=10
pause>nul
set /a RNG=4*%random%/32768+1
if %RNG% EQU 1 goto 30
if %RNG% EQU 2 goto 32
if %RNG% EQU 3 goto 34
if %RNG% EQU 4 goto 36

:30
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 30
echo Moves Remaining: %mr%
type r8.maz
echo.
echo.
choice /c abcd /n /m "Select Door"
IF %errorlevel%==1 goto 31
IF %errorlevel%==2 goto 30
IF %errorlevel%==3 goto 37
IF %errorlevel%==4 goto 30
goto 30

:31
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 31
echo Moves Remaining: %mr%
type r3.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 32
IF %errorlevel%==2 goto 32
IF %errorlevel%==3 goto 30
IF %errorlevel%==4 goto 30
IF %errorlevel%==5 goto 34
goto 31

:32
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 32
echo Moves Remaining: %mr%
type r8.maz
echo.
echo.
choice /c abcd /n /m "Select Door"
IF %errorlevel%==1 goto 32
IF %errorlevel%==2 goto 33
IF %errorlevel%==3 goto 32
IF %errorlevel%==4 goto 31
goto 32

:33
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 33
echo Moves Remaining: %mr%
type r2.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 32
IF %errorlevel%==2 goto 32
IF %errorlevel%==3 goto 38
IF %errorlevel%==4 goto 34
IF %errorlevel%==5 goto 34
goto 33

:34
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 34
echo Moves Remaining: %mr%
type r8.maz
echo.
echo.
choice /c abcd /n /m "Select Door"
IF %errorlevel%==1 goto 33
IF %errorlevel%==2 goto 34
IF %errorlevel%==3 goto 35
IF %errorlevel%==4 goto 34
goto 34

:35
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 35
echo Moves Remaining: %mr%
type r10.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 36
IF %errorlevel%==2 goto 36
IF %errorlevel%==3 goto 34
IF %errorlevel%==4 goto 34
IF %errorlevel%==5 goto 32
goto 35

:36
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 36
echo Moves Remaining: %mr%
type r8.maz
echo.
echo.
choice /c abcd /n /m "Select Door"
IF %errorlevel%==1 goto 36
IF %errorlevel%==2 goto 35
IF %errorlevel%==3 goto 36
IF %errorlevel%==4 goto 37
goto 36

:37
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 37
echo Moves Remaining: %mr%
type r9.maz
echo.
echo.
choice /c abcde /n /m "Select Door"
IF %errorlevel%==1 goto 36
IF %errorlevel%==2 goto 36
IF %errorlevel%==3 goto 30
IF %errorlevel%==4 goto 30
IF %errorlevel%==5 goto 36
goto 37

:38
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 38
echo Moves Remaining: %mr%
type r7.maz
echo.
echo.
choice /c abcdefgh /n /m "Select Door"
IF %errorlevel%==1 goto 32
IF %errorlevel%==2 goto 33
IF %errorlevel%==3 goto 34
IF %errorlevel%==4 goto 35
IF %errorlevel%==5 goto 36
IF %errorlevel%==6 goto 37
IF %errorlevel%==7 goto 39
IF %errorlevel%==8 goto 31
goto 38

:39
set /a mr-=1
if "%mr%"=="0" goto lose
cls
0>nul set /p=Floor: %f% 
0>nul set /p=Room: 39
echo Moves Remaining: %mr%
type r8.maz
echo.
echo.
choice /c abcd /n /m "Select Door"
IF %errorlevel%==1 goto 38
IF %errorlevel%==2 goto 30
IF %errorlevel%==3 goto 32
IF %errorlevel%==4 goto cf%f%
goto 39

:cf3
cls
0>nul set /p=Floor: # 
0>nul set /p=Room: #
echo Moves Remaining: %mr%
echo Congrats! You have compleated Floor %f%
set /a f+=1
echo.
echo.
echo You earn an extra 10 turns!
set /a mr+=10
pause>nul

:end
set /a mr-=1
cls
Echo You Win With %mr% Turns Remaining!
pause>nul
goto start

:lose
echo You Lose!
pause>nul
goto start

r1.maz
Code: [Select]
/----B-----C----\
| |
| |
A D
| |
| |
\----F-----E----/
r2.maz
Code: [Select]
\---A---B---\
 \     |
  \ C  |
   \     D
    \       |
     \      |
      \     |
       \    E
        \   |
         \  |
          \-/
r3.maz
Code: [Select]
/--A---B--/
|        /
D  E    /
|      /
|     /
C    /
|   /
|--/
r4.maz
Code: [Select]
/-----B----------C--------D-----\
| |
| |
| |
A E
| |
| |
| |
\-----H----------G--------F-----/
r5.maz
Code: [Select]
/--A----B--\
|    |
\--D----C--/
r6.maz
Code: [Select]
|--\
|   \
A    \
|     \
|      \
B  E    \
|        \
\--C---D--\
r7.maz
Code: [Select]
    /------A-----\
   /           \
  H    B
 /     \
/      \
|      |
|      |
G      C
|      |
|      |
\                    / 
 \             /
  F               D
   \              /
    \------E-----/
r8.maz
Code: [Select]
/-A-\
D   B
\-C-/
r9.maz
Code: [Select]
|--\
|   \
D    \
|     \
|      \
C  E    \
|        \
\--A---B--\
r10.maz
Code: [Select]
/--|
  /   |
       /    D
      /     |
     /      |
    /       |
   /        c
  /      E  |
 /          |
/---A---B---/

the r#.maz files must be in a dir named "bin". copy them to a text file then use cmd to "rename" them to be .maz

EDIT: apparently no spoiler support  :'(
Title: Re: Batch Programs Thread.
Post by: Lemonilla on June 10, 2012, 08:21:13 AM
to display a % sign you need to echo YOURNUMBER%%%
example that doesnt work
Code: [Select]
@echo off
pause
echo 100%
pause
echo 30%
pause
how to fix said example
Code: [Select]
@echo off
pause
echo 100%%%
pause
echo 30%%%
pause
Title: Re: Batch Programs Thread.
Post by: shyqyri on June 10, 2012, 05:01:22 PM
dont work this code,,,  :-[
my project work fine, copy this backup database in network sharing and past in specifik location, but dont show how many minits ore  how % can remainds for this progress.
databaase backup ore 6 GB.

thank you.
Title: Re: Batch Programs Thread.
Post by: millergram on July 04, 2012, 09:46:02 PM
Heres a batch to monitor programs/processes using the tasklist

Code: [Select]
@echo off
title Wow Moniter v2
:restart
cls
set y=0
for /f "tokens=1" %%a in ('tasklist') do if "%%a"=="(Prosses Name)" goto next
for /f "tokens=1" %%b in ('tasklist') do if "%%b"=="(This Line Not Needed Was Part of orginal File)" taskkill /f /im %%b
if "%y%"=="0" start "" "(link to proccess or program)"
Echo.Waiting For Launcher.exe
timeout /nobreak /t 10
goto restart
:next
set y=1
goto restart
Title: Re: Batch Programs Thread.
Post by: cutedevilz on July 29, 2012, 03:09:42 AM
i try the code in the first page and that's very cool nice :D

Title: Re: Batch Programs Thread.
Post by: Helpmeh on October 11, 2012, 10:48:07 PM
Made a little maze solver. It uses trial-and-error to slowly make its way through each maze. It's pretty neat to watch it make it's first steps through the maze, but after watching it go through a couple different mazes (3 included), I could predict what path it would follow very quickly, as it prioritizes (in this order) down, right, left, up.

http://www.filedropper.com/maze_1

It's pretty neat, I have to say. Not as amazing as some other stuff I've done in the past, but a good 2-hour project.
Title: Re: Batch Programs Thread.
Post by: millergram on October 16, 2012, 12:42:25 PM
Yet another RPS!
Code: [Select]
@echo off
Title RPS by millergram
color 02
:title
set Com=0
set Hum=0
set R=1
set P=2
set S=3
set C=0
set H=0
set /p UserName=Type Name Here:
:main
cls
echo.1=rock 2=paper 3=Siccors
echo.Computer's Score=%Com%
echo.%UserName%'s Score=%Hum%
set /p Input=RPS?:
if /I "%Input%"=="1" goto rock
if /I "%Input%"=="2" goto paper
if /I "%Input%"=="3" goto sicc
if /I "%Input%"=="%Input%" goto main
goto main
:rock
set H=1
set /a C=(%random% %%2)+1
if %C% equ 1 goto RT
if %C% equ 2 goto RL
if %C% equ 3 goto RW
:RT
cls
echo.%UserName% chose Rock Computer chose Rock too!
echo.Its a tie!
Echo.Press A Key...
Pause>nul
goto main
:RL
cls
set /a Com=%Com%+1
echo.%UserName% chose Rock Computer Chose Paper!
echo.You Loose!
Echo.Press A Key...
Pause>nul
goto main
:RW
cls
set /a Hum=%Hum%+1
echo.%UserName% chose Rock Computer Chose Siccors!
echo.you win!
Echo.Press A Key...
Pause>nul
goto main
:paper
set H=2
set /a C=(%random% %%2)+1
if %C% equ 2 goto PT
if %C% equ 3 goto PL
if %C% equ 1 goto PW
:PT
cls
echo.%UserName% chose Paper Computer chose Paper too!
echo.Its a tie!
Echo.Press A Key...
Pause>nul
goto main
:PL
cls
set /a Com=%Com%+1
echo.%UserName% chose Paper Computer Chose Siccors!
echo.You Loose!
Echo.Press A Key...
Pause>nul
goto main
:PW
cls
set /a Hum=%Hum%+1
echo.%UserName% chose Paper Computer Chose Rock!
echo.you win!
Echo.Press A Key...
Pause>nul
goto main
:sicc
set H=3
set /a C=(%random% %%2)+1
if %C% equ 3 goto ST
if %C% equ 1 goto SL
if %C% equ 2 goto SW
:ST
cls
echo.%UserName% chose Siccors Computer chose Siccors too!
echo.Its a tie!
Echo.Press A Key...
Pause>nul
goto main
:SL
cls
set /a Com=%Com%+1
echo.%UserName% chose Siccors Computer Chose Rock!
echo.You Loose!
Echo.Press A Key...
Pause>nul
goto main
:SW
cls
set /a Hum=%Hum%+1
echo.%UserName% chose Siccors Computer Chose Paper!
echo.you win!
Echo.Press A Key...
Pause>nul
goto main
Title: Re: Batch Programs Thread.
Post by: Helpmeh on October 20, 2012, 05:44:48 PM
Bruce Sterling says in The Hacker Crackdown, "Hackers  long for recognition  as a praiseworthy cultural archetype...." And this recognition is exactly what I craved when I posted my source. I thought it was a pretty good idea and a pretty cool process, but if my most-respected peers don't seem to care about what I've been up to lately, I don't know what to say.
Title: Re: Batch Programs Thread.
Post by: foxidrive on October 21, 2012, 07:51:25 AM
Your link is broken.

FWIW - this is IRL and the gameplay sucks.  People will check stuff out if they are looking for a tool to solve a task, or if they are bored and have time to kill.
And you gave away the punch line - saying how it solves the maze.

Maybe you should have posted the batch code instead of a dropbox download??
Title: Re: Batch Programs Thread.
Post by: Helpmeh on October 21, 2012, 03:31:10 PM
Your link is broken.

FWIW - this is IRL and the gameplay sucks.  People will check stuff out if they are looking for a tool to solve a task, or if they are bored and have time to kill.
And you gave away the punch line - saying how it solves the maze.

Maybe you should have posted the batch code instead of a dropbox download??

http://www.filedropper.com/maze

It's not just the code that is required, it also have files for each individual maze you can use. I've updated it since I originally posted it so that it doesn't refresh the whole screen each time it moves around (improving the speed and visibility).
Title: Re: Batch Programs Thread.
Post by: 1998golfer on November 22, 2012, 09:49:40 AM
I need some help here...
I need to make a batch file to track progress, storing ongoing info in a progress.txt file... I need it to be when I make changes it reads data from line1 and add %num% and re-write it to the progress.txt file. any way how to do this?
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on December 15, 2012, 11:39:18 AM
I still think everyone the does natch should at some point in time consider Microsoft Power Shell.
http://en.wikipedia.org/wiki/Windows_PowerShell
Title: Re: Batch Programs Thread.
Post by: gamerx365 on December 19, 2012, 11:16:42 AM
I want to share my webpage hosting my batch programs. Since I noticed my old attachments have been removed from my posts. Hope no one minds...
http://72.18.61.194/lightstorm/index.html
Check it out maybe? I've got some games and other random files there.
Title: Re: Batch Programs Thread.
Post by: foxidrive on February 08, 2013, 09:15:08 PM
There's this really spiffy thing out nowadays, they call it a loop.  Crazy name.  Google it. :D
Title: Re: Batch Programs Thread.
Post by: patio on February 08, 2013, 09:30:08 PM
But if you print his out you have a hard copy..... 8)
Title: Re: Batch Programs Thread.
Post by: foxidrive on February 09, 2013, 12:59:08 AM
And you would have printed 57 + pages  (assuming 60 lines per page) :D

You know, I think his post was truncated too... and would have been 30,000 + more lines
Title: Re: Batch Programs Thread.
Post by: generikk on March 15, 2013, 04:34:43 AM
ok i need a basic bat file i need it to be able to send an emulated press of a key (up arrow) to the active window every 10-20 secs (random)
if u make one email it to me at email address removed by Allan

-generikk
Title: Re: Batch Programs Thread.
Post by: Allan on March 15, 2013, 07:15:05 AM
ok i need a basic bat file i need it to be able to send an emulated press of a key (up arrow) to the active window every 10-20 secs (random)
if u make one email it to me at email address removed by Allan

-generikk
I removed your email address for two reasons:

1) That's not how support forums work. Questions and answers are posted on the forum for all to see and learn

2) Posting your email address on a public forum will result in a TON of spam. There are "bots" that do nothing but scour forums for email addresses, which are then sold to spammers.
Title: Re: Batch Programs Thread.
Post by: Lemonilla on June 05, 2013, 08:56:00 PM
Finds the number of arguments
Code: [Select]
@echo off
setlocal EnableDelayedExpansion
set num_args=0
:loop
set findArg_value=%1
set f |find "findArg_value" 1>nul 2>&1
if "%errorlevel%"=="0" (
set /a num_args+=1
shift
goto loop
)
set findArg_value=
echo %num_args%
Title: Re: Batch Programs Thread.
Post by: foxidrive on June 06, 2013, 07:27:48 AM
You don't need to use delayed expansion as it's not being used in your script.  That would allow it to use ! as a parameter.
Title: Re: Batch Programs Thread.
Post by: Lemonilla on June 06, 2013, 04:56:24 PM
Oops, forgot to remove it. That was the 5th attempt, the others used for /l loops (until I remembered about 'shift').
Title: Re: Batch Programs Thread.
Post by: crisis13 on September 05, 2013, 10:13:33 AM
I made this Batchfile to compress a (small) file in severall ways and then delete  the results EXEPT the smallest solution.
I hope it is usefull and i am sure it can be done (much) better, so if you like to comment please , do so !!
its just a 'dirty concept' but it works (for me)

you will need:
exomizer :
http://hem.bredband.net/magli143/exo/
hem.bredband.net/magli143/exo/exomizer207.zip

zx7  : http://www.worldofspectrum.org/infoseekid.cgi?id=0027996
ftp://ftp.worldofspectrum.org/pub/sinclair/games-extras/ZX7_(WindowsExecutable).zip

rcs : http://www.worldofspectrum.org/infoseek.cgi?regexp=^Reverse+Computer+Screen$
ftp://ftp.worldofspectrum.org/pub/sinclair/games-extras/RCS_(WindowsExecutable).zip


Code: [Select]
@echo %%A
echo off
echo.
echo This file is :
echo %~dpnx0
echo.
echo This file compresses all BIN found if less then 13825 bytes
echo via RCS with Exomizer and ZX7 for Z80 use
echo the final result is stored in the map SMALL
echo.
if not exist zx7.exe (
 echo you need to install zx7
 echo http://www.worldofspectrum.org/infoseekid.cgi?id=0027996
 pause 1
 goto :eof
)
if not exist exomizer.exe (
 echo you need to install Exomizer
 echo http://hem.bredband.net/magli143/exo/
 pause 1
 goto :eof
)
if not exist rcs.exe (
 echo you need to install RCS
 echo http://www.worldofspectrum.org/infoseek.cgi?regexp=^Reverse+Computer+Screen$
 pause 1
 goto :eof
)

if exist sleep.exe do sleep 60

set Q=%%A
set X=.rcs
set Y=.zx7
set Z=.exo
set R=%Q%%X%
set S=%Q%%Y%
set T=%Q%%Z%

mkdir small

FOR %Q% IN (*.bin) DO (
set Q=%%A
set X=.rcs
set Y=.zx7
set Z=.exo
set R=%Q%%X%
set S=%Q%%Y%
set T=%Q%%Z%

VERIFY OTHER 2>nul REM create an error
setlocal enableextentions
IF ERRORLEVEL 1 echo Unable to enable extensions
VERIFY OTHER 2>nul REM create an error
setlocal enabledelayedexpansion
IF ERRORLEVEL 1 echo Unable to enable delayed expansion

set Q=%%A
set X=.rcs
set Y=.zx7
set Z=.exo
set R=%Q%%X%
set S=%Q%%Y%
set T=%Q%%Z%

cls
echo file: %Q% startlength: %%~zA
rcs.exe %Q%
zx7.exe %Q%
exomizer raw -q %Q% -o %T%
zx7.exe %R%
exomizer raw -q %R% -o %R%%Z%

move %R% small/%R%
move %S% small/%S%
move %T% small/%T%
move %R%%Y% small/%R%%Y%
move %R%%Z% small/%R%%Z%

cd small
echo.
set I=0
for /f "delims=" %%O in ('dir /Os /b %Q%.*') do (
echo File %%O %%~zO bytes
call :recurse
echo.
)
rem move *.* ..
cd ..
rem echo remove map
rem RD small
endlocal
)
goto :eof

:recurse
set I=0
cd
REM view all files, EXCEPT directories.
FOR /f "tokens=*" %%P IN ('dir /Os /A-d /b %Q%.*') do (call :showfiles "%%P")
set count=%I%
echo Filecount: %count%
REM echo recurse I %I% C %count% %Q%

goto :eof

:showfiles
set /a I+=1
if "%I%" GTR "1" (
 del %1
 echo %1 deleted
 ) ELSE (
 echo SMALLEST FOUND = %1
)
goto :eof


its all related to:
reversed computer screen
 http://www.worldofspectrum.org/forums/showthread.php?t=42176
zx7
 http://www.worldofspectrum.org/forums/showthread.php?t=42037&highlight=zx7
exomizer
 http://www.worldofspectrum.org/forums/showthread.php?t=41523&highlight=exomizer


Title: Re: Batch Programs Thread.
Post by: Lemonilla on September 06, 2013, 06:04:58 PM
Searches every file on drive for a binary copy of the input file.

Code: [Select]
@echo off
if "%1"=="-debug" (
shift
echo on
)
setlocal EnableDelayedExpansion

set "output= "
set "drv=%cd:~0,1%:"
set counter=0

::ADD MODIFYERS AND HELP MENU LATER
:mod
if "%1"=="/f" (
set "p=%~pdnx2"
shift
shift
goto :mod
)
if "%1"=="/l" (
set "output=%2> echo %%1"
shift
shift
goto :mod
)
if "%1"=="/d" (
set "drv=%2"
shift
shift
goto :mod
)
if "%1"=="/F" (
set "p=%~pdnx2"
shift
shift
goto :mod
)
if "%1"=="/L" (
set "output=%2> echo %%1"
shift
shift
goto :mod
)
if "%1"=="/D" (
set "drv=%2"
shift
shift
goto :mod
)
if "%1"=="/?" goto :help



set "p=%~pdnx1"

::Find Matches
echo.
for /r %drv%\ %%A in (*.*) do (
fc /b /LB0 "%p%" "%%A" >nul 2>&1
if !errorlevel! EQU 0 call :match %%A
)
echo.
echo Done, %counter% matches were found.
exit /b

:match
if "%~pdnx1"=="%p%" goto :eof
%output%
echo %1
set /a counter+=1
goto :eof

:help
echo Searches drive for any copies of the input file.
echo.
echo FINDMATCH ^[^/d drive:^] ^[^/l filename1^] ^[^/f filename2^]
echo.
echo.  /F         Specifies the file.
echo.  /L         Logs the output in a file.
echo.  /D         Specifies the drive to search.
echo.
exit /b
Title: Re: Batch Programs Thread.
Post by: Lemonilla on September 16, 2013, 05:33:02 PM
Calendar

WINDOWS 7 ONLY.



cal.bat
Code: [Select]
:: Verison 1.5
:: Windows 7 program, use under any other OS at your own risk.

@echo off
if "%1"=="-debug" (
shift
echo on
)
timeout /t 0 >nul || goto :error.2
set "root=%~pd0"
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
  set "DEL=%%a"
)
for /f "tokens=1,2 delims==" %%A in ('wmic path win32_localtime get day^,dayofweek^,weekinmonth^,month^,year /value') do (
if not "%%A"=="" if not "%%B"=="" set %%A=%%B
)

::Constants
set TodaysColor=0f

set a=0
set b=0
set dow=%DayOfWeek%
set wim=%WeekInMonth%
set m=%month%
set /a m1=%m%-1
set today=%day%
set mod=%~1

if not "%mod%"=="" goto :modifyers
call :make.cal
goto :end



:make.Cal
if "%m%"=="1" set end=31
if "%m%"=="2" set end=28
if "%m%"=="3" set end=31
if "%m%"=="4" set end=30
if "%m%"=="5" set end=31
if "%m%"=="6" set end=30
if "%m%"=="7" set end=31
if "%m%"=="8" set end=31
if "%m%"=="9" set end=30
if "%m%"=="10" set end=31
if "%m%"=="11" set end=30
if "%m%"=="12" set end=31

if "%m%"=="1"  set "m.name=          January (1)"
if "%m%"=="2"  set "m.name=         February (2)"
if "%m%"=="3"  set "m.name=           March (3)"
if "%m%"=="4"  set "m.name=           April (4)"
if "%m%"=="5"  set "m.name=            May (5)"
if "%m%"=="6"  set "m.name=           June (6)"
if "%m%"=="7"  set "m.name=           July (7)"
if "%m%"=="8"  set "m.name=          August (8)"
if "%m%"=="9"  set "m.name=         September (9)"
if "%m%"=="10" set "m.name=         October (10)"
if "%m%"=="11" set "m.name=        November (11)"
if "%m%"=="12" set "m.name=        December (12)"

if "%m1%"=="1" set past=31
if "%m1%"=="2" set past=28
if "%m1%"=="3" set past=31
if "%m1%"=="4" set past=30
if "%m1%"=="5" set past=31
if "%m1%"=="6" set past=30
if "%m1%"=="7" set past=31
if "%m1%"=="8" set past=31
if "%m1%"=="9" set past=30
if "%m1%"=="10" set past=31
if "%m1%"=="11" set past=30
if "%m1%"=="12" set past=31


:loop.diw
if %dow% EQU 1 goto :loop.wim
set /a dow-=1
set /a day-=1
goto :loop.diw


:loop.wim
set /a wim-=1
set /a day-=7
if %day% LSS 0 (
set /a day=%past%%day%
set b=1
goto :loop.end
)
goto :loop.wim
:loop.end

echo.
echo.%m.name%
echo Mon  Tue  Wed  Thu  Fri  Sat  Sun
echo ---  ---  ---  ---  ---  ---  ---
echo.

:loop.week
set input=0
if "%day:~1,1%"=="" set day=0%day%

if not %input% EQU 1 for /f "tokens=1,2,3 delims=:" %%A in (h.txt) do if %year% EQU %%A if %m% EQU %%B if %day% EQU %%C call :ColorText 0c "%day%" && set input=1 && 0>nul set /p"=.  "

if not %input% EQU 1 if %day%==%today% call :ColorText %todaysColor% "%day%" && set input=1 && 0>nul set /p"=.  "

if not %input% EQU 1 if exist %~pd0\d.txt for /f "tokens=1,2 delims=:" %%A in (d.txt) do if %m% EQU %%A if %day% EQU %%B call :ColorText 05 "%day%" && set input=1 && 0>nul set /p"=.  "

if not %input% EQU 1 if not %day%==%today% 0>nul set /p"=%day%.  "

if "%day:~0,1%"=="0" set day=%day:~1,1%
set /a day+=1
set /a dow+=1

if %dow% GTR 7 (
set dow=1
set /a wim+=1
echo.
if %a%==1 if %b%==0 goto :loop.end
)
if %b%==0 if %day% GTR %end% (
set day=1
set /a m+=1
set a=1
)
if %b%==1 if %day% GTR %past% (
set day=1
set b=0
)
goto :loop.week
:loop.end
echo.
goto :eof


:ColorText
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1
goto :eof


:modifyers
set output=0


if "%mod:~0,3%"=="/a:" (
call :make.cal

for /f "tokens=1-3 delims=:" %%A in ("!mod:~3!") do (
set b_=%%B
if "!b_:~1,1!"=="" set b_=0!b_!
echo %%A:!b_!:%%C >>%root%\d.txt && echo Date Added.
)
goto :end
)



if "%mod:~0,3%"=="/r:" if exist %root%\d.txt (
call :make.cal

for /f "tokens=1,2 delims=:" %%A in ("!mod:~3!") do (
set b_=%%B
if "!b_:~1,1!"=="" set b_=0!b_!
for /f "tokens=1,2,3 delims=:" %%U in ('type "%root%\d.txt"') do (
if not "%%U:%%V"=="%%A:!b_!" echo %%U:%%V:%%W >>"%root%\d2.txt"
if "%%U:%%V"=="%%A:!b_!" echo Date Removed.
)
)
del /f "%root%d.txt"
if exist %root%\d2.txt rename "%root%d2.txt" "d.txt"
goto :end
) else (
call :make.cal

echo No dates entered.
goto :end
)


if "%mod:~0,3%"=="/d:" if exist %root%\d.txt (
call :make.cal

for /f "tokens=1,2 delims=:" %%A in ("%mod:~3%") do (
set b_=%%B
if "!b_:~1,1!"=="" set b_=0!b_!
for /f "tokens=1-3 delims=:" %%G in ('type "%root%\d.txt"') do (
if "%%G:%%H"=="%%A:!b_!" if not "%%I"=="" (set I=%%I && set I=!I:_= ! && echo !I!) else (echo No Comment)
)
for /f "tokens=1-4 delims=:" %%W in ('type "%root%\h.txt"') do (
if "%%W:%%X:%%Y"=="%year%:%%A:!b_!" if not "%%Z"=="" (set Z=%%Z && set Z=!Z:_= ! && echo !Z!) else (echo No Comment)
)
)
goto :end
)

if "%mod%"=="-b" goto :bug

REM Find Specific Day
call :make.cal

if "%mod%"=="/code" (
set output=1
SHIFT
)

for /f "tokens=1,2 delims=:" %%A in ("%mod:~1%") do (
set dayToFind=%%A
set WeekToFind=%%B
)

if "%dayToFind%"=="Su" ( set dayToFind_=7 && set daytofind+=Sunday) else (
if "%dayToFind%"=="Mo" ( set dayToFind_=1 && set daytofind+=Monday) else (
if "%dayToFind%"=="Tu" ( set dayToFind_=2 && set daytofind+=Tuesday) else (
if "%dayToFind%"=="We" ( set dayToFind_=3 && set daytofind+=Wednesday) else (
if "%dayToFind%"=="Th" ( set dayToFind_=4 && set daytofind+=Thursday) else (
if "%dayToFind%"=="Fr" ( set dayToFind_=5 && set daytofind+=Friday) else (
if "%dayToFind%"=="Sa" ( set dayToFind_=6 && set daytofind+=Saturday) else (
goto :error
)))))))

:loop.dow2
if %dow% LSS %dayToFind_% (
set /a dow+=1
set /a day+=1
)
if %dow% GTR %dayToFind_% (
set /a dow-=1
set /a day-=1
)
if not %dow% EQU %daytofind_% goto :loop.dow2

:loop.wim2
if %wim% LSS %WeekToFind% (
set /a wim+=1
set /a day+=7
)
if %wim% GTR %WeekToFind% (
set /a wim-=1
set /a day-=7
)
if %wim% GTR 8 goto :error
if %wim% LSS 0 goto :error
if not %wim% EQU %weekToFind% goto :loop.wim2

if %output%==0 (
if %weekToFind% == 1 echo The first %dayToFind+% occures on the %day%.
if %weekToFind% == 2 echo The second %dayToFind+% occures on the %day%.
if %weekToFind% == 3 echo The third %dayToFind+% occures on the %day%.
if %weekToFind% == 4 echo The forth %dayToFind+% occures on the %day%.
if %weekToFind% == 5 echo The fifth %dayToFind+% occures on the %day%.
if %weekToFind% == 6 echo The sixth %dayToFind+% occures on the %day%.
) else (
echo %day%
)
goto :end

:Bug
echo Known bugs:
echo.  1. /a does not support spaces or quotation marks.
echo.  2. /day does not work if the first instance of the given day appears
echo.      on a week with the previous mounths, It gives the next instance instead.
echo.
goto :end

:error
echo Produces a calendar or date of a specific day.
echo.
echo cal [{/code} /Day:#] [/a:m:n:Note] [/r:m:n]
echo.
echo.   /Day:#      Finds the date for the specified day. Day is the first two
echo.                letters of the day you wish to locate.
echo.                # corresponds to the week of the month.
echo.   /code       Reformats the output to a more code friendly format.
echo.                /code must come before /Day:#.
echo.   /a:m:n:Note Creates a date that will appear on the calendar. m is the
echo.                month, n is the day. Note is optional and will act as a
echo.                reminder if you forget what happens on the date.
echo.                Replace all instances of ^<space^> with underscore ^"_^".
echo.   /r:m:n      Removes an existing date from the calendar. m is the month
echo.                and n is the day.
echo.   /d:m:n      Displays the comment corresponding with the date. m is the month
echo.                and n is the day.
echo.   -b          Displays Known errors.
echo.
echo cal color codes certain dates. The colors and their meanings are below.
echo.
call :colortext %todayscolor% "   Today"
echo.
call :colortext 0c "   National Holiday"
echo.
call :colortext 02 "   Daylight Savings Time"
echo.
call :colortext 05 "   Saved Date"
echo.
echo.
echo Examples:
echo.   cal
echo.   cal /Su:2
echo.   cal /code /Th:1
echo.   cal /a:9:03:Birthday
echo.   cal /r:9:3
echo.   cal /d:9:03
:error.2
echo.
echo.(cal is a Windows 7 program and is not backwards compatible.)
echo.
:end

with Helper file "h.txt" (This example holds US holidays for 2013 and 2014, you can replace them with your native country's holidays by following the same format.)

Syntax:
Year:Month:Day:Discription
or
::::COMMENT
Code: [Select]
::::US Holidays
::::As shown on opm.gov

::::2013
2013:1:01:New_Years_Day
2013:1:21:Birthday_of_Dr_King_Jr
2013:2:18:Washingtons_Birthday
2013:5:27:Memorial_Day
2013:7:04:Independence_Day
2013:9:02:Labor_Day
2013:10:14:Columbus_Day
2013:11:03:Veterans_Day
2013:11:28:Thanksgiving_Day
2013:12:25:Christmas_Day


::::2014
2014:1:01:New_Years_Day
2014:1:20:Birthday_of_Dr_King_Jr
2014:2:17:Washingtons_Birthday
2014:5:26:Memorial_Day
2014:7:04:Independence_Day
2014:9:01:Labor_Day
2014:10:13:Columbus_Day
2014:11:11:Veterans_Day
2014:11:27:Thanksgiving_Day
2014:12:25:Christmas_Day




Example output:

T:\cal>cal /d:9:02

         September (9)
Mon  Tue  Wed  Thu  Fri  Sat  Sun
---  ---  ---  ---  ---  ---  ---

26.  27.  28.  29.  30.  31.  01.
02.  03.  04.  05.  06.  07.  08.
09.  10.  11.  12.  13.  14.  15.
16.  17.  18.  19.  20.  21.  22.
23.  24.  25.  26.  27.  28.  29.
30.  01.  02.  03.  04.  05.  06.

Labor Day
Title: Re: Batch Programs Thread.
Post by: spivee on September 29, 2013, 10:34:39 AM
Yay, I was hoping for this thread to exist.
I'm working on an engine for text based adventures, called the dream engine,
I'm pretty proud of it,

Code: [Select]
@echo off

rem for /f "delims==" %%f in ('set') do (
rem set %%f=
rem )

call language.bat

title The Dream Engine
echo What file do you want to use?
set /p name=^
>

set interpret.type[nul]=0

for /f "tokens=1* delims=." %%f in ("%name%") do (set test=%%g)
if "%test%"=="" (if not exist "%name%" (set name=%name%.txt))
set purpose=root
set layer=0
for /f "tokens=* usebackq delims=~" %%f in ("%name%") do (call :readline .%%f)
set indent=0
call :readline.lowerindent

title The %place%.
echo You are in a %place%.

:Inputloop
set input=
set /p input=^
>
if "%input%"=="" goto :inputloop
call :interpret %input%
goto :Inputloop

:debug
set debug
set interpret
set console
set hook
set type
set object
set event
goto :eof

:look
set look.counter=
set look.seen=
call :look.loop
goto :eof

:look.loop
set /a look.counter=look.counter+1
set list=
call :set id=%%object[%look.counter%]%%
call :set name=%%console.type[%id%]%%
call :set location=%%object.location[%look.counter%]%%
if "%name%"=="" (if "%look.test%"=="%objectcounter%" (goto :eof) else (goto :look.loop) )
rem set perspective[%look.seen%]=%look.counter%
rem set /a look.seen=look.seen+1
call :set mprop=%%type[%id%].properties%%
set prop=0
call :look.adj.loop
echo There is a %list%%name% %location%.
set look.test=%look.counter%
goto :look.loop

:look.adj.loop
if "%prop%"=="%mprop%" (goto :eof)
set /a prop=prop+1
call :set adj=%%object[%look.counter%].property[%prop%]%%
call :set adj=%%console.type[%id%].property[%prop%].adjective[%adj%]%%
if not "%adj%"=="" (set list=%list%%adj% )
goto :look.adj.loop

:hook.handle
for /f "tokens=1,2,3" %%f in ("%*") do (
set verb=%%f
set direct=%%g
set indirect=%%h
)
call :set directis=%%object[%direct%]%%
if "%indirect%"=="" (
set punc=.
set indirectis=
) else (
set punc=.
call :set indirectis=%%object[%indirect%]%%
)
call :set event=%%hook.action[%verb%].using[%directis%%punc%%indirectis%]%%
call :event %event% %hook.controlgroup% %direct% %indirect%
goto :eof



:event
for /f "tokens=1,2,3,4" %%a in ("%*") do (
set $id=%%a
set $part[0]=%%b
set $part[1]=%%c
set $part[2]=%%d
)
call :set $sb=%%object[%$part[0]%]%%
call :set $ob=%%object[%$part[1]%]%%
call :set $in=%%object[%$part[2]%]%%
call :set $sb=%%console.type[%$sb%]%%
call :set $ob=%%console.type[%$ob%]%%
call :set $in=%%console.type[%$in%]%%
call :set $script=%%event[%$id%]%%
set $task=action
:event.scriptloop
set $char=%$script:~0,1%
set $script=%$script:~1%
call :event.script.track[%$task%]
if not "%$script%"=="" goto :event.scriptloop
goto :eof

:event.script.track[action]
if "%$char%"=="?" (set $task=getterm
set $purpose=lhs)
if "%$char%"=="!" (set $task=getterm
set $purpose=dataleft)
if "%$char%"=="~" (set $task=number
set $purpose=delete)
if "%$char%"==":" (set $task=number
set $purpose=speak)
if "%$char%"=="{" (
if "%$purpose%"=="testelse" (set /a $nest=$nest+1
call :set $layer[%%$nest%%]=else)
if "%$purpose%"=="skipelse" (set $task=skipbrace
set $brace=1
set $purpose=else)
)
set $num=
if "%$char%"=="}" (call :event.script.track[action].handlenest)
goto :eof

:event.script.track[action].handlenest
call :set $layer=%%$layer[%$nest%]%%
if "%$layer%"=="if" (set $purpose=skipelse) else (set $purpose=)
goto :eof

:event.script.track[getterm]
if "%$char%"=="@" (set $task=partnum)
if "%$char%"=="#" (if not "%$purpose%"=="dataleft" (
set $task=number))
goto :eof

:event.script.track[partnum]
if "%$char%"=="." (set $task=field
call :set $rid=%%$part[%$part%]%%
set $part=
goto :eof
)
set $part=%$part%%$char%
goto :eof

:event.script.track[field]
if "%$char%"=="$" (set $task=getslotid
set $dtype=property
goto :eof)
if "%$char%"=="!" (set $task=getslotid
set $dtype=state
goto :eof)
if "%$char%"=="#" (set $task=getslotid
set $dtype=value
goto :eof)
if "%$char%"=="@" (set $task=closeterm.id
goto :eof)
if "%$char%"=="." (set $hold=%$rid%
call :set $rid=%%object[%$rid%].pointer[%$point%]%%
set $pslot=%$point%
set $point=
goto :eof
)
set $point=%$point%%$char%
goto :eof

:event.script.track[getslotid]
if "%$purpose%"=="lhs" (
if "%$char%"=="=" (goto :event.script.track[closeterm])
if "%$char%"=="~" (goto :event.script.track[closeterm])
)
if "%$purpose%"=="rhs" (if "%$char%"=="{" (goto :event.script.track[closeterm]))
if "%$purpose%"=="dataright" (if "%$char%"==";" (goto :event.script.track[closeterm]))
if "%$purpose%"=="dataleft" (
if "%$char%"=="=" (goto :event.script.track[close[dataleft]])
if "%$char%"=="+" (goto :event.script.track[close[dataleft]])
if "%$char%"=="-" (goto :event.script.track[close[dataleft]])
)
set $slotid=%$slotid%%$char%
goto :eof

:event.script.track[number]
if "%$purpose%"=="lhs" (
if "%$char%"=="=" (goto :event.script.track[closeterm])
if "%$char%"=="~" (goto :event.script.track[closeterm])
)
if "%$purpose%"=="rhs" (if "%$char%"=="{" (goto :event.script.track[close[rhs]]))
if "%$purpose%"=="speak" (if "%$char%"==";" (goto :event.script.track[close[speak]]))
if "%$purpose%"=="delete" (if "%$char%"==";" (goto :event.script.track[close[delete]]))
if "%$purpose%"=="dataright" (if "%$char%"==";" (goto :event.script.track[close[dataright]]))
set $num=%$num%%$char%
goto :eof

:event.script.track[closeterm]
call :set $num=%%object[%$rid%].%dtype%[%$slotid%]%%
if not "%$purpose%"=="dataleft%" (set $slotid=)
if "%$num%"=="" set $num=0
goto :event.script.track[close[%$purpose%]]

:event.script.track[closeterm.id]
set $num=%$rid%
if "%$purpose%"=="dataleft" (set $slotid=@)
goto :event.script.track[close[%$purpose%]]

:event.script.track[close[lhs]]
if "%$char%"=="=" (set $lhs.if=true) else (set $lhs.if=false)
set $lhs=%$num%
set $num=
set $purpose=rhs
set $task=getterm
goto :eof

:event.script.track[close[rhs]]
if "%$num%"=="%$lhs%" (set $num=true) else (set $num=false)
if "%$num%"=="%$lhs.if%" (set /a $nest=$nest+1
set $task=action
call :set $layer[%%$nest%%]=if) else (
set $task=skipbrace
set $brace=1
set $purpose=if)
goto :eof

:event.script.track[skipbrace]
if "%$char%"=="{" (set /a $brace=$brace+1)
if "%$char%"=="}" (set /a $brace=$brace-1)
if "%$brace%"=="0" (set $task=action
if "%$purpose%"=="if" (set $purpose=testelse) else (set $purpose=))
goto :eof

:event.script.track[close[dataleft]]
if "%$slotid%"=="@" (set $target.slot=%$pslot%
set $target.id=%$hold%
set $dtype=pointer
) else (
set $target.id=%$rid%
set $target.slot=%$slotid%
)
call :set $num=%%object[%$target.id%].%$dtype%[%$slotid%]%%
if "%$char%"=="="(set /a $base=) else (
if "%$char%"=="+"(set /a $base=$num) else (
if "%$char%"=="-"(set /a $base=$num*-1)))
set $num=
set $slotid=
set $purpose=dataright
set $task=getterm
goto :eof

:event.script.track[close[dataright]]
set /a object[%$target.id%].%dtype%[%$target.slot%]=$base+$num
set $num=
set $part=
set $slotid=
set $task=action
set $purpose=
goto :eof

:event.script.track[close[speak]]
call :set $output=%%event[%$id%].output[%$num%]%%
call :set $output=%%$output:$ob=%$ob%%%
call :set $output=%%$output:$sb=%$sb%%%
if not "%$in%"=="" (call :set $output=%%$output:$in=%$in%%%)
echo %$output%
set $task=action
set $purpose=
set $num=
goto :eof

:event.script.track[close[delete]]
call :set $num=%%$part[%$num%]%%
call :destroy %$num%
set $task=action
set $purpose=
set $num=
goto :eof

:destroy
for /f "tokens=1 delims==" %%f in ('set object[%*]') do (
set %%f=)
goto :eof

:interpret
set $string=%*
call :token 1 $verb=%$string%
call :set $command=%%interpret.hook.command[%$verb%]%%
if "%$command%"=="1" (goto :look)
if "%$command%"=="2" (goto :debug)
call :set $verb=%%interpret.hook.action[%$verb%]%%
set $parse=2
call :interpret.getobject
if "%$error%"=="1" (echo There doesn't seem to be any of those
goto :eof)
if "%$error%"=="2" (echo There is more than one of those
goto :eof)
set $direct=%$return%

call :token %$parse% $trans=%$string%
if "%$trans%"=="" (set $indirect=
call :hook.handle %$verb% %$direct%
goto :eof)
call :set $trans=%%interpret.lang.transterm[%$trans%]%%
set /a $parse=$parse+1
call :interpret.getobject
if "%$error%"=="1" (echo There doesn't seem to be any of those
goto :eof)
if "%$error%"=="2" (echo There is more than one of those
goto :eof)
set $indirect=%$return%
call :hook.handle %$verb% %$direct% %$indirect%
goto :eof

:interpret.getobject
set $error=0
set $isexp=true
call :token %$parse% $choicetype=%$string%
call :set $choicetype=%%interpret.lang.choicetype[%$choicetype%]%%
if "%$choicetype%"=="" (set $choicetype=1) else (set /a $parse=$parse+1)
set $transcheck=%$parse%
call :interpret.getobject.transloop
set /a $transcheck=$transcheck-1
call :token %$transcheck% $noun=%$string%
call :set $type=%%interpret.type[%$noun%]%%
if "%$transcheck%"=="%$parse%" (set $isexp=) else (call :interpret.getobject.adjloop)
set /a $parse=$parse+1
set $success=0
for /f "tokens=1* delims==" %%f in ('set object[') do (
for /f "tokens=2,3 delims=[]" %%h in ("%%f") do (set $test=%%h
set $junk=%%i)
set $testtype=%%g
call :interpret.getobject.compare)
if "%$success%"=="0" (set $error=1
goto :eof)
call :interpret.getobject.type[%$choicetype%]
for /f "tokens=1 delims==" %%f in ('set $success') do (
set %%f=
)
goto :eof

:interpret.getobject.type[1]
if not "%$success%"=="1" (set $error=2
goto :eof)
:interpret.getobject.type[2]
call :set $return=%%$success[1]%%
goto :eof

:interpret.getobject.type[3]
call :random $success=1 %$success%
call :set $return=%%$success[%$success%]%%
goto :eof

:interpret.getobject.compare
if not "%$junk%"=="" (goto :eof)
if not "%$testtype%"=="%$type%" goto :eof
set $failed=0
if "%$isexp%"=="true" (
 for /f "tokens=1* delims==" %%f in ('set $describe[') do (set $lhs=%%f
 set $rhs=%%g
 call :interpret.getobject.compare.test)
)
if "%$failed%"=="0" (set /a $success=$success+1
call :set $success[%%$success%%]=%$test%)
goto :eof

:interpret.getobject.compare.test
for /f "tokens=2 delims=[]" %%f in ("%$lhs%") do (set $lhs=%%f)
call :set $lhs=%%object[%$test%].property[%$lhs%]%%
if not "%$lhs%"=="%$rhs%" set $failed=1
goto :eof


:interpret.getobject.adjloop
if "%$parse%"=="%$transcheck%" goto :eof
call :token %$parse% $adjective=%$string%
call :set $property=%%interpret.adjective[%$adjective%].type[%$type%].property%%
call :set $adjective=%%interpret.adjective[%$adjective%].type[%$type%]%%
set $describe[%$property%]=%$adjective%
set /a $parse=$parse+1
goto :interpret.getobject.adjloop


:interpret.getobject.transloop
set /a $transcheck=$transcheck+1
set $attempt=
call :token %$transcheck% $attempt=%$string%
if "%$attempt%"=="" goto :eof
call :set $attempt=%%interpret.lang.transterm[%$attempt%]%%
if not "%$attempt%"=="" goto :eof
goto :interpret.getobject.transloop





:type.giveproperty
for /f "tokens=1,2*" %%f in ("%*") do (set $type=%%f
set $property=%%g
set $list=%%h
)
call :set $type=%%interpret.type[%$type%]%%
call :set $props=%%type[%$type%].properties%%
set /a $props=$props+1
set type[%$type%].properties=%$props%
set debug.type[%$type%].property[%$property%]=%$props%
set debug.type[%$type%].property[%$props%].name=%$property%
set $value=
:type.giveproperty.adjloop
for /f "tokens=1* delims=, " %%f in ("%$list%") do (
set $adj=%%f
set $list=%%g
)
set /a $value=$value+1
set interpret.adjective[%$adj%].type[%$type%]=%$value%
set interpret.adjective[%$adj%].type[%$type%].property=%$props%
set console.type[%$type%].property[%$props%].adjective[%$value%]=%$adj%
if not "%$list%"=="" goto :type.giveproperty.adjloop
set type[%$type%].property[%$props%].highest=%$value%
goto :eof


:type.givestate
for /f "tokens=1,2,3,4" %%f in ("%*") do (set $type=%%f
set $state=%%g
set $zero=%%h
set $one=%%i
)
call :set $type=%%interpret.type[%$type%]%%
call :set $states=%%type[%$type%].states%%
set /a $states=$states+1
set type[%$type%].states=%$states%
set debug.type[%$type%].state[%$state%]=%$states%
set debug.type[%$type%].state[%$states%].name=%$state%

set interpret.adjective[%$zero%].type[%$type%]=0
set interpret.adjective[%$zero%].type[%$type%].state=%$states%
set console.type[%$type%].state[%$states%].adjective[0]=%$zero%
set interpret.adjective[%$one%].type[%$type%]=1
set interpret.adjective[%$one%].type[%$type%].state=%$states%
set console.type[%$type%].state[%$states%].adjective[1]=%$one%

goto :eof

:type.givevalue
for /f "tokens=1,2*" %%f in ("%*") do (set $type=%%f
set $value=%%g
)
call :set $type=%%interpret.type[%$type%]%%
call :set $values=%%type[%$type%].values%%
set /a $values=$values+1
set type[%$type%].values=%$values%
set debug.type[%$type%].value[%$value%]=%$values%
set debug.type[%$type%].value[%$values%].name=%$value%
set $value=
goto :eof

:type.givepointer
for /f "tokens=1,2*" %%f in ("%*") do (set $type=%%f
set $pointer=%%g
set $pointtype=%%h
)
call :set $type=%%interpret.type[%$type%]%%
call :set $pointid=%%interpret.type[%$pointtype%]%%
call :set $points=%%type[%$type%].pointers%%
set /a $points=$points+1
set type[%$type%].pointers=%$points%
set debug.type[%$type%].pointer[%$pointer%]=%$points%
set debug.type[%$type%].pointer[%$points%].name=%$pointer%
set type[%$type%].pointer[%$points%]=%$pointid%
goto :eof

:type.expand
set type[%2].super=%1
call :set type[%1].sub=%%type[%1].sub%%%2;
set $counter=
call :set $max=%%type[%1].properties%%
call :type.expand.property %*
set type[%2].properties=%$max%

set $counter=
call :set $max=%%type[%1].states%%
call :type.expand.state %*
set type[%2].states=%$max%

set $counter=
call :set $max=%%type[%1].values%%
call :type.expand.value %*
set type[%2].values=%$max%

set $counter=
call :set $max=%%type[%1].pointers%%
call :type.expand.pointer %*
set type[%2].pointers=%$max%

goto :eof

:type.expand.property
if "%$counter%"=="%$max%" goto :eof
set /a $counter=$counter+1
set $adjcounter=
call :set $adjmax=%%type[%1].property[%$counter%].highest%%
:type.expand.property.value
set /a $adjcounter=$adjcounter+1
call :set $term=%%console.type[%1].property[%$counter%].adjective[%$adjcounter%]%%
set interpret.adjective[%$term%].type[%2]=%$adjcounter%
set interpret.adjective[%$term%].type[%2].property=%$counter%
set console.type[%2].property[%$counter%].adjective[%$adjcounter%]=%$term%
if not "%$adjcounter%"=="%$adjmax%" goto :type.expand.property.value
set type[%2].property[%$counter%].highest=%$adjmax%
call :set $debug=%%debug.type[%1].property[%$counter%].name%%
set debug.type[%2].property[%$debug%]=%$counter%
set debug.type[%2].property[%$counter%].name=%$debug%
goto :type.expand.property

:type.expand.state
if "%$counter%"=="%$max%" goto :eof
set /a $counter=$counter+1
call :set $term=%%console.type[%1].state[%$counter%].adjective[0]%%
set interpret.adjective[%$term%].type[%2]=0
set interpret.adjective[%$term%].type[%2].state=%$counter%
set console.type[%2].state[%$counter%].adjective[0]=%$term%
call :set $term=%%console.type[%1].state[%$counter%].adjective[1]%%
set interpret.adjective[%$term%].type[%2]=1
set interpret.adjective[%$term%].type[%2].state=%$counter%
set console.type[%2].state[%$counter%].adjective[1]=%$term%
call :set $debug=%%debug.type[%1].state[%$counter%].name%%
set debug.type[%2].state[%$debug%]=%$counter%
set debug.type[%2].state[%$counter%].name=%$debug%
goto :type.expand.state

:type.expand.value
if "%$counter%"=="%$max%" goto :eof
set /a $counter=$counter+1
call :set $debug=%%debug.type[%1].value[%$counter%].name%%
set debug.type[%2].value[%$debug%]=%$counter%
set debug.type[%2].value[%$counter%].name=%$debug%
goto :type.expand.value

:type.expand.pointer
if "%$counter%"=="%$max%" goto :eof
set /a $counter=$counter+1
call :set $debug=%%debug.type[%1].pointer[%$counter%].name%%
set debug.type[%2].pointer[%$debug%]=%$counter%
set debug.type[%2].pointer[%$counter%].name=%$debug%
call :set type[%2].pointer[%$counter%]=%%type[%1].pointer[%$counter%]%%
goto :type.expand.pointer

:token
for /f "tokens=1*" %%f in ("%*") do (
set token.num=%%f
set token.remainder=%%g
)
for /f "tokens=1* delims==" %%f in ("%token.remainder%") do (
set token.var=%%f
set token.remainder=%%g
)
for /f "tokens=%token.num%" %%f in ("%token.remainder%") do (set %token.var%=%%f)
goto :eof

:random
for /f "tokens=1* delims==" %%f in ("%*") do (
set random.var=%%f
set random.max=%%g
)
for /f "tokens=1*" %%f in ("%random.max%") do (
set random.min=%%f
set random.max=%%g
)
set /a %random.var%=(random.max-random.min+1)*%random%/32768+random.min
set random.var=
set random.min=
set random.max=
goto :eof

:set
set %*
goto :eof

:pexit
if not "%*"=="" (echo %*)
echo Press any key to exit . . .
pause>nul
exit

rem ### File Reader ###

:readline
set steeze=%*
set steeze=%steeze:~1%
title %steeze%
set indent=0
call :readline.indent
if %indent% gtr %layer% goto :eof
if %indent% lss %layer% call :readline.lowerindent
goto :readline.seek[%purpose%]

:readline.indent
set bit=%steeze:~0,1%
if not "%bit%"==" " goto :eof
set /a indent=indent+1
set steeze=%steeze:~1%
goto :readline.indent

:readline.lowerindent
call :set last=%%layer[%layer%]%%
call :readline.close[%purpose%]
set /a layer=layer-1
if %indent% lss %layer% goto :readline.lowerindent
call :set purpose=%%purpose[%layer%]%%
goto :eof

:readline.seek[root]
for /f "tokens=1*" %%f in ("%steeze%") do (set name=%%f
set steeze=%%g)
set purpose[0]=root
if "%name%"=="type" (goto :readline.open[typedata])
if "%name%"=="event" (goto :readline.open[eventdata])
if "%name%"=="reality" (set place=%steeze%
set purpose=reality
set purpose[0]=reality
goto :eof)
call :pexit How does do %steeze%?

:readline.open[typedata]
set /a layer=layer+1
set layer[%layer%]=%steeze%
set super=%this%
set this=%steeze%
if "%super%"=="" (set super=nul)
call :set superid=%%interpret.type[%super%]%%
set /a dream.environment.types=dream.environment.types+1
set thisid=%dream.environment.types%
set interpret.type[%this%]=%thisid%
set console.type[%thisid%]=%this%
call :type.expand %superid% %thisid%
set safe=true
set purpose=typedata
set purpose[%layer%]=typedata
goto :eof

:readline.seek[typedata]
for /f "tokens=1*" %%f in ("%steeze%") do (set token=%%f
set steeze=%%g)
if "%token%"=="property" (call :type.giveproperty %this% %steeze%
goto :eof)
if "%token%"=="state" (call :type.givestate %this% %steeze%
goto :eof)
if "%token%"=="value" (call :type.givevalue %this% %steeze%
goto :eof)
if "%token%"=="pointer" (call :type.givepointer %this% %steeze%
goto :eof)
if "%token%"=="type" (goto :readline.open[typedata])
call :pexit What's a %token%?

:readline.close[typedata]
set safe=
set this=%super%
set thisid=%superid%
call :set superid=%%type[%thisid%].super%%
call :set super=%%console.type[%superid%]%%
goto :eof

:readline.open[eventdata]
for /f "tokens=1,2,3,4" %%a in ("%steeze%") do (
set name=%%a
set subject=%%b
set object=%%c
set instrument=%%d)
set layer=1
set layer[1]=
set /a dream.environment.events=dream.environment.events+1
set name[0]=%steeze%
set this=%steeze%
set purpose=eventdata
set purpose[1]=eventdata
set part[subject]=0
set part[object]=1
call :set type[0]=%%interpret.type[%subject%]%%
call :set type[1]=%%interpret.type[%object%]%%
set event[%dream.environment.events%].subject=%type[0]%
set event[%dream.environment.events%].object=%type[1]%
if not "%instrument%"=="" (
call :set type[2]=%%interpret.type[%instrument%]%%
set part[instrument]=2
set event[%dream.environment.events%].instrument=%type[2]%
)
set debug.event[%name%]=%dream.environment.events%
goto :eof

:readline.seek[eventdata]
for /f "tokens=1*" %%f in ("%steeze%") do (set token=%%f
set steeze=%%g)
if "%token%"=="if" (goto :readline.event.if)
if "%token%"=="destroy" (goto :readline.event.destroy)
rem if "%token%"=="make" (goto :readline.event.make)
if "%token%"=="print" (goto :readline.event.print)
if "%token%"=="define" (goto :readline.event.set.basic)
if "%token%"=="align" (goto :readline.event.set.dynamic)
if "%token%"=="set" (set op==
goto :readline.event.set.value)
if "%token%"=="increase" (set op=+
goto :readline.event.set.value)
if "%token%"=="decrease" (set op=-
goto :readline.event.set.value)
if "%token%"=="else" (if "%else%"=="true" (
set code=%code%{
set /a layer=layer+1
call :set layer[%%layer%%]=else
call :set purpose[%%layer%%]=eventdata
goto :eof
))
call :pexit How does expect %token%?

:readline.close[eventdata]
if not "%last%"=="" (
set code=%code%}
if "%last%"=="if" (set else=true) else (set else=)
goto :eof)
set event[%dream.environment.events%]=%code%
set code=
set event.outputcounter=
goto :eof

:readline.event.if
set code=%code%?
for /f "tokens=1-2,3*" %%a in ("%steeze%") do (
 if "%%b"=="not" (
  set useop=~
  set steeze=%%a %%c
 ) else (
  set useop==
 )
)
for /f "tokens=1,2,3*" %%h in ("%steeze%") do (
set lhs=%%h
set compareop=%%i
set rhs=%%j
set junk=%%k
)
set /a layer=layer+1
set layer[%layer%]=if
set purpose[%layer%]=eventdata
if "%compareop%"=="mirrors" goto :readline.event.if.dynamic
if "%compareop%"=="equals" goto :readline.event.if.direct
call :readline.event.giveterm %lhs% %rhs%
if "%compareop%"=="is" (set code=%code%=) else (
  call :pexit Which way is %compareop%?
)
call :readline.event.closeterm
set code=%code%{
goto :eof

:readline.event.if.dynamic
call :readline.event.giveterm %lhs%
set code=%code%%useop%
call :readline.event.giveterm %rhs%
set code=%code%{
goto :eof

:readline.event.if.direct
call :readline.event.giveterm %lhs%
set code=%code%%useop%#%rhs%{
goto :eof

:readline.event.destroy
set code=%code%~
for /f "tokens=1,2" %%f in ("%steeze%") do (
 set part=%%f
 set discard=%%g
)
if not "%discard%"=="" (
call :pexit Kill a %part% what?
)
if "%part%"=="object" (set code=%code%1) else (
 if "%part%"=="instrument" (set code=%code%2) else (
  call :pexit Which one is the %part%?
 )
)
set code=%code%;
goto :eof



:readline.event.print
set /a event.outputcounter=event.outputcounter+1
set event[%dream.environment.events%].output[%event.outputcounter%]=%steeze%
set code=%code%:%event.outputcounter%;
goto :eof

:readline.event.set.basic
set code=%code%!
for /f "tokens=1,2,3*" %%a in ("%steeze%") do (
set left=%%a
if "%%b"=="as" (set right=%%c) else (set right=%%b)
)
call :readline.event.giveterm %left% %right%
set code=%code%=
call :readline.event.closeterm
set code=%code%;
goto :eof

:readline.event.set.dynamic
set code=%code%!

for /f "tokens=1,2,3*" %%a in ("%steeze%") do (
set left=%%a
if "%%b"=="with" (set right=%%c) else (set right=%%b)
)
call :readline.event.giveterm %left%
set code=%code%=
call :readline.event.giveterm %right%set code=%code%;
goto :eof

:readline.event.set.value
set code=%code%!
if "%op%"=="=" (set read=to) else (set read=by)
for /f "tokens=1,2,3*" %%a in ("%steeze%") do (
set left=%%a
if "%%b"=="%read%" (set right=%%c) else (set right=%%b)
)
call :readline.event.giveterm %left%
set code=%code%%op%#%right%
set code=%code%;
goto :eof



:readline.event.giveterm
for /f "tokens=1* delims=." %%f in ("%1") do (
set partname=%%f
set array=%%g
)
set code=%code%@
call :readline.event.givepart %partname%
call :set cid=%%type[%part%]%%
call :readline.event.giveterm.pointloop %2
if "%2"=="" (goto :eof)
call :set property=%%interpret.adjective[%2].type[%cid%].property%%
if not "%property%"=="" (set code=%code%.$%property%
call :set property=%%interpret.adjective[%2].type[%cid%]%%
goto :eof
)
call :set property=%%interpret.adjective[%2].type[%cid%].state%%
if not "%property%"=="" (set code=%code%.$%property%
call :set property=%%interpret.adjective[%2].type[%cid%]%%
goto :eof
)
call :pexit What's a %2?


:readline.event.giveterm.pointloop
if "%array%"=="" goto :eof
for /f "tokens=1* delims=." %%f in ("%array%") do (
set pointname=%%f
set array=%%g
)
if "%array%"=="" if "%1"=="" (goto :readline.event.giveterm.pointloop.test)
call :set pointid=%%debug.type[%cid%].pointer[%pointname%]%%
call :set cid=%%type[%cid%].pointer[%pointid%]%%
set code=%code%.%pointid%
goto :readline.event.giveterm.pointloop

:readline.event.giveterm.pointloop.test
if "%pointname%"=="type" (set value=%cid%
set code=%code%.*
)
call :readline.event.giveterm.pointloop.testvalue $ property
if not "%value%"=="" goto :eof
call :readline.event.giveterm.pointloop.testvalue ! state
if not "%value%"=="" goto :eof
call :readline.event.giveterm.pointloop.testvalue # value
if not "%value%"=="" goto :eof
call :set code=%code%.%%debug.type[%cid%].pointer[%pointname%]%%.@
goto :eof

:readline.event.giveterm.pointloop.testvalue
call :set value=%%debug.type[%cid%].%2[%pointname%]%%
if "%value%"=="" (goto :eof)
set code=%code%.%1%value%
goto :eof


:readline.event.closeterm
set code=%code%#%property%
goto :eof

:readline.event.givepart
call :set part=%%part[%*]%%
if "%part%"=="" (call :pexit Which one is a %*?)
set code=%code%%part%
goto :eof

:readline.seek[reality]
for /f "tokens=1*" %%f in ("%steeze%") do (set type=%%f
set debug=%%g
)
if "%type%"=="controlhook" (
call :set hook.controlgroup=%%debug.object[%debug%]%%
set purpose=hook
goto :eof)
call :set id=%%interpret.type[%type%]%%
if "%id%"=="" (call :pexit what's a %type%?)
set purpose=defineobject
set /a dream.environment.objects=dream.environment.objects+1
set object[%dream.environment.objects%]=%id%
set debug.object[%debug%]=%dream.environment.objects%
set /a layer=layer+1
set purpose[%layer%]=defineobject
goto :eof

:readline.close[defineobject]
goto :eof

:readline.seek[defineobject]
for /f "tokens=1*" %%f in ("%steeze%") do (set head=%%f
set foot=%%g)

set dtype=value
call :set slot=%%debug.type[%id%].value[%head%]%%
set data=%foot%
if not "%slot%"=="" goto :readline.defineobject

set dtype=pointer
call :set slot=%%debug.type[%id%].pointer[%head%]%%
call :set data=%%debug.object[%foot%]%%
if not "%slot%"=="" (if "%data%"=="" (call :pexit What %foot%?) else (goto :readline.defineobject))
call :set data=%%interpret.adjective[%head%].type[%id%]%%

set dtype=state
call :set slot=%%interpret.adjective[%head%].type[%id%].state%%
if not "%slot%"=="" goto :readline.defineobject

set dtype=property
call :set slot=%%interpret.adjective[%head%].type[%id%].property%%
if not "%slot%"=="" goto :readline.defineobject

call :pexit What kind of thing is %head%?
:readline.defineobject
if "%dtype%"=="pointer" call :readline.defineobject.test
set object[%dream.environment.objects%].%dtype%[%slot%]=%data%
goto :eof

:readline.defineobject.test
call :set test=%%object[%data%]%%
call :set right=%%type[%id%].pointer[%slot%]%%
:readline.defineobject.test.loop
if "%test%"=="%right%" goto :eof
call :set test=%%type[%test%].super%%
if "%test%"=="0" (call :pexit What kind of %right% is a %%object[%data%]%%?
goto :readline.defineobject.test.loop

:readline.close[hook]
goto :eof

:readline.seek[hook]
for /f "tokens=1*" %%f in ("%steeze%") do (
set verb=%%f
set eventname=%%g
)
call :set event=%%debug.event[%eventname%]%%
if "%event%"=="" (call :pexit How do I %eventname%?)
call :set action=%%interpret.hook.action[%verb%]%%
if "%action%"=="" (set /a hook.actions=hook.actions+1
call :set action=%%hook.actions%%)
set interpret.hook.action[%verb%]=%action%
call :set ob=%%event[%event%].object%%
call :set in=%%event[%event%].instrument%%
if "%in%"=="" (call :readline.seek.hook.ob
goto :eof)
call :readline.seek.hook.in
call :readline.seek.hook.ob
set in.touse=
goto :eof


:readline.seek.hook.ob.mark
if "%ob.tosub%"=="" goto :eof
for /f "tokens=1* delims=;" %%f in ("%ob.tosub%") do (set ob=%%f
set ob.tosub=%%g
)

:readline.seek.hook.ob
call :readline.seek.hook.roll
call :set ob.sub=%%type[%ob%].sub%%
set ob.tosub=%ob.tosub%%ob.sub%
goto :readline.seek.hook.ob.mark



:readline.seek.hook.in.mark
if "%in.tosub%"=="" goto :eof
for /f "tokens=1* delims=;" %%f in ("%in.tosub%") do (set in=%%f
set in.tosub=%%g
)

:readline.seek.hook.in
call :set in.sub=%%type[%in%].sub%%
set in.tosub=%in.tosub%%in.sub%
set in.touse=%in.touse%%in.sub%
goto :readline.seek.hook.in.mark

:readline.seek.hook.roll
if "%in.touse%"=="" (set hook.action[%action%].using[%ob%.]=%event%
goto :eof)
set touse=%in.touse%
:readline.seek.hook.rolling
for /f "tokens=1* delims=;" %%f in ("%touse%") do (set in=%%f
set touse=%%g
)
set hook.action[%action%].using[%ob%,%in%]=%event%
if "%touse%"=="" goto :eof
goto :readline.seek.hook.rolling

That's version 0.3.1, I have some documentation and stuff if anyone is actually interested
Title: Re: Batch Programs Thread.
Post by: millergram on January 07, 2014, 01:39:33 PM
Hey guys. I really like RPS (Rock Paper Scissors) so here is another one.

Code: [Select]
@Echo off
rem RPS by ChaviusMiller


rem this is the Title line
title RPS
rem this line defines user/AI information
set UC=
set AIC=
set User=
set TW=0
set TL=0
rem "UC" is user choice "AIC" is AI choice "User" username "TW" times won "TL" times lost
set /p User=Username=
rem above line prompts for what to specific value "User" as
:main
rem above line specifies the beggining of the part of the script that will be recalled
cls
echo.Welcome %User%
echo.
echo.This is Rock Paper Scissors(RPS).
echo.
echo.Please choose a stance R=rock P=paper S=scissors
echo.
echo.Computer %TL% %User% %TW%
set /p UC=RPS!:
if /i "%UC%"=="debug" goto debug
if /i "%UC%"=="r" goto rock
if /i "%UC%"=="p" goto paper
if /i "%UC%"=="s" goto scissor
if /i "%UC%"=="%UC%" goto main
rem above lines filter "UC" for its choices
rem last line for "if /i "US"=="%UC%" goto main" says if none of the above options are not chosen then by default it goes back to the beggining
:rock
rem below sets Aic to equal a random number between 1-3
set UC=1
set /a AIC=%random% %%3 + 1
goto calculateR
:paper
set UC=2
set /a AIC=%random% %%3 + 1
goto calculateP
:scissor
set UC=3
set /a AIC=%random% %%3 + 1
goto calculateS
:calculateR
if "%AIC%"=="1" goto tie
if "%AIC%"=="2" goto loss
if "%AIC%"=="3" goto win
:calculateP
if "%AIC%"=="1" goto win
if "%AIC%"=="2" goto tie
if "%AIC%"=="3" goto loss
:calculateS
if "%AIC%"=="1" goto loss
if "%AIC%"=="2" goto win
if "%AIC%"=="3" goto tie
:loss
set /a TL=%TL%+1
Echo.Sorry you loose!
echo.
echo.Computer %TL% %User% %TW%
pause
goto main
:win
set /a TW=%TW%+1
echo.You win!
echo.
echo.Computer %TL% %User% %TW%
pause
goto main
:tie
echo.You tied!
echo.
echo.Computer %TL% %User% %TW%
pause
goto main
:debug
set /a AIC=%random% %%3 + 1
echo.%AIC%
goto debug

Also this may be my best yet.
Wondering what to do now that RPS is understood ???
Title: Re: Batch Programs Thread.
Post by: spivee on January 11, 2014, 06:18:48 PM
Quote
Also this may be my best yet.
Wondering what to do now that RPS is understood ???

You could make this more dynamical... else when I have no projects to work on, I usually make subroutines that I might want to use later.
Title: Re: Batch Programs Thread.
Post by: Geek-9pm on January 11, 2014, 07:36:27 PM
Your main batch can call other batch files and pass parameters. This makers a job of writing  new programs easier.  :)
You may wish to adopt a naming convention that reminds your that a batch file is meant to be called as a subroutine with parameters. Underscore works.
Example:
rummy.bat
poker.bat
_random.bat
_rank.bat
_score.bat

This first two are main program files. The  others are subroutines  used by loth of the main programs. If the subroutines are generalized, such  can be used again in other game programs. Creating  meaningful names helps.  No, not the computer - it helps you remember what it does.  8)
Title: Re: Batch Programs Thread.
Post by: simplyTechy100 on March 06, 2014, 08:43:09 PM
@echo off
set /p dir=Directory path:
if %dir% == 'C:/' echo %date% %time% - Attempt to access root drive > prg.log else goto sw
:sw
echo Use the help given below for switches. Make sure to include this character:
type chr/special/forsl.txt
echo.
dir /?
set /p sw=Switchs:
if sw = '' dir %dir% /4 else dir %dir% %sw%
Yes, that is my code..
I know its messy...
And chr/special/forsl.txt is just a / xD
And btw I can't get this script to work :( :||x :||
Title: Re: Batch Programs Thread.
Post by: Lemonilla on March 07, 2014, 06:57:54 PM
I wrote a simple Tower Defense game.  I may get around to adding other things to it, but probable not, so I figured I'd post it for anyone else.

Code: (def.bat) [Select]
@echo off
setlocal EnableDelayedExpansion
title Turret Defense

echo Installing. . .
if not exist def_bin md def_bin
cd def_bin
if not exist path for %%A in (-2.4\1 -1.4\2 1.4\3 2.4\4 3.4\5 4.4\6 4.3\7 4.2\8 4.1\9 5.1\10 6.1\11 7.1\12 8.1\13 8.2\14 8.3\15 8.4\16 8.5\17 8.6\18 9.6\19 10.6\20 11.6\21 12.6\22 13.6\23 14.6\24 14.5\25 14.4\26 15.4\27 16.4\28 17.4\29 18.4\30 18.3\31 19.3\32 20.3\33 20.4\34 20.5\35 21.5\36 22.5\37 23.5\38 23.4\39 24.4\40 25.4\41 26.4\42) do echo %%A >>path
cls


set range=10
set turn=1
set life=9
set error=
set wave.size=5
set wave.spacing=3
set turn.delay=1
set color.flash=6
set color.norm=7
set hp.multip=2
set turret.cost=30
set /a gold.plus=%turret.cost%/2

call :new_game
:loop
call :turn
:end_turn
call :wave
:end_wave
set /a turn+=1
goto :loop

:new_game
for /f "delims=" %%A in ('dir turret* /b') do del /f %%A
for /l %%Y in (1,1,7) do (
for /l %%X in (1,2,26) do (
set "cord.%%X.%%Y=."
)
for /l %%X in (0,2,26) do (
set "cord.%%X.%%Y= "
)
)
for %%A in (1.4 2.4 3.4 4.4 4.3 4.2 4.1 5.1 6.1 7.1 8.1 8.2 8.3 8.4 8.5 8.6 9.6 10.6 11.6 12.6 13.6 14.6 14.5 14.4 15.4 16.4 17.4 18.4 18.3 19.3 20.3 20.4 20.5 21.5 22.5 23.5 23.4 24.4 25.4 26.4) do set "cord.%%A="
for /l %%P in (1,1,42) do set "path.%%P=0"
set gold=30
set turret=1
goto :eof

:map
REM pause
cls
:load_map
if "%life:~2,1%"=="" (
if not "%life:~1,1%"=="" (
set "life.backSpace="
set "life.backSpace2=."
) else (
set "life.backSpace=."
set "life.backSpace2=."
)
) else (
set "life.backspace2="
set "life.backspace="
)
set "lin.01=  A B C D E F G H I J K L M"
set "lin.02=# . . . . . . . . . . . . . #%turn%"
set "lin.03=###############################"
set "lin.1=# %cord.1.1%%cord.2.1%%cord.3.1%%path.9%%path.10%%path.11%%path.12%%path.13%%cord.9.1%%cord.10.1%%cord.11.1%%cord.12.1%%cord.13.1%%cord.14.1%%cord.15.1%%cord.16.1%%cord.17.1%%cord.18.1%%cord.19.1%%cord.20.1%%cord.21.1%%cord.22.1%%cord.23.1%%cord.24.1%%cord.25.1%%cord.26.1%#..1"
set "lin.2=# %cord.1.2%%cord.2.2%%cord.3.2%%path.8%%cord.5.2%%cord.6.2%%cord.7.2%%path.14%%cord.9.2%%cord.10.2%%cord.11.2%%cord.12.2%%cord.13.2%%cord.14.2%%cord.15.2%%cord.16.2%%cord.17.2%%cord.18.2%%cord.19.2%%cord.20.2%%cord.21.2%%cord.22.2%%cord.23.2%%cord.24.2%%cord.25.2%%cord.26.1%#..2"
set "lin.3=# %cord.1.3%%cord.2.3%%cord.3.3%%path.7%%cord.5.3%%cord.6.3%%cord.7.3%%path.15%%cord.9.3%%cord.10.2%%cord.11.3%%cord.12.2%%cord.13.3%%cord.14.3%%cord.15.3%%cord.16.3%%cord.17.3%%path.31%%path.32%%path.33%%cord.21.3%%cord.22.3%%cord.23.3%%cord.24.3%%cord.25.3%%cord.26.3%#..3"
set "lin.4=%path.1%%path.2%%path.3%%path.4%%path.5%%path.6%%cord.5.4%%cord.6.4%%cord.7.4%%path.16%%cord.9.4%%cord.10.4%%cord.11.4%%cord.12.4%%cord.13.4%%path.26%%path.27%%path.28%%path.29%%path.30%%cord.19.4%%path.34%%cord.21.4%%cord.22.4%%path.39%%path.40%%path.41%%path.42%%life%%life.backSpace%%life.backSpace2%4"
set "lin.5=# %cord.1.5%%cord.2.5%%cord.3.5%%cord.4.5%%cord.5.5%%cord.6.5%%cord.7.5%%path.17%%cord.9.5%%cord.10.5%%cord.11.5%%cord.12.5%%cord.13.5%%path.25%%cord.15.5%%cord.16.5%%cord.17.5%%cord.18.5%%cord.19.5%%path.35%%path.36%%path.37%%path.38%%cord.24.5%%cord.25.5%%cord.26.5%#..5"
set "lin.6=# %cord.1.6%%cord.2.6%%cord.3.6%%cord.4.6%%cord.5.6%%cord.6.6%%cord.7.6%%path.18%%path.19%%path.20%%path.21%%path.22%%path.23%%path.24%%cord.15.6%%cord.16.6%%cord.17.6%%cord.18.6%%cord.19.6%%cord.20.6%%cord.21.6%%cord.22.6%%cord.23.6%%cord.24.6%%cord.25.6%%cord.26.6%#..6"
set "lin.7=# %cord.1.7%%cord.2.7%%cord.3.7%%cord.4.7%%cord.5.7%%cord.6.7%%cord.7.7%%cord.8.7%%cord.9.7%%cord.10.7%%cord.11.7%%cord.12.7%%cord.13.7%%cord.14.7%%cord.15.7%%cord.16.7%%cord.17.7%%cord.18.7%%cord.19.7%%cord.20.7%%cord.21.7%%cord.22.7%%cord.23.7%%cord.24.7%%cord.25.7%%cord.26.7%#..7"
set "lin.8=################################"

:draw_map
echo %lin.01%
echo %lin.02%
echo %lin.03%
echo %lin.1%
echo %lin.2%
echo %lin.3%
echo %lin.4%
echo %lin.5%
echo %lin.6%
echo %lin.7%
echo %lin.8%

goto :eof

:turn

call :map
echo Gold: %gold%g
echo.%error%
echo.
echo.  buy ^<X.Y^> %turret.cost%g Buys a turret and installs it to (X,Y).
echo.  sell ^<X.Y^> %gold.plus%g Sells the turret at (X,Y).
echo.  pass Ends the buying/selling phase.
set /p cmd=^>
echo. Processing Command. Please wait. . .
for /f "delims= " %%A in ("%cmd%") do call :%%A
goto :turn

:buy
set /a gold-=%turret.cost%
if %gold% LSS 0 (
set /a gold+=%turret.cost%
) else (
for /f "tokens=2 delims= " %%S in ("%cmd%") do (
for /f "tokens=1,2 delims=." %%A in ("%%S") do (

if /i "%%A"=="a" set A=1
if /i "%%A"=="b" set A=3
if /i "%%A"=="c" set A=5
if /i "%%A"=="d" set A=7
if /i "%%A"=="e" set A=9
if /i "%%A"=="f" set A=11
if /i "%%A"=="g" set A=13
if /i "%%A"=="h" set A=15
if /i "%%A"=="i" set A=17
if /i "%%A"=="j" set A=19
if /i "%%A"=="k" set A=21
if /i "%%A"=="l" set A=23
if /i "%%A"=="m" set A=25

if defined cord.!A!.%%B set cord.!A!.%%B=T
if "%%B"=="" (
set /a gold+=%turret.cost%
set error=Wrong Syntax
goto :eof
)
if "!A!"=="" (
set /a gold+=%turret.cost%
set error=Wrong Syntax
goto :eof
)
echo !A!.%%B >turret%turret%
call :Func_TurretRange !A! %%B
set /a turret+=1
)
)
)
set error=
goto :eof

:sell
for /f "tokens=2 delims= " %%S in ("%cmd%") do (
for /f "tokens=1,2 delims=." %%A in ("%%S") do (

if /i "%%A"=="a" set A=1
if /i "%%A"=="b" set A=3
if /i "%%A"=="c" set A=5
if /i "%%A"=="d" set A=7
if /i "%%A"=="e" set A=9
if /i "%%A"=="f" set A=11
if /i "%%A"=="g" set A=13
if /i "%%A"=="h" set A=15
if /i "%%A"=="i" set A=17
if /i "%%A"=="j" set A=19
if /i "%%A"=="k" set A=21
if /i "%%A"=="l" set A=23
if /i "%%A"=="m" set A=25


set sell=0
for /f "delims=" %%G in ('dir turret* /b') do (
set /p loc=<%%G
if "!loc!"=="!A!.%%B " (
del /f %%G
set /a gold+=!gold.plus!
set "cord.!A!.%%B=."
set sell=1
)
REM echo "!loc!"=="!A!.%%B"
)
)
)
if "%sell%"=="0" set error=No Turret Exists There.
goto :eof

:pass
goto :end_turn

:wave
:wave.setup
for /l %%A in (1,1,%wave.size%) do (
set /a creap%%A.hp=%turn%*%hp.multip%
if !creap%%A.hp! GTR 9 (
set creap%%A.sym=+
) else (
set creap%%A.sym=!creap%%A.hp!
)
set /a creap%%A.pos=%%A-%wave.size%
set /a creap%%A.pos*=%wave.spacing%
)


:wave.start
REM Define Creap HP
for /f "tokens=1 delims==" %%A in ('set creap ^| find ".sym"') do (
for /f "tokens=1 delims=." %%B in ("%%A") do (
for /f "tokens=2 delims=p" %%C in ("%%B") do (
if !creap%%C.hp! GTR 9 (
set creap%%C.sym=+
) else (
set creap%%C.sym=!creap%%C.hp!
) 2>nul
) 2>nul
) 2>nul
) 2>nul



REM Move creaps
for /f "tokens=1,2 delims==" %%A in ('set creap ^| find ".pos"') do (
set /a %%A=%%B+1
REM echo set /a %%A=%%B+1
for /f "tokens=2 delims=." %%G in ("%%A") do (
if %%B EQU 42 (
for /f "tokens=1 delims=." %%I in ("%%A") do (
for /f "tokens=2 delims=p" %%H in ("%%I") do (
set /a life-=!creap%%H.hp!
set creap%%H.hp=
set creap%%H.pos=
set creap%%H.sym=
) 2>nul
) 2>nul
) 2>nul
) 2>nul
) 2>nul

REM Kill Creaps
for /l %%A in (1,1,%wave.size%) do (
if "!creap%%A.hp!"=="0" (
set creap%%A.hp=
set creap%%A.pos=
set creap%%A.sym=
set /a gold.gain=%turn%/5
set /a gold+=%gold.gain%
) 2>nul
) 2>nul

REM Define new path variables
for /l %%A in (0,1,42) do set path.%%A=0
for /f "tokens=1,2 delims==" %%H in ('set creap ^| find ".pos"') do (
for /f "tokens=1 delims=." %%A in ("%%H") do (
for /f "tokens=2 delims=p" %%B in ("%%A") do (
set path.%%I=!creap%%B.sym!
) 2>nul
) 2>nul
) 2>nul

call :map


REM Fire Turrets
for /f "delims=" %%T in ('dir turret* /b') do (
for /f "skip=1" %%N in (%%T) do (
if not "!path%%N!"=="0" (
for /f "tokens=1,2 delims==" %%C in ('set creap ^| find ".pos"') do (
if "%%D"=="%%N" (
for /f "tokens=1 delims=." %%X in ("%%C") do (
for /f "tokens=2 delims=p" %%Z in ("%%X") do (
set /a creap%%Z.hp-=1
color 0%color.flash%
set flash=1
) 2>nul
) 2>nul
) 2>nul
if "!flash!"=="1" (
ping localhost -n 1 >nul 2>&1
ping localhost -n 1 >nul 2>&1
:: ping localhost -n 1 >nul 2>&1
color 0%color.norm%
call :map
set flash=0
) 2>nul
) 2>nul
) 2>nul
) 2>nul
) 2>nul


if %life% LEQ 0 goto :endgame


ping localhost -n %turn.delay% >nul


set creap>nul 2>&1 || (
set /a life.gain=%turn%/5
set /a life+=!life.gain!
goto :end_wave
)
goto :wave.start

:endgame
set "life=0"
call :map
echo.
echo You lose on turn %turn%.
pause>nul
exit

:Func_TurretRange
set startx=%1
set starty=%2
for /l %%A in (0,1,30) do (
for /l %%B in (0,1,10) do (
call :Func_TurretRange.check %%A %%B
)
)
set startx=
set starty=
goto :eof
:Func_TurretRange.check
set /a workingx=%startx%-%1
set /a workingy=%starty%-%2
if %workingx% LSS 0 set workingx=%workingx:~1%
if %workingy% LSS 0 set workingy=%workingy:~1%
set /a working=%workingx%+%workingy%
REM if %working% LSS %range% if %working% GTR 0 echo %1.%2 >>turret%turret%
if %working% LSS %range% if %working% GTR 0 for /f "tokens=1,2 delims=\" %%H in (path) do if /i "%1.%2"=="%%H" echo %%I >>turret%turret%
set working=
set workingx=
set workingy=
goto :eof

It will create a folder named def_bin as well as a file named "path" (with no extension).  Either of these can be deleted at any time.

Enjoy!
Title: Re: Batch Programs Thread.
Post by: foxidrive on March 07, 2014, 09:15:26 PM
I wrote a simple Tower Defense game.

title Turret Defense


Don't pass on your first move. :D
Title: Re: Batch Programs Thread.
Post by: Lemonilla on March 07, 2014, 09:44:59 PM
Don't pass on your first move. :D
I laughed so hard that I almost fell out of my chair.
If you change the global variable hp.multip to 1 you won't lose.  I set it to lose for testing and forgot to turn it back.
Title: Re: Batch Programs Thread.
Post by: foxidrive on March 07, 2014, 10:08:59 PM
:D    I changed that variable...

but I can't figure out what's what.  is an 0 a turret?  What's with all the numbers going along the stream?  Is that a ray gun?

I bought a turret at G.6 and nothing changed, except the ray gun stopped part way through and the screen colour changed to grey on black.
Title: Re: Batch Programs Thread.
Post by: Lemonilla on March 08, 2014, 08:56:10 AM
0 = Path the creeps take
. = Possible place to put a turret
T = Turret
# at the end of path = Life

If everything is working as it should, the screen should flash yellow every time a turret fires.  Reducing the number of the creep it hit by 1.  When the creep hits 0 it dies.

Also there is a bug around wave 7 if you stacking your turrets on each other where the creeps go negative hp and heal you when they get to the end.
Title: Re: Batch Programs Thread.
Post by: foxidrive on March 09, 2014, 12:41:21 AM
0 = Path the creeps take

Like my childhood bullies, eh? ;)

Quote from:
. = Possible place to put a turret

I put one where there was a creep.  Hopefully it squashed him!

Quote from:
If everything is working as it should, the screen should flash yellow every time a turret fires.

Hmm.  No colour changing here, the creep path had some numbers changing along it, but I couldn't figure out what it all means.
Title: Re: Batch Programs Thread.
Post by: Lemonilla on March 09, 2014, 08:28:24 AM
So one of my friends pointed out some bugs, and I think I fixed them all.
1) Turrets now shoot at the closest target only.
2) You can no longer buy a turret at "a.b".
3) Flash of turret fire is now a little more noticeable.

Code: (def.bat) [Select]
@echo off
setlocal EnableDelayedExpansion
title Turret Defense

echo Installing. . .
if not exist def_bin md def_bin
cd def_bin
if not exist path for %%A in (-2.4\1 -1.4\2 1.4\3 2.4\4 3.4\5 4.4\6 4.3\7 4.2\8 4.1\9 5.1\10 6.1\11 7.1\12 8.1\13 8.2\14 8.3\15 8.4\16 8.5\17 8.6\18 9.6\19 10.6\20 11.6\21 12.6\22 13.6\23 14.6\24 14.5\25 14.4\26 15.4\27 16.4\28 17.4\29 18.4\30 18.3\31 19.3\32 20.3\33 20.4\34 20.5\35 21.5\36 22.5\37 23.5\38 23.4\39 24.4\40 25.4\41 26.4\42) do echo %%A >>path
cls

set color.flash=6
set color.norm=7
set error=
set gold.divis=2
set gold.start=25
set hp.multip=1
set life=9
set live.divisor=5
set range=5
set turret.cost=15
set turn=1
set turn.delay=1
set wave.size=5
set wave.spacing=3
set /a gold.plus=%turret.cost%/2


set "spinner.1=|"
set "spinner.2=|"
set "spinner.3=/"
set "spinner.4=/"
set "spinner.5=-"
set "spinner.6=-"
set "spinner.7=\"
set "spinner.8=\"



call :new_game
:loop
call :turn
:end_turn
call :wave
:end_wave
set /a turn+=1
goto :loop




:new_game
for /f "delims=" %%A in ('dir turret* /b') do del /f %%A
for /l %%Y in (1,1,7) do (
for /l %%X in (1,2,26) do (
set "cord.%%X.%%Y=."
)
for /l %%X in (0,2,26) do (
set "cord.%%X.%%Y= "
)
)
for %%A in (1.4 2.4 3.4 4.4 4.3 4.2 4.1 5.1 6.1 7.1 8.1 8.2 8.3 8.4 8.5 8.6 9.6 10.6 11.6 12.6 13.6 14.6 14.5 14.4 15.4 16.4 17.4 18.4 18.3 19.3 20.3 20.4 20.5 21.5 22.5 23.5 23.4 24.4 25.4 26.4) do set "cord.%%A="
for /l %%P in (1,1,42) do set "path.%%P=0"
echo. > turret0
set gold=%gold.start%
set turret=1
goto :eof

:map
REM pause
title Tower Defense
cls
:load_map
if "%life:~2,1%"=="" (
if not "%life:~1,1%"=="" (
set "life.backSpace="
set "life.backSpace2=."
) else (
set "life.backSpace=."
set "life.backSpace2=."
)
) else (
set "life.backspace2="
set "life.backspace="
)
set "lin.01=  A B C D E F G H I J K L M"
set "lin.02=# . . . . . . . . . . . . . #%turn%"
set "lin.03=###############################"
set "lin.1=# %cord.1.1%%cord.2.1%%cord.3.1%%path.9%%path.10%%path.11%%path.12%%path.13%%cord.9.1%%cord.10.1%%cord.11.1%%cord.12.1%%cord.13.1%%cord.14.1%%cord.15.1%%cord.16.1%%cord.17.1%%cord.18.1%%cord.19.1%%cord.20.1%%cord.21.1%%cord.22.1%%cord.23.1%%cord.24.1%%cord.25.1%%cord.26.1%#..1"
set "lin.2=# %cord.1.2%%cord.2.2%%cord.3.2%%path.8%%cord.5.2%%cord.6.2%%cord.7.2%%path.14%%cord.9.2%%cord.10.2%%cord.11.2%%cord.12.2%%cord.13.2%%cord.14.2%%cord.15.2%%cord.16.2%%cord.17.2%%cord.18.2%%cord.19.2%%cord.20.2%%cord.21.2%%cord.22.2%%cord.23.2%%cord.24.2%%cord.25.2%%cord.26.1%#..2"
set "lin.3=# %cord.1.3%%cord.2.3%%cord.3.3%%path.7%%cord.5.3%%cord.6.3%%cord.7.3%%path.15%%cord.9.3%%cord.10.2%%cord.11.3%%cord.12.2%%cord.13.3%%cord.14.3%%cord.15.3%%cord.16.3%%cord.17.3%%path.31%%path.32%%path.33%%cord.21.3%%cord.22.3%%cord.23.3%%cord.24.3%%cord.25.3%%cord.26.3%#..3"
set "lin.4=%path.1%%path.2%%path.3%%path.4%%path.5%%path.6%%cord.5.4%%cord.6.4%%cord.7.4%%path.16%%cord.9.4%%cord.10.4%%cord.11.4%%cord.12.4%%cord.13.4%%path.26%%path.27%%path.28%%path.29%%path.30%%cord.19.4%%path.34%%cord.21.4%%cord.22.4%%path.39%%path.40%%path.41%%path.42%%life%%life.backSpace%%life.backSpace2%4"
set "lin.5=# %cord.1.5%%cord.2.5%%cord.3.5%%cord.4.5%%cord.5.5%%cord.6.5%%cord.7.5%%path.17%%cord.9.5%%cord.10.5%%cord.11.5%%cord.12.5%%cord.13.5%%path.25%%cord.15.5%%cord.16.5%%cord.17.5%%cord.18.5%%cord.19.5%%path.35%%path.36%%path.37%%path.38%%cord.24.5%%cord.25.5%%cord.26.5%#..5"
set "lin.6=# %cord.1.6%%cord.2.6%%cord.3.6%%cord.4.6%%cord.5.6%%cord.6.6%%cord.7.6%%path.18%%path.19%%path.20%%path.21%%path.22%%path.23%%path.24%%cord.15.6%%cord.16.6%%cord.17.6%%cord.18.6%%cord.19.6%%cord.20.6%%cord.21.6%%cord.22.6%%cord.23.6%%cord.24.6%%cord.25.6%%cord.26.6%#..6"
set "lin.7=# %cord.1.7%%cord.2.7%%cord.3.7%%cord.4.7%%cord.5.7%%cord.6.7%%cord.7.7%%cord.8.7%%cord.9.7%%cord.10.7%%cord.11.7%%cord.12.7%%cord.13.7%%cord.14.7%%cord.15.7%%cord.16.7%%cord.17.7%%cord.18.7%%cord.19.7%%cord.20.7%%cord.21.7%%cord.22.7%%cord.23.7%%cord.24.7%%cord.25.7%%cord.26.7%#..7"
set "lin.8=################################"

:draw_map
echo.
echo.
echo.                      %lin.01%
echo.                      %lin.02%
echo.                      %lin.03%
echo.                      %lin.1%
echo.                      %lin.2%
echo.                      %lin.3%
echo.                      %lin.4%
echo.                      %lin.5%
echo.                      %lin.6%
echo.                      %lin.7%
echo.                      %lin.8%

goto :eof

:turn

call :map
echo Gold: %gold%g
echo.%error%
echo.
echo.  buy ^<X.Y^> %turret.cost%g Buys a turret and installs it to (X,Y).
echo.  sell ^<X.Y^> %gold.plus%g Sells the turret at (X,Y).
echo.  pass Ends the buying/selling phase.
set /p cmd=^>
echo. Processing Command. Please wait. . .
for /f "delims= " %%A in ("%cmd%") do call :%%A
goto :turn

:buy
set /a gold-=%turret.cost%
if %gold% LSS 0 (
set /a gold+=%turret.cost%
) else (
for /f "tokens=2 delims= " %%S in ("%cmd%") do (
for /f "tokens=1,2 delims=." %%A in ("%%S") do (

if /i "%%A"=="a" set A=1
if /i "%%A"=="b" set A=3
if /i "%%A"=="c" set A=5
if /i "%%A"=="d" set A=7
if /i "%%A"=="e" set A=9
if /i "%%A"=="f" set A=11
if /i "%%A"=="g" set A=13
if /i "%%A"=="h" set A=15
if /i "%%A"=="i" set A=17
if /i "%%A"=="j" set A=19
if /i "%%A"=="k" set A=21
if /i "%%A"=="l" set A=23
if /i "%%A"=="m" set A=25

if defined cord.!A!.%%B (
set cord.!A!.%%B=T
) else (
set /a gold+=%turret.cost%
set error=Wrong Syntax
goto :eof
)
if "%%B"=="" (
set /a gold+=%turret.cost%
set error=Wrong Syntax
goto :eof
)
if "!A!"=="" (
set /a gold+=%turret.cost%
set error=Wrong Syntax
goto :eof
)
echo !A!.%%B >turret%turret%
call :Func_TurretRange !A! %%B
set /a turret+=1
)
)
)
set error=
goto :eof

:sell
for /f "tokens=2 delims= " %%S in ("%cmd%") do (
for /f "tokens=1,2 delims=." %%A in ("%%S") do (

if /i "%%A"=="a" set A=1
if /i "%%A"=="b" set A=3
if /i "%%A"=="c" set A=5
if /i "%%A"=="d" set A=7
if /i "%%A"=="e" set A=9
if /i "%%A"=="f" set A=11
if /i "%%A"=="g" set A=13
if /i "%%A"=="h" set A=15
if /i "%%A"=="i" set A=17
if /i "%%A"=="j" set A=19
if /i "%%A"=="k" set A=21
if /i "%%A"=="l" set A=23
if /i "%%A"=="m" set A=25


set sell=0
for /f "delims=" %%G in ('dir turret* /b') do (
set /p loc=<%%G
if "!loc!"=="!A!.%%B " (
del /f %%G
set /a gold+=!gold.plus!
set "cord.!A!.%%B=."
set sell=1
)
)
)
)
if "%sell%"=="0" set error=No Turret Exists There.
goto :eof

:pass
goto :end_turn

:wave
:wave.setup
for /l %%A in (1,1,%wave.size%) do (
set /a creap%%A.hp=%turn%*%hp.multip%
if !creap%%A.hp! GTR 9 (
set creap%%A.sym=+
) else (
set creap%%A.sym=!creap%%A.hp!
)
set /a creap%%A.pos=%%A-%wave.size%
set /a creap%%A.pos*=%wave.spacing%
)


:wave.start
REM Define Creap HP
for /f "tokens=1 delims==" %%A in ('set creap ^| find ".sym"') do (
for /f "tokens=1 delims=." %%B in ("%%A") do (
for /f "tokens=2 delims=p" %%C in ("%%B") do (
if !creap%%C.hp! GTR 9 (
set creap%%C.sym=+
) else (
set creap%%C.sym=!creap%%C.hp!
) 2>nul
) 2>nul
) 2>nul
) 2>nul



REM Move creaps
for /f "tokens=1,2 delims==" %%A in ('set creap ^| find ".pos"') do (
set /a %%A=%%B+1
REM echo set /a %%A=%%B+1
for /f "tokens=2 delims=." %%G in ("%%A") do (
if %%B EQU 42 (
for /f "tokens=1 delims=." %%I in ("%%A") do (
for /f "tokens=2 delims=p" %%H in ("%%I") do (
set /a life-=!creap%%H.hp!
set creap%%H.hp=
set creap%%H.pos=
set creap%%H.sym=
) 2>nul
) 2>nul
) 2>nul
) 2>nul
) 2>nul

REM Kill Creaps
for /l %%A in (1,1,%wave.size%) do (
if !creap%%A.hp! LEQ 0 (
if not "!creap%%A.hp!"=="" (
set creap%%A.hp=
set creap%%A.pos=
set creap%%A.sym=
set /a gold.gain=%turn%/%gold.divis%
if !gold.gain! EQU 0 set gold.gain=1
set /a gold+=%gold.gain%
REM set /a gold+=1
)
) 2>nul
) 2>nul

REM Define new path variables
for /l %%A in (0,1,42) do set path.%%A=0
for /f "tokens=1,2 delims==" %%H in ('set creap ^| find ".pos"') do (
for /f "tokens=1 delims=." %%A in ("%%H") do (
for /f "tokens=2 delims=p" %%B in ("%%A") do (
set path.%%I=!creap%%B.sym!
) 2>nul
) 2>nul
) 2>nul

call :map


REM Fire Turrets
for /f "delims=" %%T in ('dir turret* /b') do (
for /f %%N in ('type "%%T" ^| sort /r') do (
if not "!path%%N!"=="0" (
for /f "tokens=1,2 delims==" %%C in ('set creap ^| find ".pos"') do (
if "%%D"=="%%N" (
for /f "tokens=1 delims=." %%X in ("%%C") do (
for /f "tokens=2 delims=p" %%Z in ("%%X") do (
if "!fired!"=="0" (
set /a creap%%Z.hp-=1
color 0%color.flash%
set flash=1
set fired=1
) 2>nul
) 2>nul
) 2>nul
) 2>nul
if "!flash!"=="1" (
ping localhost -n 1 >nul 2>&1
ping localhost -n 1 >nul 2>&1
ping localhost -n 1 >nul 2>&1
color 0%color.norm%
:: call :map
set flash=0
) 2>nul
) 2>nul
) 2>nul
) 2>nul
set fired=0
) 2>nul


if %life% LEQ 0 goto :endgame


ping localhost -n %turn.delay% >nul


set creap>nul 2>&1 || (
set /a life.gain=%turn%/%live.divisor%
set /a life+=!life.gain!
goto :end_wave
)
goto :wave.start

:endgame
set "life=0"
call :map
echo.
echo You lose on turn %turn%.
pause>nul
exit

:Func_TurretRange
set spinner=1
set startx=%1
set starty=%2
for /l %%A in (0,1,30) do (
for /l %%B in (0,1,10) do (
call :Func_TurretRange.check %%A %%B
)
)
set startx=
set starty=
goto :eof
:Func_TurretRange.check

title Tower Defense !spinner.%spinner%!
set /a spinner+=1
if !spinner! EQU 9 set spinner=1

set /a workingx=%startx%-%1
set /a workingy=%starty%-%2
if %workingx% LSS 0 set workingx=%workingx:~1%
if %workingy% LSS 0 set workingy=%workingy:~1%
set /a working=%workingx%+%workingy%
REM if %working% LSS %range% if %working% GTR 0 echo %1.%2 >>turret%turret%
if %working% LSS %range% if %working% GTR 0 for /f "tokens=1,2 delims=\" %%H in (path) do if /i "%1.%2"=="%%H" echo %%I >>turret%turret%

set working=
set workingx=
set workingy=
goto :eof
Title: Re: Batch Programs Thread.
Post by: Batch_gamer on June 21, 2014, 09:45:27 PM
would anyone be so kind as to help me with my batch game's save and load codes? I developed the multi save function part myself and I think they its pretty spectacular up until the loading part. message me if you have successful save and load codes! :P
Title: Re: Batch Programs Thread.
Post by: Lemonilla on June 22, 2014, 07:42:26 AM
would anyone be so kind as to help me with my batch game's save and load codes? I developed the multi save function part myself and I think they its pretty spectacular up until the loading part. message me if you have successful save and load codes! :P
This thread is for completed batch scripts.  You are suppose to make a new thread for each question.
Title: Re: Batch Programs Thread.
Post by: patio on June 22, 2014, 08:49:12 AM
2nd warning for multiple Posts...

3rd one will be the charm.

patio.
Title: Re: Batch Programs Thread.
Post by: Lemonilla on September 26, 2014, 09:49:21 PM
Converts inclusive math notation to exclusive math notation.  Does not support exponents, modulo, or parenthesis within parenthesis.  Follows order of operations.
Examples of conversions:
5+9  ->  59+
6+5/9  ->  59/6+
(6+5)/9  ->  65+9/
(4+5)/(1+3)  ->  45+13+/

Code: [Select]
@echo off
setlocal EnableDelayedExpansion
if not "%~2"=="" setlocal
set op=%~1
set a=-1
set "self=%~pdnx0"
for /f "tokens=1 delims==" %%A in ('set array 2^>nul') do set "%%A="


REM set up array1 to contain the characters of %op%
:a
set /a a+=1
set working=!op:~%a%,1!
if not "%working%"=="" (
set "array1_%a%=%working%"
goto :a )
set op_size=%a%



REM set up array2 to contain order of operations starting from 1
REM a value of 0 signifies no operation to run, but a digit to move
set b=-1
set count=1
:b
set /a b+=1
if not defined array1_%b% set array2_%b%=

if "!array1_%b%:~0,1!"=="(" call :open

if "!array1_%b%:~0,1!"=="/" (
set array2_%b%=%count%
set /a count+=1
)
if "!array1_%b%:~0,1!"=="*" (
set array2_%b%=%count%
set /a count+=1
)
if not "%b%"=="%op_size%" goto :b
set b=-1
:c
set /a b+=1
if "!array1_%b%:~0,1!"=="+" (
set array2_%b%=%count%
set /a count+=1
)
if "!array1_%b%:~0,1!"=="-" (
set array2_%b%=%count%
set /a count+=1
)
if not "%b%"=="%op_size%" goto :c
set b=-1
:d
set /a b+=1
if "!array2_%b%!"=="" set array2_%b%=0
if not "%b%"=="%op_size%" goto :d
set a=
set b=


REM locate operations before and after first operation
:locate
set loc=0
set a=-1
set last=-1
set next=
:e
set /a a+=1
if not "!array2_%a%!"=="0" (
if not "!array2_%a%!"=="1" (
if "%loc%"=="0" set last=%a%
if "%loc%"=="1" (
set next=%a%
goto :combine
)
)
)
if "!array2_%a%!"=="1" set loc=1
if not "%a%"=="%op_size%" goto :e
set next=%a%
goto :combine

:combine
set working=
set /a next=%next%-1
:f
set /a last=%last%+1
if not "!array2_%last%!"=="1" (
set "working=%working%!array1_%last%!"
set "array1_%last%="
) else (
set "store=!array1_%last%!"
set "array1_%last%="
)
if not "%last%"=="%next%" goto :f
set "working=%working%%store%"
set "array1_%next%=%working%"


REM Check if done
set g=0
for /f "tokens=2 delims==" %%A in ('set array2') do if not "%%A"=="0" set g=1
set a=0
set z=
set b=-1
set count=1
set next=
set last=
set working=
set store=
if "%g%"=="1" goto :b



REM Echo Output and exit
set output=
set a=-1
:out
set /a out+=1
if defined array1_%out% (
set output=!array1_%out%!
goto :end
)
goto :out
:end
echo %output%
endlocal
goto :exit





REM comine equations in paranthisis and convert them
:open

set last=%b%
set o=%b%
set "array1_%o%="
:op
set /a o+=1
if not "!array1_%o%!"==")" goto :op
set next=%o%

set working=
set /a next=%next%-1
:f2
set /a last=%last%+1
if not "!array1_%last%!"=="+" (
if not "!array1_%last%!"=="/" (
if not "!array1_%last%!"=="*" (
if not "!array1_%last%!"=="-" (
set "working=%working%!array1_%last%!"
set "array1_%last%="
) else (
set "store=!array1_%last%!"
set "array1_%last%="
)
) else (
set "store=!array1_%last%!"
set "array1_%last%="
)
) else (
set "store=!array1_%last%!"
set "array1_%last%="
)
) else (
set "store=!array1_%last%!"
set "array1_%last%="
)
if not "%last%"=="%next%" goto :f2
set "working=%working%%store%"
set "array1_%next%=%working%"
set /a next+=1
set "array1_%next%="

goto :eof
:exit
Title: Re: Batch Programs Thread.
Post by: Lemonilla on December 29, 2014, 09:50:46 PM
Kinda a useless thing, but this is a web crawler that will compile a list of all the quotes on Magic: The Gathering cards.  It has an ungodly long run time, so you'd be better off writing this in another language, but a fun side project.  Requires wget.exe and repl.bat. 
(Tested with repl version 4 and wget version 1.11.4)
Code: (flavor.bat) [Select]
@echo off
setlocal EnableDelayedExpansion

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: SCRIPT.........: flavor.bat
::: VERSION........: 2.0
::: DATE...........: 12/18/2014
::: AUTHOR.........: Lemonilla
::: REQUIRMENTS....: repl.bat; wget.exe;
::: DESCRIPTION....: Downloads the flavor text from
:::                  Magic: The Gathering cards.
:::
:::      flavor [threads]
:::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Check to see if arg[1] is defined.
:: If so, this instance is a thread with ID = arg[2]
if not "%~2"=="" goto :run

:: Setup threads and run them.
:: Split total number of cards by the number of threads
:: and start a thread for each segment.
:: If arg[0] is not defined, assign the
:: number of threads to 250.
set "threads=%~1"
if not defined total set total=100000
if not defined threads set threads=250
set /a add=%total%/%threads%
set lower=1
set upper=%add%
set t_ID=1
:thread
start /b "" "%~0" %lower% %upper% %t_ID%
set /a lower+=%add%
set /a upper+=%add%
set /a t_ID+=1
if %lower% LSS %total% goto :thread
set /a t_ID-=1

:: Wait for all the threads to finish.
:: This is done by waiting for their ID.d
:: files to appear.
:: ALso writing current process number to
:: the screen.
:wait
set wait=0
cls
for /f "tokens=1 delims=." %%G in (' dir /b *.tmc ') do echo %%G
for /l %%A in (1,1,%t_ID%) do (
if not exist %%A.d set wait=1
)
timeout /t 1 /nobreak >nul
if "%wait%"=="1" goto :wait

:: Combine all list_ID.t files into list.txt
for /l %%A in (1,1,%t_ID%) do type list_%t_ID%.t >>list.txt

:: Remove all temporary files and exit
del *.tmc
del *.tm
del *.t
del *.d
exit /b

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::: Start Recursion :::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Loop through input values arg[0] through arg[1]
:: Calling :pull on each number
:: When finished it will create a file with the name
:: of arg[2] which will be picked up by main's wait loop
:run
set ID=%~3
for /l %%A in (%~1,1,%~2) do call :pull %%A
echo. >%ID%.d
exit


:pull
set current=%~1

:: Set flag for error handling
:rerun

:: Download html for parsing to ####.tmc
:: where #### is the current value of the loop in :run
:: This requires wget.exe
wget -O %current%.tmc "http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=%current%" 1>nul 2>&1

:: Parse out the data we need
:: This requires repl.bat
1>name_%ID%.tm 2>nul (
type %current%.tmc | find "<span id=""ctl00_ctl00_ctl00_MainContent_SubContent_SubContentHeader_subtitleDisplay"">" | repl "<span id=\qctl00_ctl00_ctl00_MainContent_SubContent_SubContentHeader_subtitleDisplay\q>" "" x | repl "</span>" "" | repl "  " ""
)
1>flavor_%ID%.tm 2>nul (
type %current%.tmc | find "<div class=""cardtextbox"" style=""padding-left:10px;""><i>" | repl "<div class=\qcardtextbox\q style=\qpadding-left:10px;\q><i>" "" x | repl "</i></div></div>" "" | repl "  " ""
)

set /p check_n=<name_%ID%.tm
set /p check_f=<flavor_%ID%.tm

:: Check to see if any values were gathered
:: and write to the list file if they were both found
if defined check_f (
if defined check_n (
1>>list_%ID%.t (
echo.[%current%]
echo.%check_n%
type flavor_%ID%.tm
echo.
)
) else (
goto :rerun
)
)

:: Cleanup
set "check_n="
set "check_f="
del %current%.tmc
del name_%ID%.tm
del flavor_%ID%.tm

goto :eof

Be warned, when you exit the window, background processes will freeze.  Run these commands to total shut down the program:
taskkill /f /im "cmd.exe"
taskkill /f /im "cscript.exe"
taskkill /f /im "find.exe"
taskkill /f /im "cmd.exe"
Title: Re: Batch Programs Thread.
Post by: 1998golfer on December 29, 2014, 10:02:08 PM
Kinda a useless thing, but this is a web crawler that will compile a list of all the quotes on Magic: The Gathering cards.  It has an ungodly long run time, so you'd be better off writing this in another language, but a fun side project.  Requires wget.exe and repl.bat. 
(Tested with repl version 4 and wget version 1.11.4)
Code: (flavor.bat) [Select]
@echo off
setlocal EnableDelayedExpansion

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: SCRIPT.........: flavor.bat
::: VERSION........: 2.0
::: DATE...........: 12/18/2014
::: AUTHOR.........: Lemonilla
::: REQUIRMENTS....: repl.bat; wget.exe;
::: DESCRIPTION....: Downloads the flavor text from
:::                  Magic: The Gathering cards.
:::
:::      flavor [threads]
:::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Check to see if arg[1] is defined.
:: If so, this instance is a thread with ID = arg[2]
if not "%~2"=="" goto :run

:: Setup threads and run them.
:: Split total number of cards by the number of threads
:: and start a thread for each segment.
:: If arg[0] is not defined, assign the
:: number of threads to 250.
set "threads=%~1"
if not defined total set total=100000
if not defined threads set threads=250
set /a add=%total%/%threads%
set lower=1
set upper=%add%
set t_ID=1
:thread
start /b "" "%~0" %lower% %upper% %t_ID%
set /a lower+=%add%
set /a upper+=%add%
set /a t_ID+=1
if %lower% LSS %total% goto :thread
set /a t_ID-=1

:: Wait for all the threads to finish.
:: This is done by waiting for their ID.d
:: files to appear.
:: ALso writing current process number to
:: the screen.
:wait
set wait=0
cls
for /f "tokens=1 delims=." %%G in (' dir /b *.tmc ') do echo %%G
for /l %%A in (1,1,%t_ID%) do (
if not exist %%A.d set wait=1
)
timeout /t 1 /nobreak >nul
if "%wait%"=="1" goto :wait

:: Combine all list_ID.t files into list.txt
for /l %%A in (1,1,%t_ID%) do type list_%t_ID%.t >>list.txt

:: Remove all temporary files and exit
del *.tmc
del *.tm
del *.t
del *.d
exit /b

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::: Start Recursion :::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: Loop through input values arg[0] through arg[1]
:: Calling :pull on each number
:: When finished it will create a file with the name
:: of arg[2] which will be picked up by main's wait loop
:run
set ID=%~3
for /l %%A in (%~1,1,%~2) do call :pull %%A
echo. >%ID%.d
exit


:pull
set current=%~1

:: Set flag for error handling
:rerun

:: Download html for parsing to ####.tmc
:: where #### is the current value of the loop in :run
:: This requires wget.exe
wget -O %current%.tmc "http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=%current%" 1>nul 2>&1

:: Parse out the data we need
:: This requires repl.bat
1>name_%ID%.tm 2>nul (
type %current%.tmc | find "<span id=""ctl00_ctl00_ctl00_MainContent_SubContent_SubContentHeader_subtitleDisplay"">" | repl "<span id=\qctl00_ctl00_ctl00_MainContent_SubContent_SubContentHeader_subtitleDisplay\q>" "" x | repl "</span>" "" | repl "  " ""
)
1>flavor_%ID%.tm 2>nul (
type %current%.tmc | find "<div class=""cardtextbox"" style=""padding-left:10px;""><i>" | repl "<div class=\qcardtextbox\q style=\qpadding-left:10px;\q><i>" "" x | repl "</i></div></div>" "" | repl "  " ""
)

set /p check_n=<name_%ID%.tm
set /p check_f=<flavor_%ID%.tm

:: Check to see if any values were gathered
:: and write to the list file if they were both found
if defined check_f (
if defined check_n (
1>>list_%ID%.t (
echo.[%current%]
echo.%check_n%
type flavor_%ID%.tm
echo.
)
) else (
goto :rerun
)
)

:: Cleanup
set "check_n="
set "check_f="
del %current%.tmc
del name_%ID%.tm
del flavor_%ID%.tm

goto :eof

Be warned, when you exit the window, background processes will freeze.  Run these commands to total shut down the program:
taskkill /f /im "cmd.exe"
taskkill /f /im "cscript.exe"
taskkill /f /im "find.exe"
taskkill /f /im "cmd.exe"
Where would I find repl.bat?
Title: Re: Batch Programs Thread.
Post by: foxidrive on December 29, 2014, 11:39:49 PM
Where would I find repl.bat?

A helper batch file called `repl.bat` (by dbenham) - download from:  https://www.dropbox.com/s/qidqwztmetbvklt/repl.bat

Place `repl.bat` in the same folder as the batch file or in a folder that is on the path.
Title: Re: Batch Programs Thread.
Post by: millergram on January 06, 2015, 12:26:14 PM
Code: [Select]
MODE CON: COLS=40 LINES=12
@echo off
echo.This is A random Number guessing game.
:main1
set /p TY=How Many Tries Do You Want?:
set /p TT=How Many Numbers Do You Want?:
set tries=%TY%
set /a guess=%random% %%TT + 1 >nul
:main
if %tries%==0 goto loss
cls
Echo.This is 1-%TT% guess a number if you get it right then you win
echo.%username% has %tries% tries left
echo.Your guess below
set /p user=
set /a tries=%tries%-1
if "%user%"=="%guess%" goto win
if "%user%"=="" goto main
if "%user%" LSS "%guess%" echo To low &pause
if "%user%" GTR "%guess%" echo To high &pause
goto main
:win
cls
echo.you win! play again?(yes/no)
set /p yinput=
if "%yinput%"=="yes" goto main1
if "%yinput%"=="no" exit
if "%yinput%"=="" goto win
:loss
cls
echo.sorry you loose
echo.The number was %guess%
pause
goto main1
This is an improved version of the random number gussing game
Title: Re: Batch Programs Thread.
Post by: millergram on January 23, 2015, 01:33:59 PM
This is a fixed version of the above quoted program.
Code: [Select]
MODE CON: COLS=41 LINES=12
@echo off
echo.This is A random Number guessing game.
:main1
cls
set /p TY=How Many Tries Do You Want?:
Echo No Higher Than 32766
set /p TT=How Many Numbers Do You Want?:
set tries=%TY%
set guess=
set /a guess=%random% %%TT + 1 >nul
:main
cls
if %tries%==0 goto loss
Echo.This is 1-%TT% guess a number if you get itright then you win
echo.%username% has %tries% tries left
echo.Your guess below
set /p user=
if "%user%"=="%guess%" goto win
if "%user%"=="" goto main
if "%user%"=="debug" goto debug
set /a tries=%tries%-1
if "%user%" LSS "%guess%" goto low
if "%user%" GTR "%guess%" goto high
goto main
:win
cls
echo.you win! play again?(yes/no)
set /p yinput=
if "%yinput%"=="yes" goto main1
if "%yinput%"=="no" exit
if "%yinput%"=="" goto win
:loss
cls
echo.sorry you loose
echo.The number was %guess%
pause
goto main1
:debug
cls
Echo.Printing Variables to
Echo."var.txt"
Echo.With in current DIR
echo Date:%DATE%>>var.txt
echo Guess:%guess%>>Var.txt
echo TY:%TY%>>Var.txt
echo TT:%TT%>>Var.txt
echo Tries:%tries%>>Var.txt
echo yinput:%yinput%>>Var.txt
echo Username:%username%>>Var.txt
echo LastGuessed:%user%>>var.txt
pause
goto main
:low
echo To low & pause
goto main
:high
echo To high & pause
goto main
Title: Re: Batch Programs Thread.
Post by: patio on January 23, 2015, 05:29:16 PM
I don't get it...
Title: Game with bad humor
Post by: Deemajeir on January 30, 2015, 12:38:21 PM
So I did this as a little exercise.
It was nighttime and I was tired and Skyping with a friend.
So, you can imagine how it turned out.
Anyway, it's a little batch multiple-choice adventure game

I'd love feedback!
I know the language and details aren't the best(Done at 1am...) but if you have any ideas about the technical part, I'd love to hear it!

Code:

@echo off
title Godzilla burgers
color A0

:start
cls

echo This is the moment you have been waiting for the whole day. It's 7pm and you are stainding in the line of Godzilla burgers, your local street grill(or "snagari" as your Finnish friends say).
echo There are three people in front of you. It's quite chilly and you could use a
echo nice fight to stay warm. You decide to...
echo A Wait in the line like a good guy
echo B Pay the guys in front of you to start boxing a little(You definetly don't have the cash but hopefully you can outrun or outsmart them)
echo C Start bitching the guy in front of you and fight him.
echo D *censored* this. Just go home.
set/p "choice=>"
if %choice%==A goto wait
if %choice%==B goto dogfight
if %choice%==C goto battle
if %choice%==D goto home


:wait
cls
echo You stand in the line and check your phone a couple of times. You almost die of boredom, but it's finally your turn.
ping localhost -n 5 >nul
goto order


:dogfight
cls
echo You speak to the two guys in front of you. "Hey guys. Wan't to warm up a bit? You two, mano O mano. Winner gets 20 bucks."
echo The guys are both rough-bodied construction workers, apparently coworkers. They look at each other and get to boxing stances.
echo They start hitting each other and continue until the slightly smaller one falls down. You cheer.
echo.
ping localhost -n 5 >nul
echo "Twenty bucks, if you would" The winner says grinning.
echo You only have money for your hot dog, so you can't pay. You decide to...
echo 1 Outsmart him
echo 2 Outrun him
echo 3 Give him your food money and go home.
set/p "num=>"
if %num%==1 goto outsmart
if %num%==2 goto outrun
if %num%==3 goto home

:outsmart
cls
echo You smile saying:"If you get the riddle right."
echo "When the sun goes down, I go up. What am I?"
echo "The moon" the worker says and puts his hand forth.
echo You laugh and say:"A *censored*!"
echo The worker is not amused. He steps toward you.
ping localhost -n 12 >nul
goto outrun

:outrun
cls
echo You smile and reach for your pocket.
echo In a blink of an eye you turn around and start running!
echo The workers run after you, but you manage to lose them.
echo.
echo You realize you can't go back to Godzilla's, so you have to go home.
pause
goto home

REM Tappelut alkaa

:battle
cls
echo You knock on the shoulder of the bald guy in front of you. He turns around.
echo "Hey" You say."Did you notice you dropped your hair somewhere?"
echo "And your hair seems to grow from your nose" He answers.
echo "Let's settle this like gentlemen", you say and raise your fists.
ping localhost -n 7 >nul

color 50
cls
echo The world around you seems to grow to the size of an arena when you get ready to battle.
echo You are standing in front of the big man. He is waits for you to make your move.
echo People are gathering around you and you must decide.
echo.
echo attack
echo Skills: jumpkick, taunt, batbeatdown
echo Magic: fireball, waterpower

set/p "fight=>"
if %fight%==attack goto attack
if %fight%==jumpkick goto jumpkick
if %fight%==taunt goto taunt
if %fight%==batbeatdown goto batbeatdown
if %fight%==fireball goto fireball
if %fight%==waterpower goto waterpower

:attack
cls
echo You take all your strenght to this blow nad punch him in the stomach.
echo He doesen't even blink. Instead, he grabs you and crushes the air from your lungs.
echo You Try to signal him your surrender, but he breaks your bones.
echo Ambulance is soon called and you are taken to a hospital.
echo When you are fixed, it's already too late. Your brains can't work without
echo Godzilla burgers.
echo You spend a couple of days in intersive treatment and after that you are sent to a mental hospital.
echo You have been diagnosed with the brain functions of a vegetable.
echo You end your days in the hospital.
ping localhost -n 5 >nul
echo GAME OVER
pause
goto start

:jumpkick
cls
echo You jump to the air and kick him in the face.
echo ...Well that's what you planned.
echo He quickly steps back and grabs you when you hit the ground.
echo The worker does not hesitate.He crushes the air from your lungs.
echo You Try to signal him your surrender, but he breaks your bones.
echo Ambulance is soon called and you are taken to a hospital.
echo When you are fixed, it's already too late. Your brains can't work without
echo Godzilla burgers.
echo You spend a couple of days in intersive treatment and after that you are sent to a mental hospital.
echo You have been diagnosed with the brain functions of a vegetable.
echo You end your days in the hospital.
ping localhost -n 5 >nul
echo GAME OVER
pause
goto start

:taunt
cls
echo You decide to anger him first.
echo "Yo momma's a *censored*!" you shout.
echo He roars and speeds towards you.
echo You dodge and try to trip him, but he's too fast.
echo Your leg breaks and you fall.
echo He gets the upper hand and steals all your money.
echo The worker smiles and goes to buy a burger.
echo You can barely see the gigantic lizard that is approaching the food stand,
echo but you don't have the power to do anything.
echo You die out of blood loss.
pause
goto start

:batbeatdown
cls
echo "Okay guys", you say loudly
echo "It's time for a beatdown- A BATBEATDOWN!"
echo A group of your friends jump from the shadows,
echo all dressed like bats. They attack the worker
echo while you pull out your trusty baseball bat.
echo "HOME RUN!" You shout and hit your opponent in the head.
pause
echo He collapses to the ground and you go claim your prize:
echo A Godzilla Burgers Hot *censored* Dog!
ping localhost -n 10 >nul
goto :order

:fireball
cls
echo You smile and raise your hands.
echo Everyone feels the warmth when fire starts to grow.
echo You hit your hands together.
pause
echo Fire bursts out of your hands and your enemy dodges in terror.
echo Fire hits Godzilla Burgers stand and it burns to ground!
echo You shout in terror and collapse.
echo You can barely see the gigantic lizard that is approaching the burning food stand,
echo but you don't have the power to do anything.
echo The lizard cries out of anger because it can't get a burger.
echo He destroys the world, but you know this is all your fault.
echo You collapse and when you wake up...
ping localhost -n 10 >nul
echo There's nothing left.
ping localhost -n 3 >nul
echo you lose!
pause
goto start

:waterpower
cls
echo You open your mouth and gallons of water burst out.
echo Your opponent stands in front of you.
echo He is soaking wet, but no harm is done.
echo He roars and speeds towards you.
echo You dodge and try to trip him, but he's too fast.
echo Your leg breaks and you fall.
echo He gets the upper hand and steals all your money.
echo The worker smiles and goes to buy a burger.
echo You can barely see the gigantic lizard that is approaching the food stand,
echo but you don't have the power to do anything.
echo You die out of blood loss.
pause
goto start

REM Tappelut loppuu


:home
cls
echo You sigh and walk home.
echo You spend the evening by sitting on your couch and thinking about the epic hot dogs of Godzilla burgers.
echo.
echo After four days you friends find you in your apartment, almost dead of hunger and thirst. You are still sitting on the couch, lost in your own world. Your friends can't wake you up, so they call the paramedics.
echo You spend a couple of days in intersive treatment and after that you are sent to a mental hospital.
echo You have been diagnosed with the brain functions of a vegetable.
echo You end your days in the hospital.
ping localhost -n 5 >nul
echo GAME OVER
pause
goto :start


:order
cls
echo You stand in front of Mike, the owner of Godzilla's.
echo He smiles and asks:
echo "Godzilla burgers Hot *censored* Dog, right?"
echo "*censored* right" You say and hand him the money.
echo "Coming with a large coke" Mike adds and gets to work.
pause
echo You soon get your hot dog and smile.
echo Just when you're about to eat it you hear a loud roar.
echo Mike is looking behind you, he's mouth hanging open.
echo You turn around and see what you thought only exists in stories.
ping localhost -n 8 >nul
echo A gigantic lizard stands in front of you.
echo.
echo.
echo.
echo "Godzilla" Mike says in amazement behind you. His mouth hangs open.
ping localhost -n 3 >nul
echo Godzilla looks at Mike and puts his lizardous "hand" forward.
echo "BURRRRRGGGEEEEERRRRRRRR" It groans
echo Mike stares in terror without moving.
echo "BURRRRGEEEEEEEEEEEEEEERRRRRRRRR!" Godzilla cries, sounding a lot angryer.
echo Clearly Mike does not realize what's going on.You have to do something!
echo D Make Mike realize he must make a burger
echo E Attack Godzilla
echo F *censored* this. Eat your hot dog!
REM  ^ ^ Coincidence?I THINK NOT!
set/p "savetheday=>"
if %savetheday%==D goto Happygodzillaending
if %savetheday%==E goto SadGodzillaending
if %savetheday%==F goto Moralofthestory

:Happygodzillaending
cls
echo You punch Mike in the elbow and shout:
echo "Mike!Snap out of it!Make a burger!"
echo Mike blinks a couple of times and then gets to work.
echo Godzilla waits patiently while Mike is cooking.
echo You notice people around you staring in amazement,
echo but Godzilla doesen't seem to care.
pause
echo Mike gets the burger done and gives it to Godzilla
echo with his trembling hands.
ping localhost -n 5 >nul
echo Godzillas expression changes.
echo Is it...It's smiling!
echo Godzilla takes the gigantic burger that
echo looks tiny in it's hand.
ping localhost -n 5 >nul
echo Godzilla throws the burger in it's mouth and seems
echo to really enjoy it.
echo Godzilla bows a little and walks away.
echo It disappears in the smog.
ping localhost -n 10 >nul
goto theend

:SadGodzillaending
cls
echo You pull out your knife and strike it to
echo Godzilla's huge toe.
echo.
echo.
echo Godzilla looks down and you see tears
echo coming from his eyes.
echo It's hard to believe, but...He's crying!
echo Godzilla runs to the smog and disappears.
echo He takes your knife with you, but
echo you don't even care.
ping localhost -n 5 >nul
echo People gather around and cheer your name.
echo Still, you can't celebrate with them.
echo You are the only one who realizes...
echo He was like a human...
echo And all this could have been avoided,
echo just if you wouldn't have judged
echo him by his looks.
echo He was just trying to get a burger.
echo Just like you.
pause
goto theend


:Moralofthestory
cls
echo You just lean to the food stand
echo and bite your hot dog.
echo Mike still stares at Godzilla.
echo Godzilla gets angry. It roars and
echo kicks Mike's stand which flies away.
echo Godzilla runs over you and disappears to
echo the mist.
pause
echo Moral of the story:
echo Don't be a *censored*.
echo People will run over you.
ping localhost -n 5 >nul
color A0
cls
echo Thanks for playing!
echo Would you like to restart?
set/p "restart=>"
if %restart%==Yes goto start
if %restart%==yes goto start
if %restart%==No goto exit
if %restart%==no goto exit

:theend
color A0
cls
echo Congratulations!
echo You survived alive and that's
echo quite cool!
echo Remember, there are still endings to find,
echo so would you like to restart?
set/p "restart=>"
if %restart%==Yes goto start
if %restart%==yes goto start
if %restart%==No goto exit
if %restart%==no goto exit


:exit
exit
Title: Re: Batch Programs Thread.
Post by: Squashman on January 30, 2015, 01:10:48 PM
Please use BB CODE tags when posting code.

You are not validating any input from the user.  What happens when someone inputs an invalid option to any of your choices.
You also don't need to check for multiple casing of input.  Read the help for the IF command.
Title: Re: Batch Programs Thread.
Post by: Lemonilla on September 11, 2015, 05:16:46 PM
Make a new thread.  This one is for sharing completed code.
Title: Re: Batch Programs Thread.
Post by: zask on October 24, 2015, 03:54:20 PM
am i allowed to post a virus generator on here? it sends code safely to a text file
Title: Re: Batch Programs Thread.
Post by: patio on October 24, 2015, 07:03:19 PM
No.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on March 01, 2016, 10:18:15 AM
You should not make posts helping bypass school policy. Read the rules.
Title: Re: Batch Programs Thread.
Post by: patio on March 01, 2016, 04:59:27 PM
You should not make posts helping bypass school policy. Read the rules.

Post removed...thanx for the heads up Salmon...
Title: Re: Batch Programs Thread.
Post by: DeScripter on March 22, 2017, 02:23:50 PM
I know a few people posted Rock Paper Scissors game codes already but I created one with a bit more. This version has ANIMATIONS!


@echo off
cls



:idle
cls
echo.
echo.
echo.
echo.
echo.
echo                     ______                           _______
echo                    /      \__                 __/       \
echo         __________/    ____^| ^|               ^| ^|____     \_____________
echo                       /______^|               ^|______\
echo                      /^|______^|              ^|______^|\
echo                       ^|______^|              ^|______^|   
echo         ________      ^|______^|              ^|______^|     _____________
echo                 \_____\_____/                 \_____/____/
echo.
echo.
echo               1) Rock              2) Paper       3) Scissors
                         


set /p input=CHOICE:
if %input%==1 goto Rock
if %input%==2 goto Paper
if %input%==3 goto Scissors


:Rock

set /a n=%random% %%3

if %n%==0 goto RockRock
if %n%==1 goto RockPaper
if %n%==2 goto RockScissors



:RockRock
cls

echo.
echo                 TIE!
echo.
echo.
echo.
echo                     ______            _______
echo                    /      \__      __/       \
echo         __________/    ____^| ^|    ^| ^|____     \_____________
echo                       /______^|    ^|______\
echo                      /^|______^|    ^|______^|\
echo                       ^|______^|    ^|______^|   
echo         ________      ^|______^|    ^|______^|     ___________
echo                 \_____\_____/      \_____/____/
 

timeout /T 2 >nul
goto idle



:RockPaper
cls

echo.
echo                  LOSS!
echo.
echo.
echo.         
echo                     ______                   _______
echo                    /      \__        _______/       \
echo         __________/    ____^| ^|      ^|_____ ^|____     \_____________
echo                       /______^|     ^|______      \
echo                      /^|______^|      ^|_____       
echo                       ^|______^|       ^|_____        ________________
echo         ________      ^|______^|         \__________/             
echo                 \_____\_____/                   




timeout /T 2 >nul
goto idle


:RockScissors
cls

echo.
echo                  WIN!
echo.
echo.
echo.
echo                     ______                   _______
echo                    /      \__       ________/       \
echo         __________/    ____^| ^|     ^|_______^|____     \_____________
echo                       /______^|      _______\    \
echo                      /^|______^|     ^|____________ \
echo                       ^|______^|           ^|______^|   
echo         ________      ^|______^|           ^|______^|     ___________
echo                 \_____\_____/             \_____/____/



timeout /T 2 >nul
goto idle




:Paper

cls
set /a n=%random% %%3

if %n%==0 goto PaperRock
if %n%==1 goto PaperPaper
if %n%==2 goto PaperScissors




:PaperRock
cls

echo.
echo                        WIN!
echo.
echo.
echo.
echo                     ______                         _______
echo                    /      \________             __/       \
echo         __________/    ____^| ______^|           ^| ^|____     \_____________
echo                       /      _______^|          ^|______\
echo                      /       ______^|           ^|______^|\
echo         _________           ______^|            ^|______^|   
echo                  \______________/              ^|______^|     ___________
echo                                                 \_____/____/



timeout /T 2 >nul
goto idle


:PaperPaper
cls

echo.
echo                        TIE!
echo.
echo.
echo.
echo                     ______                         _______
echo                    /      \________        _______/       \
echo         __________/    ____^| ______^|      ^|______ ^|___     \_____________
echo                       /      _______^|    ^|_______     \
echo                      /       ______^|      ^|______      \
echo         _________           ______^|        ^|______          _____________
echo                  \______________/            \_____________/           



timeout /T 2 >nul
goto idle



:PaperScissors
cls

echo.
echo                    LOSS!
echo.
echo.
echo.         
echo                     ______                        _______
echo                    /      \________      ________/       \
echo         __________/    ____^| ______^|    ^|______ ^|____     \_____________
echo                       /      _______^|    ______\     \
echo                      /      _______^|    ^|____________ \
echo         _________           ______^|           ^|______^|   
echo                  \_____________/              ^|______^|     ___________
echo                                                \_____/____/


timeout /T 2 >nul
goto idle


:Scissors

cls
set /a n=%random% %%3

if %n%==0 goto ScissorsRock
if %n%==1 goto ScissorsPaper
if %n%==2 goto ScissorsScissors


:ScissorsRock
cls

echo.
echo                    LOSS!
echo.
echo.
echo.
echo                     ______                    _______
echo                    /      \_________       __/       \
echo         __________/    ____^| _______^|     ^| ^|____     \_____________
echo                       /     /_______      ^|______\
echo                      / _____________^|     ^|______^|\
echo                       ^|______^|            ^|______^|   
echo         ________      ^|______^|            ^|______^|     ___________
echo                 \_____\_____/              \_____/____/


timeout /T 2 >nul
goto idle


:ScissorsPaper
cls

echo.
echo                       WIN!
echo.
echo.
echo.
echo                     ______                        _______
echo                    /      \________       _______/       \
echo         __________/    ____^| ______^|     ^|_____ ^|____     \_____________
echo                       /     /______     ^|______      \
echo                      /^|____________^|     ^|_____       
echo                       ^|______^|            ^|_____        ________________
echo         ________      ^|______^|              \__________/             
echo                 \_____\_____/   

timeout /T 2 >nul
goto idle


:ScissorsScissors
cls

echo.
echo                       TIE!
echo.
echo.
echo.
echo                     ______                         _______
echo                    /      \_________      ________/       \
echo         __________/    ____^| _______^|    ^|______^|____     \_____________
echo                       /     /_______      ______\     \
echo                      / _____________^|    ^|____________ \
echo                       ^|______^|                 ^|______^|   
echo         ________      ^|______^|                 ^|______^|     ___________
echo                 \_____\_____/                   \_____/____/       


timeout /T 2 >nul
goto idle       






BEAT THAT!
Title: Re: Batch Programs Thread.
Post by: kennysteele on May 08, 2017, 02:21:07 AM
!!!!Urgent
Can somone Help me with this please Urgent!!!

For this you need to write two programs one in MS-DOS batch language and one in bash shellscript. Both will do the same task, to create files containing user records for another application (you do not need to worry what this is or write any aspect of it). Each of your programs will need to work in two modes, interactive mode and command line mode. Each will gather from the user their name and a username (which they can choose) which it will write to a file together with the current date and time) which must be stored in a folder called “user_records” (which your program will need to create if it does not exist). In the MS-DOS version user_records will be in “c:\”, in the bash version it will be in the current user’s login directory.
The interactive mode will ask the user two questions, “What is your name?” (and get their reply) and “What is your chosen username?” (and again get their reply) you will need to add more to this such as an introduction at the start of the program, and report if the file was created etc.
 
Say for example the user entered “Fred Bloggs” in answer to the first question and “fb1” to the second, and the date and time were 15/01/2017:20:21:02 then a file would be created in user_records named as per the username as fb1.txt (assuming this did not already exist – if it does exist your program should generate an error message) which would contain:
Fred Bloggs
fb1
15/01/2017:20:21:02

For the non-interactive mode the program would take the persons name and username on the command line, so, say the program was called “makeuser.bat” I might type in:
makeuser.bat “Fred Bloggs” fb1
and without asking the user any questions is should create the file as above. This version should also check that that exactly two parameters were given on the command line. If only one is given or more than two it should generate an error message.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on May 08, 2017, 02:30:01 AM
This is obviously a school assignment. Have you tried to write any code?
Title: Re: Batch Programs Thread.
Post by: kennysteele on May 08, 2017, 02:43:52 AM
Nope I really Have not and yeah it is I really need Help its due in like 3 hours please would you be able to Help me out.
Title: Re: Batch Programs Thread.
Post by: Allan on May 08, 2017, 06:02:38 AM
Sorry, we won't do your homework for you.
Title: Re: Batch Programs Thread.
Post by: blanktheman on January 17, 2018, 12:49:35 AM
Very simple bat file. If my computer turns on and I'm not at work, it will switch off again. I've set it so after 1 hour of not being at work the computer will switch off but you can change the time.

Code: [Select]
@ECHO OFF

:choice
choice /C YN /D N /T 3600 /M "Are you at work today?"
IF errorlevel 2 goto :imnothere
IF errorlevel 1 goto :imhere
pause
goto :choice


:imhere

echo "I am here"
exit

:imnothere

echo "I am not here"
shutdown /s /f
exit
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on January 17, 2018, 01:22:04 AM
Did a ghost press the power button?
Title: Horse Racing
Post by: JoshCM on June 26, 2018, 12:33:47 PM
I made a horse racing game about 10 years ago when still in school.
The tech guy thought blocking game websites would stop us. So I started making them  :P
There is definitely a few bugs and it isn't as simple as it could be but for my first full game. Not too bad :P
(This will create a "save.bat" file in the same location as the game) Just as a warning

Code: [Select]
@echo off
title Horse Racing! (DesignsByJCM Games)
color e
set beterror=no
set stoerror=no
set save=no
if not exist save.bat goto menu
if exist save.bat goto horseselect

:menu
echo set balance=500 > save.bat
echo color f >> save.bat
echo set horse1= Horse 1 >> save.bat
echo set horse2= Horse 2 >> save.bat
echo set horse3= Horse 3 >> save.bat
echo set horse4= Horse 4 >> save.bat
echo set horse5= Horse 5 >> save.bat
call save.bat
cls
echo You have been granted %balance% dollars!
echo.
echo Time to start gambling on horses! Good Luck!
echo.
pause
goto horseselect

:horseselect
cls
call save.bat
if %balance% == 0 goto loose
if %beterror%==yes echo You don't have enough money!
if %beterror%==yes echo.
if %save% == yes echo Save Success!
echo Choose A horse!
call save.bat
echo.
echo 1) %horse1%
echo 2) %horse2%
echo 3) %horse3%
echo 4) %horse4%
echo 5) %horse5%
echo ==================
echo 6) Store
echo 7) Save
echo.
call save.bat
echo Balance: %balance%
echo.
set /p playerchoice=
set save=no
if %playerchoice% == 1 set choice=Horse 1
if %playerchoice% == 2 set choice=Horse 2
if %playerchoice% == 3 set choice=Horse 3
if %playerchoice% == 4 set choice=Horse 4
if %playerchoice% == 5 set choice=Horse 5
if %playerchoice% == 6 goto store
if %playerchoice% == 7 goto save
if %playerchoice% == $ goto cheat
cls
echo How much do you want to wager?
call save.bat
echo Balance: %balance%
echo.
set /p bet=
if %bet% EQU 0 set beterror=yes&& goto horseselect
call save.bat
if %bet% GTR %balance% set beterror=yes&& goto horseselect
set /a balance=%balance%-%bet%
echo set balance=%balance% > save.bat
color c
echo.
echo $%bet% Deducted!
set beterror=no
pause>nul
color f
set start=no
goto setter
:game
cls
call save.bat
echo Balance: %balance%  /+\  Your bet: %bet%  /+\  Your choice: %choice%
echo.
echo.
echo %a1%%a2%%a3%%a4%%a5%%a6%%a7%%a8%%a9%%a10%%a11%%a12%%a13% /\ %a14%
echo.
echo %b1%%b2%%b3%%b4%%b5%%b6%%b7%%b8%%b9%%b10%%b11%%b12%%b13% /\ %b14%
echo.
echo %c1%%c2%%c3%%c4%%c5%%c6%%c7%%c8%%c9%%c10%%c11%%c12%%c13% /\ %c14%
echo.
echo %d1%%d2%%d3%%d4%%d5%%d6%%d7%%d8%%d9%%d10%%d11%%d12%%d13% /\ %d14%
echo.
echo %e1%%e2%%e3%%e4%%e5%%e6%%e7%%e8%%e9%%e10%%e11%%e12%%e13% /\ %e14%
echo.
set winners=0
if %a14% == @ set /a winners=%winners%+1
if %b14% == @ set /a winners=%winners%+1
if %c14% == @ set /a winners=%winners%+1
if %d14% == @ set /a winners=%winners%+1
if %e14% == @ set /a winners=%winners%+1
if %winners% GTR 1 goto tie
if %a14% == @ set winner=Horse 1&& set winner2=1&& goto end
if %b14% == @ set winner=Horse 2&& set winner2=2&& goto end
if %c14% == @ set winner=Horse 3&& set winner2=3&& goto end
if %d14% == @ set winner=Horse 4&& set winner2=4&& goto end
if %e14% == @ set winner=Horse 5&& set winner2=5&& goto end
if %start% == no echo Press any key to start the race!
if %start% == no pause>nul
set start=yes
set pause=0
:pauselimit
set /a pause=%pause%+1
if %pause% LSS 150 goto pauselimit
goto horse1

:horse1
set /a move=%random%*7/32767+1
if %move% == 1 set motion=1
if %move% == 5 set motion=1
if %move% == 6 set motion=1
if %move% == 2 set motion=2
if %move% == 7 set motion=2
if %move% == 3 set motion=3
if %move% == 4 set motion=0
set mlimit=0
if %motion% == 0 goto horse2
if %a1% == @ set a2=@&& set a1=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a2% == @ set a3=@&& set a2=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a3% == @ set a4=@&& set a3=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a4% == @ set a5=@&& set a4=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a5% == @ set a6=@&& set a5=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a6% == @ set a7=@&& set a6=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a7% == @ set a8=@&& set a7=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a8% == @ set a9=@&& set a8=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a9% == @ set a10=@&& set a9=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a10% == @ set a11=@&& set a10=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a11% == @ set a12=@&& set a11=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a12% == @ set a13=@&& set a12=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse2
if %a13% == @ set a14=@&& set a13=_&& goto horse2
goto horse2

:horse2
set /a move=%random%*7/32767+1
if %move% == 1 set motion=1
if %move% == 5 set motion=1
if %move% == 6 set motion=1
if %move% == 2 set motion=2
if %move% == 7 set motion=2
if %move% == 3 set motion=3
if %move% == 4 set motion=0
set mlimit=0
if %motion% == 0 goto horse3
if %b1% == @ set b2=@&& set b1=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b2% == @ set b3=@&& set b2=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b3% == @ set b4=@&& set b3=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b4% == @ set b5=@&& set b4=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b5% == @ set b6=@&& set b5=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b6% == @ set b7=@&& set b6=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b7% == @ set b8=@&& set b7=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b8% == @ set b9=@&& set b8=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b9% == @ set b10=@&& set b9=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b10% == @ set b11=@&& set b10=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b11% == @ set b12=@&& set b11=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b12% == @ set b13=@&& set b12=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse3
if %b13% == @ set b14=@&& set b13=_&& goto horse3
goto horse3

:horse3
set /a move=%random%*7/32767+1
if %move% == 1 set motion=1
if %move% == 5 set motion=1
if %move% == 6 set motion=1
if %move% == 2 set motion=2
if %move% == 7 set motion=2
if %move% == 3 set motion=3
if %move% == 4 set motion=0
set mlimit=0
if %motion% == 0 goto horse4
if %c1% == @ set c2=@&& set c1=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c2% == @ set c3=@&& set c2=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c3% == @ set c4=@&& set c3=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c4% == @ set c5=@&& set c4=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c5% == @ set c6=@&& set c5=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c6% == @ set c7=@&& set c6=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c7% == @ set c8=@&& set c7=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c8% == @ set c9=@&& set c8=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c9% == @ set c10=@&& set c9=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c10% == @ set c11=@&& set c10=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c11% == @ set c12=@&& set c11=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c12% == @ set c13=@&& set c12=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse4
if %c13% == @ set c14=@&& set c13=_&& goto horse4
goto horse4

:horse4
set /a move=%random%*7/32767+1
if %move% == 1 set motion=1
if %move% == 5 set motion=1
if %move% == 6 set motion=1
if %move% == 2 set motion=2
if %move% == 7 set motion=2
if %move% == 3 set motion=3
if %move% == 4 set motion=0
set mlimit=0
if %motion% == 0 goto horse5
if %d1% == @ set d2=@&& set d1=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d2% == @ set d3=@&& set d2=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d3% == @ set d4=@&& set d3=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d4% == @ set d5=@&& set d4=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d5% == @ set d6=@&& set d5=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d6% == @ set d7=@&& set d6=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d7% == @ set d8=@&& set d7=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d8% == @ set d9=@&& set d8=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d9% == @ set d10=@&& set d9=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d10% == @ set d11=@&& set d10=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d11% == @ set d12=@&& set d11=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d12% == @ set d13=@&& set d12=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto horse5
if %d13% == @ set d14=@&& set d13=_&& goto horse5
goto horse5

:horse5
set /a move=%random%*7/32767+1
if %move% == 1 set motion=1
if %move% == 5 set motion=1
if %move% == 6 set motion=1
if %move% == 2 set motion=2
if %move% == 7 set motion=2
if %move% == 3 set motion=3
if %move% == 4 set motion=0
set mlimit=0
if %motion% == 0 goto game
if %e1% == @ set e2=@&& set e1=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e2% == @ set e3=@&& set e2=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e3% == @ set e4=@&& set e3=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e4% == @ set e5=@&& set e4=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e5% == @ set e6=@&& set e5=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e6% == @ set e7=@&& set e6=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e7% == @ set e8=@&& set e7=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e8% == @ set e9=@&& set e8=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e9% == @ set e10=@&& set e9=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e10% == @ set e11=@&& set e10=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e11% == @ set e12=@&& set e11=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e12% == @ set e13=@&& set e12=_&& set /a mlimit= %mlimit%+1
if %mlimit%== %motion% goto game
if %e13% == @ set e14=@&& set e13=_&& goto game
goto game

:end
echo %winner% Wins!
echo.
set /a wager=%bet%*2
call save.bat
if %playerchoice% == %winner2% set /a balance=%balance%+%wager%+%bet%
echo set balance=%balance% > save.bat
echo Your total balance is %balance%
echo.
pause
goto horseselect
:tie
echo Winners!
echo =======
echo.
if %a14% == @ set winner1=1&& echo Horse 1
if %b14% == @ set winner2=2&& echo Horse 2
if %c14% == @ set winner3=3&& echo Horse 3
if %d14% == @ set winner4=4&& echo Horse 4
if %e14% == @ set winner5=5&& echo Horse 5
echo.
set /a wager=%bet%/2
call save.bat
if %playerchoice% == %winner1% set /a balance=%balance%+%bet%+%wager%
if %playerchoice% == %winner2% set /a balance=%balance%+%bet%+%wager%
if %playerchoice% == %winner3% set /a balance=%balance%+%bet%+%wager%
if %playerchoice% == %winner4% set /a balance=%balance%+%bet%+%wager%
if %playerchoice% == %winner5% set /a balance=%balance%+%bet%+%wager%
echo Your total balance is %balance%
echo.
pause
goto horseselect

:loose
cls
color c
echo Thanks for playing! Please visit DesignsByJCM.com
echo.
echo YOU RAN OUT OF MONEY! :(
echo.
echo Time for a reset :P
pause>nul
echo set balance=500 > save.bat
cls
color f
echo You have been granted 500 dollars
echo.
pause
goto horseselect

:cheat
call save.bat
set /p cheat=
set /a balance=%balance%+%cheat%
echo set balance=%balance% >save.bat
goto horseselect

:save
echo set balance=%balance% > save.bat
echo color e >> save.bat
echo set horse1=%horse1% >> save.bat
echo set horse2=%horse2% >> save.bat
echo set horse3=%horse3% >> save.bat
echo set horse4=%horse4% >> save.bat
echo set horse5=%horse5% >> save.bat
set save=yes
goto horseselect

:store
if %stoerror% == yes echo Not enough cash!
cls
echo Trade in some of your cash for there awesome features!
call save.bat
echo Balance: %balance%
echo.
echo 1) Bet on 2 horses (Works only 1 time)     - $250
echo 2) Name a horse                            - $500
echo 3) Gold Text                               - $1000
echo ==================================================
echo 4) Exit
set /p op=
set error=no
if %op% == 1 goto bet2horse
if %op% == 2 goto namehorse
if %op% == 3 goto goldtext
if %op% == 4 goto horseselect

:namehorse
cls
echo What horse do you want to name?
echo 1) %horse1%
echo 2) %horse2%
echo 3) %horse3%
echo 4) %horse4%
echo 5) %horse5%
echo.
set /p op=
cls
echo What do you want to name it?
set /p name=
if %op% == 1 set horse1=%name%
if %op% == 2 set horse2=%name%
if %op% == 3 set horse3=%name%
if %op% == 4 set horse4=%name%
if %op% == 5 set horse5=%name%
goto save

:goldtext
call save.bat
if %balance% LSS 1000 set stoerror=yes&& goto store
set /a balance=%balance%-1000
echo set balance=%balance% > save.bat
echo color e >> save.bat
echo set horse1=%horse1% >> save.bat
echo set horse2=%horse2% >> save.bat
echo set horse3=%horse3% >> save.bat
echo set horse4=%horse4% >> save.bat
echo set horse5=%horse5% >> save.bat
goto store

:setter
set a1=@
set a2=_
set a3=_
set a4=_
set a5=_
set a6=_
set a7=_
set a8=_
set a9=_
set a10=_
set a11=_
set a12=_
set a13=_
set a14=_
set b1=@
set b2=_
set b3=_
set b4=_
set b5=_
set b6=_
set b7=_
set b8=_
set b9=_
set b10=_
set b11=_
set b12=_
set b13=_
set b14=_
set c1=@
set c2=_
set c3=_
set c4=_
set c5=_
set c6=_
set c7=_
set c8=_
set c9=_
set c10=_
set c11=_
set c12=_
set c13=_
set c14=_
set d1=@
set d2=_
set d3=_
set d4=_
set d5=_
set d6=_
set d7=_
set d8=_
set d9=_
set d10=_
set d11=_
set d12=_
set d13=_
set d14=_
set e1=@
set e2=_
set e3=_
set e4=_
set e5=_
set e6=_
set e7=_
set e8=_
set e9=_
set e10=_
set e11=_
set e12=_
set e13=_
set e14=_
goto game
Title: Re: Batch Programs Thread.
Post by: patio on June 26, 2018, 06:21:18 PM
Quote
(This will create a "save.bat" file in the same location as the game) Just as a warning

Then why would i run it ? ?
Title: Re: Batch Programs Thread.
Post by: JoshCM on June 29, 2018, 07:59:38 AM
Then why would i run it ? ?
Because it's very easy to see that it's harmless? I was just making anyone who chooses to play aware that the file will be created. In case they have a file already named save.bat that they want to keep. It's called common curtsy
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on June 29, 2018, 08:22:06 AM
It's called common curtsy

Courtesy?
Title: Re: Batch Programs Thread.
Post by: JoshCM on June 29, 2018, 11:36:32 AM
Courtesy?

Nope.
Title: Re: Batch Programs Thread.
Post by: DaveLembke on June 29, 2018, 12:29:38 PM
Salmon said back in January... Did a ghost press the power button?

Not rezzing this, but just sharing that WOL has been known to be a problem at times with PC's getting a WOL signal and starting themselves. I had a Zotac Mini ITX build that kept turning itself on. It wasn't until I disabled WOL that the problem was solved. The guy putting a batch into startup to check to see if he is there and if no response after a count down to force shutdown the system likely has WOL enabled and its getting triggered to start. Disabling WOL will probably fix this without the batch needed.
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on June 29, 2018, 12:43:16 PM
Nope.
Your spelling needs attention, as well as your manners.
Title: Re: Batch Programs Thread.
Post by: patio on June 29, 2018, 04:38:18 PM
A curtsy is grabbing your dress corners and doing a 3/4 kneel...
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on June 30, 2018, 12:34:52 AM
A curtsy is grabbing your dress corners and doing a 3/4 kneel...
Interestingly, curtsy (noun/verb: knee bend) can be spelled curtsey and courtesy, but courtesy (noun: politeness) has only one spelling.
Title: Re: Batch Programs Thread.
Post by: BC_Programmer on June 30, 2018, 01:32:31 AM
Interestingly, curtsy (noun/verb: knee bend) can be spelled curtsey and courtesy, but courtesy (noun: politeness) has only one spelling.

Curtsey's with respect.
Title: Re: Batch Programs Thread.
Post by: JoshCM on July 02, 2018, 05:46:54 AM
Your spelling needs attention, as well as your manners.
My bad manners were because of someone else who also had bad manners. Although I made a spelling error in that post, I managed to get though college on the Dean's list. So I'm satisfied with my level of education at this time. Trolling is a waste of your time. There is so much to be learned. There is so much to see. So many experiences to be had. Get out there and make it happen man.
Title: Re: Batch Programs Thread.
Post by: Brentrubin on October 01, 2018, 08:12:33 PM
Can anyone help me make this script work?

I'm making this simple program to use at work because I multiply stuff by the same number, all day, every day.

I want to be able to enter a variable and multiply it by 1.2

See below for code

:cost
cls
echo.
echo.
echo.
echo.
echo.
echo Please enter the freight cost provided from AllStates WorldCargo website.
echo.
set /P num1multiply=
echo.
set a=1.2
echo.
set /A Ans=%num1multiply% * %a%
echo.
echo The cost is: %Ans%
echo.
pause
exit

Can anyone please help me make this work?

I keep getting "missing operator" message

Thanks!
Title: Re: Batch Programs Thread.
Post by: nil on October 01, 2018, 08:49:11 PM
Unfortunately MS-DOS doesn't do floating point operations. If you want precise math you'll have to use another scripting language, like VBScript or Python.

Python 3 can be downloaded at https://www.python.org/downloads/release/python-370/ (https://www.python.org/downloads/release/python-370/). (Scroll down for windows installer)

Your script in Python 3:

Code: [Select]
prompt = "Please enter the freight cost. "
multiplicand = float(input(prompt))
multiplier = 1.2
product = multiplicand * multiplier
print("The cost is", product)
exit(0)

save as (for instance) cargo.py, and run with python cargo.py

example operation:

Code: [Select]
Please enter the freight cost. 1.618                     
The cost is 1.9416

Hope this helps


Title: Help .batch paint, cut
Post by: brunoteta on March 14, 2019, 07:48:42 PM
Hi, need help to create a .batch file to open paint(or oder image editor), one or more images, cut top left corner (custom width x height), select "pick color" tool to fill the hole, save and close.

its possible? thanks
Title: Re: Help .batch paint, cut
Post by: Squashman on March 16, 2019, 09:15:58 PM
Hi, need help to create a .batch file to open paint(or oder image editor), one or more images, cut top left corner (custom width x height), select "pick color" tool to fill the hole, save and close.

its possible? thanks
No.  Batch files cannot interact with Graphical User Interfaces.
Title: Re: Help .batch paint, cut
Post by: Geek-9pm on March 17, 2019, 10:38:01 PM
No.  Batch files cannot interact with Graphical User Interfaces.
True.
The alternative is some kind of automation program that will invoke things like a human would. Either keystrokes or mouse movements.
Here is a link that might be relevant:

 5 best programs to automate PC tasks (https://windowsreport.com/automate-pc-tasks/)

He includes AutoHotkey
Here is the CH archive about AutoHotKey:
https://www.computerhope.com/jargon/a/autohotkey.htm
AutoHotkey is a fantastic free and open source Microsoft Windows tool that allows you to create macros, scripts, and automate frequently performed tasks on your computer. For example, Computer Hope uses this tool daily to help answer common questions asked in e-mail quickly and perform other common repetitive tasks.
It does have a learning g curve. But it is worth the effort.  :)
Title: Re: Batch Programs Thread.
Post by: Salmon Trout on March 18, 2019, 01:39:59 AM
There is a program called ImageMagick (spelled thus) which can do most or all of the OP's tasks from a script or the command line.
Title: Re: Batch Programs Thread.
Post by: Hackoo on November 27, 2022, 07:48:13 PM
Hi  ;)
I want to share with you this little batch : System_Info_HTML_Output.bat

Code: [Select]
@echo off
CHCP 65001>nul
Title System Info With HTML Output by Hackoo 2022
Color 0B & Mode 57,3
Set Systeminfo_TXT=%~dp0Systeminfo_TXT.txt
Set Systeminfo_HTML=%~dp0systeminfo.html
echo(
systeminfo>"%Systeminfo_TXT%"
call :CreateHTMLtable "%Systeminfo_TXT%" "%Systeminfo_HTML%"
Start "" "%Systeminfo_HTML%"
Exit /b
::------------------------------------------------------------------------------------------------------------------------------------------------------
:CreateHTMLTable <inputfile> <outputfile>
>"%~2" (
echo ^<!DOCTYPE HTML PUBLIC
echo "-//W3C//DTD HTML 4.01 Transitional//EN"
echo  "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"^>
echo ^<HTML^>
echo ^<HEAD^>
echo ^<META HTTP-EQUIV="Content-Type"
echo CONTENT="text/html; charset=utf-8"^>
echo ^</HEAD^>
echo ^<BODY^>
echo ^<style type="text/css"^>
echo .tftable {font-weight: bold;font-size:16px;color:#333333;width:100%;border-width: 1px;border-color: #bcaf91;border-collapse: collapse;}
echo .tftable th {font-size:16px;background-color:#ded0b0;border-width: 1px;padding: 8px;border-style: solid;border-color: #bcaf91;text-align:left;}
echo .tftable tr {background-color:#e9dbbb;}
echo .tftable td {font-size:16px;border-width: 1px;padding: 8px;border-style: solid;border-color: #bcaf91;}
echo .tftable tr:hover {background-color:#ffffff;}
echo ^</style^>
echo ^<center^>^<table class="tftable" border="1"^>
)
@for /f "tokens=1,* delims=:" %%a in ('Type "%~1"') do (
>>"%~2" echo ^<tr^>^<td^>%%a^</td^>^<td^>%%b^</td^>^</tr^>
)
>>"%~2" (
echo ^</table^>
echo ^</BODY^>
echo ^</HTML^>
)
Exit /B
::------------------------------------------------------------------------------------------------------------------------------------------------------