Jump to content

Changing System Year


Recommended Posts

Hi all,

Its my first time posting at the progarmming section here. Just wanna know though if it would be possible for a javascript or vbscript to:

- get the system year and save it to a variable

- change the system year to a couple years beyond the current

- run a routine (like a program)

- restore the original system year

What i wanna know the most though is the one i bold'ed out.

Hope you could help me with these. Thanks in advanced.

Link to comment
Share on other sites


was able to do the same via batch file...

@echo off

setlocal

:this part gets the current system date, removes excess characters and saves the results to a temporary file
date/t>temp.txt
set filename=temp.txt
set /p firstline= < "%filename%"
set IDENTIFIER=%firstline:~4,10%
echo %IDENTIFIER%>temp.txt

:this part modifies the date and runs a set of commands including running an installation
date 05/28/2019
start /wait "setup.exe /silentmode"
start /wait taskkill.exe /F /IM tsr1.exe /IM tsr2.exe

:this part restores the date to the original state and removes the temporary file
date<temp.txt
del temp.txt /f /s /q

endlocal

anyhow, im still open to other approach though, like javascript or vbscripting.

thanks in advanced.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...