r/BatchScripts • • Sep 16 '24

Timestamp suddenly not showing in output name?

1 Upvotes

I have this batch scripts that has been running fine and creating output with date and timestamp for each run. Today, I ran it and it is not including the timestamp.

When I double clicked the bat, there was a cmd pop up I had to respond to about security and policy and I selected A to change all (something like that). Did this response cause this?


r/BatchScripts • • Aug 05 '24

Basic AI

1 Upvotes

I made a basic utility AI assistant in batch script. Here’s a discord link, it has the file (9kb): https://discord.gg/4Af2bRr2Dh

Main thing I like about it is that it’s so tiny, and runs completely on your computer. There is nothing that connects it to the internet.


r/BatchScripts • • May 31 '24

Silent/Automatic Software Agent Deployment via Script

1 Upvotes

I'm working on a project where I need to deploy a software agent to user devices. The requirement is for the deployment to be completely silent and automatic, initiated by a script running on the user's device.

Here are the specific details:

The script will download the agent from a cloud storage location (e.g., S3 bucket).

The downloaded agent will then be automatically installed on the user's device.

The entire process should be seamless and require no user interaction.

Can someone please help me with the script


r/BatchScripts • • Jan 07 '23

A script to fill some forms

1 Upvotes

Hello guys, I haven't used batch scripts much. I have an excel sheet where I have some data and there is an application which ask for a few details. The data in Excel needs to copied here and press a button in that application. I don't think that application has a CLI. Is there a way to automate this? It would be of great help


r/BatchScripts • • Dec 31 '22

Moving files with same extension to a new folder?

1 Upvotes

I know this is probably basic level stuff, but i do not code.

I am looking to create a batch script i can put in a folder that upon running will do the following.

Create a folder inside that folder named RAW

For this i used "md RAW' which works at creating the folder

The next thing i want it to do is move all files with a .CR3 extension (Canon camera raw files) to the folder named RAW within the current directory

For this i used "move %cd%\*.cr3 %cd%\RAW" but it doesn't seem to work as I intended it to. Upon a few hours of research I thought I learned that Move would move files, %cd% was for the current directory, and the * symbol was the wildcard meaning all files

The purpose of this is to sort out Raw files, and .jpg files when i dump the SD card from the camera so the .JPG stay put and all my raw files go into a folder named raw.

While i will happily accept someone just showing me the correct way to fix what i have wrong, batch scripts is something new to me, less than 24 hours and i would LOVE it if someone would take the time to explain the "WHY" portion of the correct code. IE: MOVE=Command to move %CD%=Current directory, and where and why the "spaces" are in the code. I Just ordered a book from amazon to learn more, but in typical holiday shipping fashion..... its 9 days out.


r/BatchScripts • • Dec 17 '22

Windows

1 Upvotes

