Home / Microsoft / Microsoft DOS / Batch Programs Thread.
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 ... 34 35 [36] 37 - (Bottom) Print
Author Topic: Batch Programs Thread.  (Read 99441 times)
lmsmi1
Rookie



Posts: 13

Experience: Beginner
OS: Windows XP

« Reply #525 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.
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #526 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)

IP logged


Proud to be European
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #527 on: November 05, 2011, 06:18:51 PM »

the point is to get my scripts out there for everyone to use.

Use for what?
IP logged


Proud to be European
lmsmi1
Rookie



Posts: 13

Experience: Beginner
OS: Windows XP

« Reply #528 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.
IP logged
lmsmi1
Rookie



Posts: 13

Experience: Beginner
OS: Windows XP

« Reply #529 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
IP logged
Geek-9pm
Sage



Thanked: 373
Posts: 8,930

Computer: Specs
Experience: Expert
OS: Windows XP


Geek After Dark

Geek 9pm blog
« Reply #530 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.
IP logged

patio
Moderator
Genius



Thanked: 1069
Posts: 11,354

Experience: Beginner
OS: Windows 7


Maud' Dib

« Reply #531 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...
IP logged

   
"
All generalizations are false, including this one.  "
Helpmeh
Egghead



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #532 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.
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
lmsmi1
Rookie



Posts: 13

Experience: Beginner
OS: Windows XP

« Reply #533 on: November 05, 2011, 09:58:03 PM »

This is the batch program thread, so I posted here.
IP logged
Helpmeh
Egghead



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #534 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.
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
lmsmi1
Rookie



Posts: 13

Experience: Beginner
OS: Windows XP

« Reply #535 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.
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #536 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



IP logged


Proud to be European
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #537 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

IP logged


Proud to be European
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,880

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #538 on: November 06, 2011, 02:51:29 PM »

To use to prank or spam out someone

From Computer hope forum rules

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.



IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Raven19528
Hopeful



Thanked: 29
Posts: 284

Computer: Specs
Experience: Experienced
OS: Windows 7



« Reply #539 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.
IP logged

"All things that are
Are with more spirit chased than enjoy'd" -Shakespeare
Pages: 1 ... 34 35 [36] 37 - (Top) Print 
Home / Microsoft / Microsoft DOS / Batch Programs Thread. « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.133 seconds with 20 queries.