Afaik it can't, but for this task I would use one of this programs:
Tiny Task(it records and plays keystrokes) or maybe AutoHotKey (you have to write ahk scripts, but there are zillion examples)
Although I can appreciate the amount of time spent on making something like this, it will just be very frustrating for any individual with prior experience with unix... as none of the commands actually work like they're supposed to :)
Might as well just install the real thing, don't you think? https://cygwin.com/install.html
This. I'd go straight to Linux tools like curl and grep for web scraping. Cmd never had any good built-in tools for that.
As for OP's other question, to find more tools I recommend chocolatey.org, it's like apt-get for Windows. Plus, you can always just click on the "Packages" link and browse it on the website.
choco search terminal
choco info microsoft-windows-terminal
choco install microsoft-windows-terminal -y
Updating software:
choco upgrade microsoft-windows-terminal -y
cup microsoft-windows-terminal -y
cup all -y
Given how locked-down school computers tend to be (with good reason); you could always check with your teacher if playing videos of the game in the background of your presentation would be possible.
OBS is pretty straightforward to record, so if that's an option I'd do that. You will need to transcode your output from ".mkv" to ".mp4" or a similar format to ensure it'll run on just about any computer. OBS has this functionality built-in "File > Remux Recordings", though I'd also recommend taking a look at Handbrake for transcoding, depending on whether or not resolution/framerate/etc is of concern.
Alternatively, you can always talk to your school's IT Team, to see if they can allow you to run your script for said presentation -- they'll likely want to look over it, should they be willing to help your cause, anyway.
This works. But it was a little much, as it also rearranged some open programs and was simply too jarring.
I ended up using nircmd and
nircmd.exe win close class "CabinetWClass"
But thank you for the suggestion.
Several pages suggest doing a ping in milliseconds to cause the program to pause for that length. Example:
Another:
http://stackoverflow.com/questions/735285/how-to-wait-in-a-batch-script/735294#735294
Oh I see now. You're going to need to assign it a drive letter to access from cmd or a batch file. I think this thread will help.
Seems very interesting! I love these evolution-type simulation games - kind of like Spore (2008), if you've ever played it.
I'm actually also making a game using BATCH, it's a simulation of the life of the homeless. You have to survive treatment, earn money by stealing or begging, improve your reputation, and make sure to keep yourself happy and fed until the game ends. I thought my project was going to be ambitious, but yours looks amazing so far.
When you finish with it, I would really like to check it out. Maybe put it on itch.io or some other website where people could download and play it.
Good luck!
l also wanna add that l fixed the issue with that " '■@' is not recognized as an internal or external command" when executing a batch. Turns out l was saving batch scripts in notepad with the unicode text format and cmd refused to read anything that's in unicode. ( Source: https://stackoverflow.com/questions/22418553/cmd-m-is-not-recognized-as-an-internal-or-external-command )
Sometimes there's a bug within Notepad++/Windows where if you copy and paste text into Notepad++, it will add an "invisible character" to certain symbols. On mine it sometimes happens to "
and @
The way I notice is that when I press backspace
infront of the "
once, nothing visually will happen (it deletes the invisible character) then I'll press backspace
again and the "
will remove.
But yes stick to ANSI and possibly switch to something like VS Code this might help in future
Nice! I always liked dungeon/cave adventure games, they're always really fun.
My game is basically a 'Homeless Simulator', where you start off with nothing and work your way to the top by begging on the streets, working jobs, and talking to people. The game comes with a character creation thing too, so you can customise your personality and your looks. Your personality affects how people treat you and how much money you get by begging.
There's also a time system, and so you have to race against the clock every day and try to earn as much cash as possible. You have to manage your Hunger, Thirst and Happiness by buying items from different stores or having fun around the city. I might put it on itch.io or GameJolt when I finish it.
Anyways, have a nice day. :)
This works:
@ echo off
color 0a
title ping test
:ping
set /p adress=what website would you like to ping?(ex:
<code>google.com</code>,
<code>minecraft.net</code>)
ping.exe %adress%
pause
exit
You were so nearly there, sometimes it's hard to see the problem and fresh eyes help.
No. Batch file can't do that kind of string comparison. You'll need a third party tool. I believe those *nix tools should have at least one. Start by searching for it in:
https://www.debian.org/distrib/packages
When you found some, find the Windows port of the tools if any.
Ha sure, I'll do just do 2 of them so everyone can try :) (assuming you're running these with admin privileges)
"Disable Cortana"
@ECHO OFF REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /V "AllowCortana" /T REG_DWORD /D "0" /F PAUSE EXIT /B
"Shortcut to https://speedtest.net on desktop"
@ECHO OFF ( ECHO [InternetShortcut] ECHO URL=https://www.speedtest.net/ ECHO IconFile=C:\icons\favicon.ico ECHO IconIndex=0 ) > "%userprofile%\desktop\SpeedTest.url" PAUSE EXIT /B
By the way, some of these are quite unwieldy with only Batch. A little embedded Powershell can make things easier.
Thanks for answer, I have tasted but sitll doesn't work. List I'm passing into this script while calling in python looks like this (same as previously, just for reminder):
'sysinternals', 'ruby'
Output I'm getting from .bat script:
Failures
- ' - ' not installed. The package was not found with the source(s) listed.
Source(s): 'https://chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify --pre
,
the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
assistance.
any ideas how to fix this?
I've just tried the following code and it prints "success" on my machine.
@echo off set "host=google.com" ping -n 1 "%host%" | findstr /r /c:"[0-9] *ms">nul 2>&1 if %errorlevel% == 0 ( echo success ) pause
Result: https://snipboard.io/nVZt8W.jpg
Are you sure your machine is able to ping out?
You can just use FOR /F to check the first bit. Ie if you're checking for Wed 04
@ECHO OFF FOR /F "tokens=1 delims=/" %%A in ("%DATE%") DO ( IF "%%A" == "Wed 04" ( START "" FIREFOX "https://mail.google.com https://lifehacker.com/" ) ) PAUSE EXIT /B
so what is it you really want to do? Do you want to start it on a Saturday, or do you want to start it on March 1st?
If you just want to start a program on a specific date, you're much better off simply using Task Scheduler. There's no reason to over-complicate things by having some kind of bat script being executed all the time just to poll for a specific date.
Depending on your locale settings on your computer, you need to figure out what order day, month, and year are in the %DATE% variable. Check this by opening a cmd
shell, and typing ECHO %DATE%
Then you use this command to check for a specific date...
IF "%DATE%"=="01.03.2020" ( START "" firefox https://mail.google.com https://lifehacker.com/ )
Alright, it's an easy one. The choice command was made for this type of task.
Make your task scheduler starts a file called whatever.cmd that contains the following:
@echo off :loop choice /c yn /d y /t 30 /m "Abort system hibernation?" if errorlevel 2 ( ping localhost -n 1800 >nul goto loop ) shutdown /h
With this, you have 30 seconds to answer yes and snooze it. It will ask again every 30 minutes. If you don't answer, it will force your computer into hibernation.
The only problem is that if won't pop up again if you minimized it the first time. NirCmd (download the exe and put it in the same folder) would provide an easy fix for that with:
@echo off title Hibernation Prompt :loop nircmd win activate ititle "Hibernation Prompt" choice /c yn /d y /t 30 /m "Abort system hibernation?" if errorlevel 2 ( nircmd win hide ititle "Hibernation Prompt" ping localhost -n 1800 >nul goto loop ) shutdown /h
Ghetto solution, with NirCmd:
nircmd win activate process program.exe nircmd sendkeypress a
So the first line brings up the window of your program. You can also use:
nircmd win activate title "title of that window"
The second line simply presses "a" to skip the pause.
The new windows 10 powertoys has a tool called FancyZones. You could try calling it from a batch file, not 100% sure if it will work that way though.
https://github.com/microsoft/PowerToys/tree/master/src/modules/fancyzones
So - this is the code that seems to be in question (since, basically, everything else is preceded by "echo"
set /p choice=">"
​
if %choice%==1 cd \LHCBask & call hello.exe & goto start
if %choice%==2 cd \LHBase & call hello.exe & goto start
if %choice%==3 cd \LHFoot & call hello.exe & goto start
if %choice%==4 cd \LHBask & call hello.exe & goto start
if %choice%==5 cd \LHHock & call hello.exe & goto start
if %choice%==6 cd \TKOBOX & call hello.exe & goto start
if %choice%==7 cd \DMB7 & call baseball.exe & goto start
if %choice%==8 cd \LHCBask & call hello.exe & goto start
if %choice%==9 cd \LHBase & call hello.exe & goto start
if %choice%==10 cd \LHFoot & call hello.exe & goto start
if %choice%==11 cd \LHBask & call hello.exe & goto start
if %choice%==12 cd \LHHock & call hello.exe & goto start
if %choice%==13 cd \TKOBOX & call hello.exe & goto start
if %choice%==14 cd \DMB7 & call baseball.exe & goto start
if %choice%==15 cls & goto none
if %choice%==16 exit
​
​
I end my code with that. When DosBox starts up, I do see all the echo stuff appear; but then, there are 16 straight lines of "The syntax of the command is incorrect" and then a simple command prompt appears (with a cursor); but entering anything doesn't activate.
​
I did find this link on the DosBox wiki -- would this mean everything we're trying to do won't actually work? (i.e., would I need to use the first option on this page?)
​
https://www.dosbox.com/wiki/Shortcuts_that_You_Run_in_DOSBox
​
Here's a question -- is this not possible in DosBox?
​
I found this link (which may make more sense to some of you than to me):
​
https://www.dosbox.com/wiki/Shortcuts_that_You_Run_in_DOSBox
I know this is completely unrelated but, I came across this open source application called bleachbit. It worked like a charm and I noticed a considerable difference after using this (could be just me). Worth a try if you ask me.
You would need a third-party command line tool for that. Apparently ImageMagick can convert TIFF files, although I haven't tried it myself.
lol I feel like I wasted your time, you can try downloading Taiga and Syncplay and experiment yourself if you want.
Taiga is an extension of MyAnimeList and logs the anime that you watch automatically, while Syncplay is a video sync program that syncs videos in a server so friends can watch anime together. A bit weebish, but I'm trying to make my life easier in the long run.
Thank you for everything!
Hmm you might want to take a look at Text Inspection and Manipulation Utility ( freeware, see http://www.donationcoder.com/forum/index.php?topic=36544.0 ), it can be called from command line and may be able to do what you need.
Am not 100% sure about that yet, but if I get bored at my workplace tomorrow, I might look into it ;)
There's no reason to complicate things by having to use a bat script for this when there are free diagnostic tools that will give you all the information you need (and more).
https://www.pingplotter.com/products/free.html
Set it up to run at windows start by putting a shortcut to PingPlotter in your shell:startup
folder.
Open up properties of the PingPlotter shortcut, and add /TRACE:1.1.1.1
to the end of the Target i.e.
"C:\Program Files (x86)\PingPlotter\PingPlotter.exe" /TRACE:1.1.1.1
There's also this thing called aria2. Low profile(never saw mine climb over 8MB ram and the website says max is 9MB). It handles torrents too. I personally prefer this as it has a text file argument and said text file can have several links with names, directories (if you want to sort them) and referer. I picked this as its a lot easier to just generate a text file, grab them from the downloads folder and queue them up in a single bat file.
This WinSCP help page and this stackoverflow thread have examples of timestamps/dates and formatting them, if that's the issue. Some of the commands for getting specific times (Since you are looking at hours/minutes) use WMIC- if Powershell is disabled on your system, there's a chance WMIC may be too. If the issue is that the system is just too old for Powershell, WMIC should be fine.
i use a small software called antrenamer , here
http://www.antp.be/software/renamer
​
free, portable, edit file names in lots, many functions.
i use it for many years . i just saw in the site that its open source too
> I really need to learn an actually useful language that's from this century...
You should check out AutoIt. It comes with the SCITE editor, which uses syntax highlighting, and is preconfigured for Autoit (i.e. if you press F1 it will open the documentation for the command where your cursor is placed). It's free, is easy to learn like all BASIC-type languages, and lets you do all kinds of advanced stuff in Windows without really having to know in-depth understanding of the mechanics of your operating system. And you can easily compile a standalone exe file so you don't need to have AutoIt installed on the computer you want to run your program on.
Want to save a file? Hey, there's a function for that.
Want to move a program's window? There's a function for that!
Want to create your own window with some buttons in it that do cool stuff when you click them? yea, there are functions for this as well (a little more advanced, though)
The AutoIt forum is full of friendly people, and it's also full of practical code examples. The same with the documentation; it's extremely well written, and with practical examples on all commands/functions, making it easy to get started.
https://www.amazon.com/Batchography-Art-Batch-Files-Programming/dp/0692681310 is decent, stupid title notwithstanding.
There are also some resources in the sidebar that you should check out: ss64 and the Discord server are excellent, and the youtube tutorial is about as close to good as you're going to get.
Android is Linux-based, so you will not be able to run batch commands on it. However, you can start an SSH server on your windows computer, and then connect to it with your android phone for a similar experience.
For the windows ssh server I recommend freesshd. It is simple and secure.
As for the android ssh client, I use termius
Good luck setting things up!