Hello! I have two questions about batch scripting! 1: How to replace spaces in string to + signs? (" Windows 10 batch scripting" transforms to " Windows+10+batch+scripting) 2: How to open urls in same tab instead of new tabs? Have a great whatever part of the day it is where you u are when reading this! Ask me kindly if wrong subreddit!


r/BatchScripts • • Nov 17 '22

Music batch

1 Upvotes

Does anyone know how to start a song in batch but without showing the Groove music window??


r/BatchScripts • • Oct 11 '22

Help with a script

1 Upvotes

I need the script to pretty much be a fork bomb but instead of cmd I want it to be with folders


r/BatchScripts • • Aug 30 '22

Does anyone know how I can call this URL in a Batch Script with all of the quotes and special characters intact?

1 Upvotes

What the title says. Here is the URL:

http://a.teall.info/joystick/?c=%5B%5B%5B0-650-435-%22%22-0-%2260%22-%5B2-24-0%5D%5D-%5B0-650-505-%22%22-0-%2260%22-%5B2-26-0%5D%5D-%5B0-690-470-%22%22-0-%2260%22-%5B2-25-0%5D%5D-%5B0-610-470-%22%22-0-%2260%22-%5B2-27-0%5D%5D-%5B6-635-415-%22LATERAL%22-110-0%5D-%5B6-590-450-%22VERTICAL%22-110-1%5D-%5B3-800-420-%22ROLL%22-%22PITCH%22-0-%5B2-1%5D-%5B2-2%5D-%5B%3B1-1-0-1%5D-%5B%3B1-1-1-1%5D%5D-%5B0-670-370-%22CARGO%22-1-%22110%22-%5B2-5-0%5D%5D-%5B0-575-370-%22BOOST%22-1-%22110%22-%5B2-31-0%5D%5D-%5B0-870-330-%22S%20CELL%22-1-%22110%22-%5B2-21-0%5D%5D-%5B0-775-330-%22H%20SINK%22-1-%22110%22-%5B2-20-0%5D%5D-%5B0-775-370-%22FIRE%201%22-1-%22110%22-%5B2-1-0%5D%5D-%5B0-870-370-%22FIRE%202%22-1-%22110%22-%5B2-6-0%5D%5D-%5B0-575-330-%22L%20GEAR%22-1-%22110%22-%5B2-23-0%5D%5D-%5B0-670-330-%22CHAFF%22-1-%22110%22-%5B2-22-0%5D%5D%5D-%5B%22%23ff0000%22-%22%23000000c0%22-0-%22%23000000ff%22-2-0.5-%22Verdana%22-140-110-125-1-%22%23044904%22-%22%23000000%22-0.02-10%5D%5D

The %22 is automatically replacing quote characters, but that doesn't seem to be the problem. I don't think the % characters are being read when the batch script is run, and there may be other errors with the special characters that I don't even know about.

Using START "" chrome.exe "http://a.teall.info/joystick/?c=%5B%5B%5B0-650-435-%22%22-0-%2260%22-%5B2-24-0%5D%5D-%5B0-650-505-%22%22-0-%2260%22-%5B2-26-0%5D%5D-%5B0-690-470-%22%22-0-%2260%22-%5B2-25-0%5D%5D-%5B0-610-470-%22%22-0-%2260%22-%5B2-27-0%5D%5D-%5B6-635-415-%22LATERAL%22-110-0%5D-%5B6-590-450-%22VERTICAL%22-110-1%5D-%5B3-800-420-%22ROLL%22-%22PITCH%22-0-%5B2-1%5D-%5B2-2%5D-%5B%3B1-1-0-1%5D-%5B%3B1-1-1-1%5D%5D-%5B0-670-370-%22CARGO%22-1-%22110%22-%5B2-5-0%5D%5D-%5B0-575-370-%22BOOST%22-1-%22110%22-%5B2-31-0%5D%5D-%5B0-870-330-%22S%20CELL%22-1-%22110%22-%5B2-21-0%5D%5D-%5B0-775-330-%22H%20SINK%22-1-%22110%22-%5B2-20-0%5D%5D-%5B0-775-370-%22FIRE%201%22-1-%22110%22-%5B2-1-0%5D%5D-%5B0-870-370-%22FIRE%202%22-1-%22110%22-%5B2-6-0%5D%5D-%5B0-575-330-%22L%20GEAR%22-1-%22110%22-%5B2-23-0%5D%5D-%5B0-670-330-%22CHAFF%22-1-%22110%22-%5B2-22-0%5D%5D%5D-%5B%22%23ff0000%22-%22%23000000c0%22-0-%22%23000000ff%22-2-0.5-%22Verdana%22-140-110-125-1-%22%23044904%22-%22%23000000%22-0.02-10%5D%5D" doesn't seem to work.

Running the script results in this URL being called: http://a.teall.info/joystick/?c=BBB0-650-435-22-0-2602-B2-24-0DD-B0-650-505-22-0-2602-B2-26-0DD-B0-690-470-22-0-2602-B2-25-0DD-B0-610-470-22-0-2602-B2-27-0DD-B6-635-415-2LATERAL2-110-0D-B6-590-450-2VERTICAL2-110-1D-B3-800-420-2ROLL2-2PITCH2-0-B2-1D-B2-2D-BB1-1-0-1D-BB1-1-1-1DD-B0-670-370-2CARGO2-1-21102-B2-5-0DD-B0-575-370-2BOOST2-1-21102-B2-31-0DD-B0-870-330-2S0CELL2-1-21102-B2-21-0DD-B0-775-330-2H0SINK2-1-21102-B2-20-0DD-B0-775-370-2FIRE012-1-21102-B2-1-0DD-B0-870-370-2FIRE022-1-21102-B2-6-0DD-B0-575-330-2L0GEAR2-1-21102-B2-23-0DD-B0-670-330-2CHAFF2-1-21102-B2-22-0DDD-B23ff00002-23000000c02-0-23000000ff2-2-0.5-2Verdana2-140-110-125-1-230449042-230000002-0.02-10DD


r/BatchScripts • • Jul 21 '22

hello i need hello for use t'as script. i have try to use to call fonctionne in this menu but nothing to do. can you explain me ho to call fonction if i validé first item ? i have try error level but nothing ?

1 Upvotes

<# : Batch portion @echo off & setlocal enabledelayedexpansion set "menu[0]=Format C:" set "menu[1]=Send spam to boss" set "menu[2]=Truncate database *" set "menu[3]=Randomize user password" set "menu[4]=Download Dilbert" set "menu[5]=Hack local AD" for /L %%I in (6,1,15) do set "menu[%%I]=loop-generated demo item %%I" set "default=0" powershell -noprofile "iex (${%~f0} | out-string)" echo You chose !menu[%ERRORLEVEL%]!. goto :EOF : end batch / begin PowerShell hybrid chimera #> $menutitle = "CHOOSE YOUR WEAPON" $menuprompt = "Use the arrow keys. Hit Enter to select." $menufgc = "yellow" $menubgc = "darkblue" [int]$selection = $env:default $h = $Host.UI.RawUI.WindowSize.Height $w = $Host.UI.RawUI.WindowSize.Width # assume the dialog must be at least as wide as the menu prompt $len = [math]::max($menuprompt.length, $menutitle.length) # get all environment vars matching menu[int] $menu = gci env: | ?{ $_.Name -match "menu[(\d+)]$" } | sort @{ # sort on array index as int Expression={[int][RegEx]::Match($_.Name, '\d+').Value} } | %{ $val = $_.Value.trim() # truncate long values if ($val.length -gt ($w - 8)) { $val = $val.Substring(0,($w - 11)) + "..." } $val # as long as we're looping through all vals anyway, check whether the # dialog needs to be widened $len = [math]::max($val.Length, $len) } # dialog must accomodate string length + box borders + idx label $dialogwidth = $len + 8 # center horizontally $xpos = [math]::floor(($w - $dialogwidth) / 2) # center at top 1/3 of the console $ypos = [math]::floor(($h - ($menu.Length + 4)) / 3) # Is the console window scrolled? $offY = [console]::WindowTop # top left corner coords... $x = [math]::max(($xpos - 1), 0); $y = [math]::max(($offY + $ypos - 1), 0) $coords = New-Object Management.Automation.Host.Coordinates $x, $y # ... to the bottom right corner coords $rect = New-Object Management.Automation.Host.Rectangle $coords.X, $coords.Y, ($w - $xpos + 1), ($offY + $ypos + $menu.length + 4 + 1) # The original console contents will be restored later. $buffer = $Host.UI.RawUI.GetBufferContents($rect) function destroy { $Host.UI.RawUI.SetBufferContents($coords,$buffer) } $box = @{ "nw" = [char]0x2554 # northwest corner "ns" = [char]0x2550 # horizontal line "ne" = [char]0x2557 # northeast corner "ew" = [char]0x2551 # vertical line "sw" = [char]0x255A # southwest corner "se" = [char]0x255D # southeast corner "lsel" = [char]0x2192 # right arrow "rsel" = [char]0x2190 # left arrow } function WriteTo-Pos ([string]$str, [int]$x = 0, [int]$y = 0, [string]$bgc = $menubgc, [string]$fgc = $menufgc) { $saveY = [console]::CursorTop [console]::setcursorposition($x,$offY+$y) Write-Host $str -b $bgc -f $fgc -nonewline [console]::setcursorposition(0,$saveY) } # Wait for keypress of a recognized key, return virtual key code function getKey { # PgUp/PgDn + arrows + enter + 0-9 $valid = 33..34 + 37..40 + 13 + 48..(47 + [math]::min($menu.length, 10)) # 10=a, 11=b, etc. if ($menu.length -gt 10) { $valid += 65..(54 + $menu.length) } while (-not ($valid -contains $keycode)) { $keycode = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown').VirtualKeyCode } $keycode } # for centering the title and footer prompt function center([string]$what, [string]$fill = " ") { $lpad = $fill * [math]::max([math]::floor(($dialogwidth - 4 - $what.length) / 2), 0) $rpad = $fill * [math]::max(($dialogwidth - 4 - $what.length - $lpad.length), 0) "$lpad $what $rpad" } function menu { $y = $ypos WriteTo-Pos ($box.nw + (center $menutitle $box.ns) + $box.ne) $xpos ($y++) WriteTo-Pos ($box.ew + (" " * ($dialogwidth - 2)) + $box.ew) $xpos ($y++) # while $item can equal $menu[$i++] without error... for ($i=0; $item = $menu[$i]; $i++) { $rtpad = " " * [math]::max(($dialogwidth - 8 - $item.length), 0) if ($i -eq $selection) { WriteTo-Pos ($box.ew + " " + $box.lsel + " $item " + $box.rsel + $rtpad + $box.ew) $xpos ($y++) $menufgc $menubgc } else { # if $i is 2 digits, switch to the alphabet for labeling $idx = $i; if ($i -gt 9) { [char]$idx = $i + 55 } WriteTo-Pos ($box.ew + " $idx`: $item $rtpad" + $box.ew) $xpos ($y++) } } WriteTo-Pos ($box.sw + ([string]$box.ns * ($dialogwidth - 2) + $box.se)) $xpos ($y++) WriteTo-Pos (" " + (center $menuprompt) + " ") $xpos ($y++) 1 } while (menu) { [int]$key = getKey switch ($key) { 33 { $selection = 0; break } # PgUp/PgDn 34 { $selection = $menu.length - 1; break } 37 {} # left or up 38 { if ($selection) { $selection-- }; break } 39 {} # right or down 40 { if ($selection -lt ($menu.length - 1)) { $selection++ }; break } # letter, number, or enter default { # if alpha key, align with VirtualKeyCodes of number keys if ($key -gt 64) { $key -= 7 } if ($key -gt 13) {$selection = $key - 48} # restore the original console buffer contents destroy exit($selection) } }}


r/BatchScripts • • Jun 15 '22

Script to move files to a specific folder and replace the old files with the new ones.

1 Upvotes

As the title explains I want a script to move multiple certain files and move them all into specific folders I am not sure if this is possible but that is why I am here so thanks for all the help and goodbye.


r/BatchScripts • • Feb 11 '22

A Windows Scheduled Task to Launch MSAccess mdb, updatetables and complete.

1 Upvotes

Here is the simple command lines that used to complete successfully but no longer does via batch script from Windows Server 2012 task manager. I'm not sure what could be causing this scheduled task to no longer work. Also, in Windows task manager it will run as if it is hung. A second Batch script executes to compact the db 5 hours later. It should take maybe an hour when it used to work.

In Windows task scheduler it shows it ran successfully but the DB tables do not update. I will try the repair db tool in MS Office '13-Access utility also and see if this helps.

taskkill /IM MSACCESS.EXE /f
REM "C:\Program Files (x86)\Microsoft Office\Office14\msaccess.exe" "\e:\myaccessdb.mdb" /x "UpdateTables"
"C:\Program Files (x86)\Microsoft Office\Office14\msaccess.exe" "e:\myAccessdb.mdb" /x "UpdateTables"


r/BatchScripts • • Feb 09 '22

Need help with a batch script to rearrange and resize windows

1 Upvotes

So there is this plug-in for stream Deck that can rearrange multiple windows with one click (Windows Mover) .. well, I don't have a Stream Deck .. and wondering if there's a script I could run in a .bat file to do that.

I tried a macro recorder to record the mouse movement and it works, but not very accurate especially with two monitors and kinda slow.

Thanks.


r/BatchScripts • • Dec 24 '21

Need help with for loop and a list of wildcard file names

1 Upvotes

Pretty simple task, but I’m stuck and need help. Thank you in advance.

Built a batch script that loops through the dir looking for wildcarded file names, then copy them into a separate dir. see below:

—— Set /p dir= Enter Dir:

for /f “delims=“ %%I in (MasterFileList.txt) do (xcopy “%dir%%%I” “%dir%\TargetDir%%I”) ——

MasterFileList Examples: *390.txt *4TB.txt …

The issue is the script is not recognizing the wildcard file names.


r/BatchScripts • • Nov 02 '21

Need help auto moving files in subfolder to another subfolder.

1 Upvotes

Hello, right now I know how to auto move files from a subfolder in one folder to another subfolder in a different folder after they turn a certain age.

Basically: Folder A/Folder B/Files ----> Folder W/Folder X/

Then I have to make another script to move other files in Folder A subfolders.

Example: Folder A/Folder C/Files ----> Folder W/Folder Y

Is there a way to do this without having to make a separate batch script for each Source/Destination folder?

I basically need a way to automate all the subfolders files that are under Folder A into Folder W subfolders, after files turn a certain age. I hope this makes sense. Windows 10


r/BatchScripts • • Sep 22 '21

First timer need help

1 Upvotes

I plan to use a counter variable in a loop so im testing out how it works. eg, loop1 = "hello", loop2 = "bye bye" ... etc etc. So the goal is to give every variable an incrementing name depending on what is set/read during the loop, in this case, I am are using the "hello" string for example.

@echo off

set "counter=1"

echo test%counter%

set /A test%counter% = "hello"

echo %test(%counter%)%

This is my output when I run the script:
test1

counter
But my intended output should be:
test1

hello


r/BatchScripts • • Jun 04 '21

Batch file to force set the Country name in the google home page.

1 Upvotes

Friends,

I want to force set the country name in the google home page, when the page loads. Pl. share the DOS command batch script for chrome browser.

Note: By default the google home page with with US (example), since it takes the wifi router.

Hence, By a forced batch code to set the customized country in the google home page,

Thanks

KSK


r/BatchScripts • • May 27 '21

Help with bulk renaming folders

1 Upvotes

Hi guys,

Firstly, this might be something simple for you, although I've been decent with anything computer related all my life I have never dabbled in batch scripts at all but I think its the answer to my problem here.

I have about 500 downloaded levels/songs for a game but ever folder name is just a jumble of rubbish. I want to rename every folder to the song name it contains.

So within each folder is all the files for the level but every folder has the same 'info.dat' file which has the metedata. In every one it has a line with e.g. "songName": "Blackbird"

What I want is to mass rename ever folder to match the name of the song.

Any help on how best to do this?

Thanks :)


