r/BatchScripts • u/KSKwin123 • Aug 04 '22
Batch script to clear DNS Cache
HI,
How to clear DNS Cache (Windows 10 - 64bit) by batch file. The batch file should be self elevated to run, without UAC prompt.
Thanks
KSK
r/BatchScripts • u/KSKwin123 • Aug 04 '22
HI,
How to clear DNS Cache (Windows 10 - 64bit) by batch file. The batch file should be self elevated to run, without UAC prompt.
Thanks
KSK
r/BatchScripts • u/rawaka • Dec 18 '24
Hi all. I'll describe what I'm hoping to accomplish and with any luck someone can assist in writing something. I've only got fairly basic BAT file skills. This is for verifying integrity/accuracy of files being backed up to a NAS before clearing them off the laptop. The part I don't really know how to tackle is the comparison. If you can give me guidance on that part at least, I can probably figure out wrapping it in an appropriate function.
I want to specify a SOURCE directory "D:\local-copy\" and DESTINATION directory "R:\NAS-copy\". For any files (including recursively into sub-folders) that exist in both directories, I want to compare the contents of the files to ensure they match. Log or echo matching filenames found and whether the contents were a match or not.
If a file is in one directory but no corresponding file named in the other, perform no action on it.
I want to have two different option flags I can set to perform either or both of two different actions:
/DelSrc If two files were compared and found to be a MATCH, delete the one in the SOURCE directory and log/echo that action. By default, log only unless the option is set.
/DelDest If two files were compared and did NOT match, delete the one in the DESTINATION directory and log/echo that action. (It's an invalid backup). By default, log only unless the option is set.
r/BatchScripts • u/vahnx • Aug 12 '22
Hey all. I have a script here that I cobbled together to download and apply all Windows updates but as you can see, I have to run the code twice to get it to work, otherwise I get errors. Is there a better command for this?
@echo off
echo Installing Windows Updates (1/2)
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force}"
echo Y | powershell -command "Install-Module PSWindowsUpdate -All"
echo Y | powershell -command "Install-WindowsUpdate"
echo Y | powershell -command "Install-WindowsUpdate -AcceptAll -AutoReboot"
echo Installing Windows Updates (2/2)
powershell -command "& {Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force}"
echo Y | powershell -command "Install-Module PSWindowsUpdate -All"
echo Y | powershell -command "Install-WindowsUpdate"
echo Y | powershell -command "Install-WindowsUpdate -AcceptAll -AutoReboot"
pauser/BatchScripts • u/DangerPencil • Aug 30 '22
What the title says. Here is the URL:
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.
r/BatchScripts • u/Ambitious_Lunch_8486 • Jul 21 '22
<# : 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 • u/[deleted] • Jan 28 '22
I have the following script that simply gets a few details about the current optical drive. However, how would I add error checking for when the script is executed on a computer without an optical drive (such as a laptop) so that it could show a definable error such as: No optical drive detected?
for /f "skip=2 tokens=2,3 delims=," %%i in (
'%SystemRoot%\System32\wbem\wmic.exe logicaldisk where "drivetype=5" get Caption^,Description /format:csv'
) Do (
set "optical_drive_letter=%%i"
set "optical_drive_description=%%j"
)
for /f "tokens=2,3 delims=," %%a in (
'%SystemRoot%\System32\wbem\wmic.exe cdrom where "mediatype!=11" get name^,mediatype /format:csv'
) Do (
set "optical_drive_type=%%a"
set "optical_drive_name=%%b"
)
echo %optical_drive_letter%\ %optical_drive_description%/%optical_drive_type% (%optical_drive_name%)r/BatchScripts • u/Appropriate_Coffee54 • Feb 11 '22
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 • u/omar_ghamdi • Feb 09 '22
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 • u/[deleted] • Aug 05 '24
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 • u/TheTranscendentian • Aug 24 '24
cd %USERPROFILE%\Downloads
bitsadmin.exe /transfer "Downloading 7zip" https://www.7-zip.org/a/7z2408-x64.msi %USERPROFILE%\Downloads\7zip_installer.msi
msiexec /a "%USERPROFILE%\Downloads\7zip_installer.msi" /qb TARGETDIR=%USERPROFILE%\Downloads\7zip
bitsadmin.exe /transfer "Downloading inno unp" "https://downloads.sourceforge.net/project/innounp/innounp/innounp%200.50/innounp050.rar?ts=gAAAAABmyisfkjD-4XRvcqtLFUIdY5n0Nq7u3x0SBxcpGMX-zKrBizy4_Me5X1EMSXTj-QE6gu7454rEFCD3zjbFbgdDz3pEMw%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Finnounp%2Ffiles%2Flatest%2Fdownload" %USERPROFILE%\Downloads\innounp.rar
%USERPROFILE%\Downloads\7zip\Files\7-Zip\7z.exe x %USERPROFILE%\Downloads\innounp.rar -oinnounp
@echo off set /p "installer=Enter Path to installer exe"
%USERPROFILE%\Downloads\innounp\innounp.exe -x -dNonInstall %installer%
explorer %USERPROFILE%\Downloads\NonInstall
exit
r/BatchScripts • u/Chroniton • May 31 '19
I was wondering if someone could help me with a command, employees in our office work out of multiple sites throughout the day, sometimes after going to a different site and connecting to their wifi won't let them connect to our intranet or network drives, this is currently solved by them opening command prompt and entering the following:
netsh wlan disconnect && timeout 10 && netsh wlan connect name=
After name they have to find the SSID of the wifi and enter that then run the command, this works but is difficult for a lot of people. I was wondering if we could put this into a batch file to run the command and if there's some way to get it to detect the SSID and input it in the command automatically?
Thanks for any help
r/BatchScripts • u/ObjectiveCultural474 • May 31 '24
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 • u/Eccentric1286 • Jun 28 '24
I want a one click script to automate to run via task scheduler at a 90day custom interval.
Task scheduler lets me to it with defrag.exe in a dos window, but I want to automate the GUI so I can interrupt the task if I want to.
Also, the arguments work for defrag but not dfrgui.exe. The latter only starts the tool and does nothing.
Can this be done?
r/BatchScripts • u/AssadEesaa • Dec 31 '20
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 • u/MadhuSunke • Jan 02 '21
Hi all , How can I run some lines based on some criteria. Example : I am looking for not to run some lines if no user is logged on.
Can someone help and I am poor in batch scripting.
r/BatchScripts • u/6_leniko_9 • Feb 18 '21
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 • u/Wuzz • Mar 16 '21
Hi all,
I'm trying to write a batch script or two that would allow me to:
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.
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 • u/ScottishDuck13 • May 27 '21
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 • u/GabiBrawlPro • Jun 01 '21
Any way to do that? Thanks!
r/BatchScripts • u/onionboy88 • May 21 '21
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 • u/Khan-Bilal • Jun 10 '21
Good Morning,
I am trying to write a windows bat script that captures the output (pid only) of a process and passes it in a variable. So that i can pass the variable in to another command. Below is what i have written but i get the above error in the title.
@echo off
FOR /F %%i in (\tasklist /v /fi "imagename eq avgbrowser.exe" /fi "cputime gt 01:25:00" /FO LIST | find "PID:"`) DO (`
SET var=%%i
)
ECHO %var%Can someone please help me figure out what i did wrong?
r/BatchScripts • u/KSKwin123 • Jun 04 '21
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 • u/treatbhanu • Mar 13 '20
Hi All,
I am trying to create a script which will take below input file.
<subsession>
This is actual test which should print
</subsession>
<subsession>
This is a random Text1
</subsession>
<subsession>
This is a random Text2
</subsession>
<subsession>
This is a random Text3
</subsession>
And Should give output as below:
<subsession>
This is acutual test which shoud print
</subsession>
This means the output should contain the value from 1 iteration on <subsession> till </subsession>. and should not print the later iteration on this search String. Can anyone please help how to get this resolved.
r/BatchScripts • u/zuatrapatuarte • Jul 04 '20
Hello, I made this batch COPY -r ic_launcher.png ic_launcher_round.png
and it works inside a folder, but i have other folders named mipmap-hdpi, mipmap-mdpi, mipmap-xhdpi, mipmap-xxhdpi, mipmap-xxxhdpi
So i want to put my bat in root, and order it to work in these folders doing that command, can someone help me? I'm not an expert. thanks
