Automatic take Screenshot in every 10 min - screenshot

There is some processes running on my pc,I want to take automatically screenshot of my desktop in every 10 min. Is any way to do this?

This can be done without external tools but you'll need .net frame work (installed by default from vista and above) and screenCapture.bat
#echo off
setlocal
set counter=1
:repeat
ping localhost -n 1 -w 600000
call screenCapture screen%counter%.jpg jpg
set /a counter=counter+1
goto :repeat

follow the steps
Download Nircmd.exe and paste into c:/Windows/System32
Then make a bat file and paste the below script
# echo off
Nircmd.exe savescreenshot "C:\Users\Kishore\Desktop\Screenshot.jpg"
using window schedular, you can schedule this bat file in every 10 min. In every 10 min you will get the screenshot saved in your given location folder.

Related

How to open program from command line in the background (below windows already opened)?

I have small python script that opens few dozens of instances of xterm and closes most of them after few seconds.
Using command like this:
for i in range (80)
os.system("xterm -e echo example &")
allow xterm to be opened 80 times but windows are popping in front of the work space - so using any other program is impossible for minute or so.
Is there any way of opening those windows in the background?

Script to delete all photoshop temp files older than 2 days

I have this commen issue with photoshop. Where it doesn't delete the temp files it creates after a shutdown of program.
I have used alot of time to find a script that would delete all files with starting name of Photoshop* in the temp, which is older than 2 days. So i dont delete files, if i get a unexpected shutdown or crash.
I tried this, after a few hours of search - but it doenst work
ForFiles /p "C:\Users\user\AppData\Local\Temp\Photo*" /s /d -2 /c "cmd /c del #file"
This works, perfectly but it deletes all files without taking into consideration how old the files are.
C:\
del "C:\Users\user\AppData\Local\Temp\Photoshop*."
How can i get the above script, which runs on every startup with system rights.
To only delete all files starting with photoshop* and are older than 2 days :)
I need this script to work on Windows10 and Windows7
Every input is appreciated.

How to change windows theme (or at least the background) using the command line or scripts

I am trying to make it so that the theme (or at least the background) changes when I switch desktop view. I have found some answers but most if not all are about old versions of windows and do not work for windows 10. The scripting tool I am using is AHK. Thank you in advance.
Its possible to change the background using this command:
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d wallpaper_path /f
Changing the theme is not that direct, you might want to run the following command. What it does is that it will show you a dialog where you can pick the theme you want. (It may also reset your theme to default)
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,#Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\aero.theme"
It's although possible to change the theme using this command:
call <path-to-your-theme>
You close the opened window using this command:
taskkill /IM ApplicationFrameHost.exe
I came across this question while looking to do the same thing for my company's computer image. The command below worked well for me, keep in mind that the taskkill part would kill all settings windows
C:\PATH\TO\THEME\FILE.theme & timeout /t 03 /nobreak > NUL & taskkill /f /im systemsettings.exe
This will launch the theme file which will apply the theme but also open the Setting app/window, but then it will wait for the timeout (set to 3 seconds in the command above) then kill the Settings app/window. Tested on Windows 10 Enterprise x64 v1909. Also depending on the performance of the computers you might be able to lower the timeout from 3 seconds.
Martin's answer didnt work for me, but after some reading it believe its because of changes made with either v1809 or v1903

applescript utility problems/bash/ process detection

I made a small automator app to help me launch and end apache ( another for mysql), so that I don't have to go to the terminal and do it ( yes I'm that lazy).
now here is the applescript I use for it:
on run {input, parameters}
set apache2state to (do shell script "/bin/ps -arx |/usr/bin/grep apache2 |wc -l")
repeat until apache2state does not start with " "
set apache2state to text 2 thru -1 of apache2state
end repeat
if apache2state is equal to "3" then
do shell script "/opt/local/bin/port load apache2" with administrator privileges
else
do shell script "/opt/local/bin/port unload apache2" with administrator privileges
end if
end run
Now this works, except for the fact that I'm actually comparing to integer values that are relative to the number of processes that apache is running.. so it's not really reliable.
Is there a better way to test if apache (and mysql, I have another script just the same) is running. Problem is that when they are shut off the shell command will return an integer value just the same ( and not just a 1 for the grep process..)
thanks
EDITED to specify thatthe solution up here worked badly because the grep would return any instance of the apache threads and any other process that said apache ( like tail -r /var/log/apache2/error.log for instance).
The running state of a service can be tested with the following command:
/sbin/service --test-if-configured-on "org.apache.httpd"
This however might not work for services installed with MacPorts.
Also see the answer to the this question.
Since the command service is deprecated under Snow Leopard, you can alternatively use launchctl to obtain the running state of a service. The command can be invoked from AppleScript in the following way:
try
do shell script "/bin/launchctl list | grep -q org.apache.httpd" with administrator privileges
set apache2Running to true
on error
set apache2Running to false
end try

NTBackup problems on shutdown

I'm trying to lunch ntbackup on shutdown but the backup file (.bkf) is only 1.1 GB instead of 2.2 GB. When i try to restore using this file ntbackup tells me that it is corrupted. If i run the same command as bat file it works (the command is: ntbackup backup C:\ systemstate /m normal /f "X:\Backup_20-12-2010.bkf" /j "Bckp_Data-and-System" /L:s ). The log file tells me that everything is ok. What can i do?
The solution is to set in gpedit.msc at Computer Configuration\Administrative Templates\System\Scripts the key Maximum wait time for Group Policy scripts to 0. The default time is 600 seconds (10 minutes).