r/BatchScripts • • May 21 '21

Trying to do a batch script that look for ip

1 Upvotes

As the title mentioned, I'm trying to do a bat script to search a uid in an internal website which have the list of machine tag to the user. Can bat script pull data from the web developer info?

After getting the machine name, will ping it to get ip. The bat file will display the machine name and ip too.

I have no idea how to start the script, can anyone provide some insight so i can try to start. Would like to know if there is better way to automate what i wanted to do.


r/BatchScripts • • Apr 27 '21

Anyone know how to make a batch file check ALL folders and not just the current folder?

1 Upvotes

Anyone know how to make a batch file check ALL folders and not just the current folder? I am creating a simple batch antivirus and I want to make it check ALL folders instead of just the one it is in.


r/BatchScripts • • Mar 16 '21

Script that works with integrated RMM

1 Upvotes

Hi all,

I'm trying to write a batch script or two that would allow me to:

  1. Using a command like: wmic qfe | find "KB9999999" and getting the value back as something easily interpreted maybe if it returns that the KB is installed that could equal a variable like 1 and if it doesn't return a value/if the KB isnt installed it'll return a value of 2.

  2. Read a registry value and then be able to relate that to a custom string on the RMM side.

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\CentraStage /v Custom2 /t REG_SZ /d /f

