Link to home
Start Free TrialLog in
Avatar of meet sidhu
meet sidhu

asked on

vbscript code to take snapshot of current screen and save into a folder.

i need a vbscript code to take snapshot of current screen in every 2 minutes and save that snapshot into a folder.
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

From a previous solution
https://www.experts-exchange.com/questions/26944159/VBSCRIPT-that-captures-a-screenshot-and-saves-to-a-jpeg.html

@echo off
REM NirCmd.exe is assumed to be in same folder as this batch file.

set CurrDir=%~dp0
set CurrDir=%CurrDir:~0,-1%

if exist "%CurrDir%\Desktop.scf" del "%CurrDir%\Desktop.scf" > nul

echo [Shell]>"%CurrDir%\Desktop.scf"
echo Command=2 >>"%CurrDir%\Desktop.scf"
REM echo IconFile=explorer.exe,3 >>"%CurrDir%\Desktop.scf"
echo [Taskbar]>>"%CurrDir%\Desktop.scf"
echo Command=ToggleDesktop>>"%CurrDir%\Desktop.scf"

"%CurrDir%\Desktop.scf"

"%CurrDir%\nircmd.exe" cmdwait 4000 savescreenshot "%CurrDir%\ScreenShot.jpg"

"%CurrDir%\Desktop.scf"

if exist "%CurrDir%\Desktop.scf" del "%CurrDir%\Desktop.scf" > nul

Open in new window

Avatar of meet sidhu
meet sidhu

ASKER

i need vbscript coding.
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just so you know, there is no capability in just VBS script to do this, any VBS solution will be dependent on using other programs or utilities on the system - I've been down this path before...

This can be done in Powershell though, if that was an option?

~bp
thank you