running this script in cmd will only go to the next line, and if I debugged it in Pycharm it always say exit code 0

I made this script for me to convert images to PDF in multiple folders for archiving, yesterday it runs fine doing 245 folders to convert and now today if I try to execute the script in cmd it always go to the next line import os from PIL import Image def convert_images_to_pdf(folder_path, output_pdf): image_files =… Read More running this script in cmd will only go to the next line, and if I debugged it in Pycharm it always say exit code 0

Getting and setting variables with .bat/cmd

How can i get the first output of the command where python and include all in the run.bat file ? where python output: C:\Users\Vermelhao>where python C:\Program Files\Python\310\python.exe C:\Users\Vermelhao\AppData\Local\Microsoft\WindowsApps\python.exe Desired value "C:\Program Files\Python\310\python.exe" run.bat pip install -r requirements.txt "C:\Program Files\Python\310\python.exe" "./main.py" pause I want to assemble the run.bat file in a way that the python.exe path… Read More Getting and setting variables with .bat/cmd

Why my .bat script doesn't delete the files when the total count reaches 8 in the folder?

setlocal EnableDelayedExpansion pushd C:\backups set top=7 set filespec=*.bak set counter=0 for /f "delims=" %%f in (‘dir /b %filespec%’) do ( set /a counter+=1 if !counter! GTR %top% del /q "%%f" ) I have .bak files, if the number of backup files gets more than 7 i.e. 8 then delete the oldest one. for example 1.… Read More Why my .bat script doesn't delete the files when the total count reaches 8 in the folder?

Static page website not updating after a massive update, 13 hours passed

I pushed a massive update with 3d models three.js and everything to a simple static website but 13 hours have passed and its still not updated, in the github repository there are two branches master and main main consists of the older website master consists of the new website I switched the default branch from… Read More Static page website not updating after a massive update, 13 hours passed

How to use a PowerShell function return as a variable in a batch file

I was trying to use the return from myPowershellScript.ps1 to use as a variable in my batch file. myPowershellScript.ps1 function GetLatestText { return "Hello World" } I was trying to use the For /F function. There may be a better way. myBatch.bat for /f "delims=" %%a in (‘ powershell -command "\\Rossi2\Shared\myPowershellScript.ps1" ‘) do set "var=%%a"… Read More How to use a PowerShell function return as a variable in a batch file

CMD/BATCH BAT SCRIPT How to add digit to file without space

i want to make a start.config file by using bat script. I want to add to my config file that parameter: StartAgents=9 WITHOUT space at the end of line. Unfortunately command: echo StartAgents=9>>C:\start.config not working, I think that there is "collision" with two characters: "9>" Command: echo StartAgents=9 >>C:\start.config is working, but this is adding… Read More CMD/BATCH BAT SCRIPT How to add digit to file without space