wmic qfe | find "KB5001567"

set KBI=

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\CentraStage /v Custom2 /t REG_SZ /d %KBI% /f

In the code above I'm trying to add a new registry to that directory, run the command to look for the newest microsoft KB, set a variable "KBI" that would take the output from the wmic command and be able to relate it to the registry data. If any clarification to help answer is needed please let me know as I'm sure I've no idea what I'm talking about :P


r/BatchScripts • • Feb 18 '21

Batch RPG Level Up System

1 Upvotes

Hello, I am new to batch coding but I have been designing a game that consists of being a decision based RPG that I want to have a pretty well done leveling system. But my problem here is one of the leveling skills is charisma, as some decisions for encounters are going to depend on convincing someone to do something or to lie to someone. But the Twist is you need a required amount of charisma.

My problem is the current situation includes a man who is stuck in a dungeon and asks you if you know the way out, I don't know how to add into the script that it takes you to a different screen if you don't have required charisma to tell them a lie, for example lets say you have 5 charisma and you need 10 charisma to convince them and say "I have no idea where the exit is," even though you just entered the dungeon or the exit. So what I want to do once again is to take the player to a screen that claims he doesn't have enough charisma to lie to this person and then take him back to the decision screen to choose something else, and if he does have enough then it takes him to the next part into the game or something. Ill copy and paste the script and please do suggest other stuff I should fix in the script just in case since I'm new to this, but for the most part I need a little bit of help here. Thanks.

u/echo off

:menu

color 0a

cls

echo Lost Dungeons

echo Respond With The Number You Desire:

echo 1. Start Game

echo 2. How To Play

echo 3. Exit

echo This Little Project Was Made By _trident0

set /p menu=

if '%menu%'=='1' (

goto setup

)

if '%menu%'=='2' (

goto instructions

)else goto menu

if '%menu%'=='3' (

exit

)

:setup

cls

echo Hello, Please enter your name (one word)

set /p name=

if '%name%'=='_trident0' (

goto Eastereggone

)

set /a level=15

set /a money=0

set /a health=100

set /a potions=0

set /a majek=10

set /a Dam=2

set /a DA (Damage Absorption)=0

set /a moneygain=70

set /a Level Currency=0

set /a Dragon=0

set /a Ghoul=0

set /a Undead Roamer=0

set /a Seeker=0

set /a Undead Dragon=0

set /a Djek The Bleeding (boss)=0

set /a Orc=0

set /a Crowen=0

set /a Burning Crowen=0

set /a Jabbawocky (boss)=0

set /a Skeleton=0

set /a Shredding Skeleton=0

set /a Spreader=0

set /a Cyris of the Catacombs (boss)=0

set /a Phantom of the Leidia=0

set /a Soul of the Leidia=0

set /a Leidia of The Lost (boss)=0

set /a Thrasher Thy Protector of Leidia (boss)=0

set /a API (Armour Protection Increase)=1

set /a Strength=10

set /a Carry=15

set /a Agility=20

set /a DM (Death Measurement)=50

set /a Stamina=30

set /a Maji=20

set /a Charisma=5

set /a Igor The Brawler (DOD= Depending on Decision, Can be companion or foe)=0

set /a ITBD=10

set /a DD=5

set /a GD=3

set /a URD=4

set /a SD=5

set /a UDD=7

set /a DTBD=15

set /a OD=7

set /a CD=8

set /a BCD=10

set /a JBWKYD=22

set /a SKD=5

set /a SHSKD=9

set /a SPRDD=10

set /a COTCMBSD=27

set /a POTLD=35

set /a SOTLD=40

set /a TTPOLD=60

set /a LOTLD=100

set /a DTBH=1000

set /a JBWKYH=5000

set /a COTCMBSH=4000

set /a TTPOLH=10000

set /a LOTLH=20000

set /a ITBH=500

set /a new=%ITBH%+10

set /a new1=%DTBH%+15

set /a new2=%JBWKYH%+22

set /a new3=%COTCMBSH%+27

set /a new4=%TTPOLH%+60

set /a new5=%LOTLH%+100

:start

cls

echo

echo %name%'s money:%money%

echo %name%'s health:%health%

echo %name%'s Amount of Potions:%potions%

echo %name%'s Level:%level%

echo %name%'s Level Currency:%Level Currency%

echo %name%'s Majek:%majek%

echo Welcome to Lost Dungeons %name%!

echo Move Foward by picking the following options:

echo 1. Start Your Journey in Dungeons of Djek

echo 2. Go to Merchant of the Abyss

echo 3. Go to Title Screen (resets progress)

echo 4. Drink a potion (%potions%)

echo 5. Check out your progress and acheivements

set /p pick=

if '%pick%'=='1' (

goto encounter

)

if '%pick%'=='2' (

goto Merchant of the Abyss

)

if '%pick%'=='3' (

goto menu

)

if '%pick%'=='4' (

goto Pinventory

)

if '%pick%'=='5' (

goto Acheivements

)

if '%pick%'=='mneycht' (

goto money cheat

)else goto start

:encounter

cls

echo Health:%health%

echo Charisma:%Charisma%

echo You encounter a very boulky figure...

echo Hey! Do you know how to get out of this stupid dungeon? My lads left me down here as some sick joke!

echo 1. Im sorry friend, I just got here. I need to pay a visit to Leidia (Lie: Need atleast 10 charisma)

echo 2. Yeah, Just follow the steps behind me and take a right.

echo 3. Get out of my way tough guy! (fight: Requires 35 strength and 100 DM)

echo 4. *silent*

set /p choose=

if '%choose%'=='1' (

goto BE1

)

if '%choose%'=='2' (

goto GE1

)

if '%choose%'=='3' (

goto VBE1

)

if '%choose%'=='4' (

goto SE1

)

pause

:instructions

cls

echo Hello! Welcome to Lost Dungeons! a little project I decided to work on that can have potential to be a immersive batch game (as far as immersive goes with batch coding that is). I assume you understand the limits to batch coding, therefore you should not expect it to be as good as a triple A game or any non-sense like that. If you want a immersive game then play Red Dead Redemption or Kingdom Come :) with that said, lets get to how to play

echo First things first, This is a decision and situation based game. Sometimes you'll choose what to do and sometimes you are put in a situation where the game drops you into something without input, for example battles with enemies and such. Also there is no way to save progress when the game is closed. You close game, you don't have your stuff back. The level up system will be pretty advanced as far as I can go, meaning you spend points to level up strength and health, that is if I find a way to do so. But if your reading this it means the game is finish which means I found a way.

echo You will have to upgrade swords and certain skills, unless you want to go a solo level 1 run. But that would require many healing potions which are buyable but dont fill up like some Dark Souls knockoff. That being said there also is bosses which I will insure to be challenging but possible to defeat. I'll make lore on the game as well, which will mean it can be expanded with your guys ideas as you wish. As well can you have money, which you get by killing enemies. Money will be used at the Merchant of the Abyss to buy different items, potions, and special items.

echo Oh and you can have your own name as you probably noticed, it takes whatever name you typed in and shows starting stats and stuff. So yeah, the game is a option choosing game pretty much and you can just play along with your desired choices. But I hope you enjoy as this has took me a while to make since i paid attention to as much detail as possible. Oh and one last thing, there are some easter eggs in here and I will list them on my instagram page for this little batch game :).

echo 1. Exit to Title Screen

set /p InstructToTitle=

if '%InstructToTitle%'=='1' (

goto menu

)

pause

:Eastereggone

cls

echo Hey! You little sneak, you used my user... Whats that? You want a reward? -sigh- fine...

set /a money=%money%+2000

pause

goto start

:money cheat

echo Error Code: 135

echo Transmitting Coin Units To User...

set /a money=%money%+4000

pause

goto start

:BE1

if %charisma% LSS 1 (

^ up there is my issue with the charisma btw

goto LieSuccess1

)else goto lowcharisma

:lowcharisma1

echo Low Charisma, Lie backfired

echo What? Are you sure where you came from is not the exit? Stop joking lad haha!

goto encounter


r/BatchScripts • • Dec 31 '20

Need Help getting current file path from context menu

1 Upvotes

As the tittle suggests, I need to make it as fool proof as possible for co-workers to execute a script. I need to do three things and so far i've been able to do two, 1. Add an option to the context menu that processes files 2. Python code that processes files 3. Pass the current working directory + file pathname from the context menu to my python code and this have proven impossible. So I'm looking for a method to add the script to the registry for right click and execute the script while also passing the absolute directory and file path. Tried the code on python, but it relatively easy so if getting absolute filepath is easy with batch, i could use it instead. Thanks for help


r/BatchScripts • • Nov 07 '20

Batch script to move a file from place to another

1 Upvotes

Hello

I am looking to create a batch script to move a file from one location to another. it needs to be a batch script to run on logon for a network.

the script will need to:

start

check to see if the file is new.xyx

IF it is old.xyz Replace with new.xyz

Else end

so it will need to ideal check the age of the file or the contents of the file. the file will be a .rtf file.

so it could also move a second file and if the second file already exists then it could end?

Thanks in advance


r/BatchScripts • • Oct 24 '20

Processes_Services_Tasks_Startup.bat

Thumbnail
pastebin.com
1 Upvotes