1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: How to write a script to change date and time before starting a program

Discussion in 'All Other Software' started by rajaspoorna, Mar 14, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. rajaspoorna

    rajaspoorna Thread Starter

    Joined:
    Aug 19, 2009
    Messages:
    38
    Hi guys,
    I'm a total newb to scripting, so I wanted to know if it is possible to write a .bat file that does the following:
    __________________________________________________________________________________________
    Change system time to 3 o'clock
    Change system date to 11 March 2011
    Run program at J:\Softwares\Folder Z\Z.exe
    __________________________________________________________________________________________
    So, can you please help?
    Thanks in advance,
    Rajas
     
  2. Techtatane

    Techtatane

    Joined:
    Feb 20, 2011
    Messages:
    67
    Create a launch.bat file
    edit launch.bat
    @echo off
    time 15:00
    date 11/03/2011
    J:\Softwares\Folder Z\Z.exe






    execute launch.bat as administrator
    note that date format in this case is dd/mm/yy
     
  3. rajaspoorna

    rajaspoorna Thread Starter

    Joined:
    Aug 19, 2009
    Messages:
    38
    Thanks a lot!
    But i forgot, is it possible to change the date and time to the real time after use?
    I don't think it would. I think i might have to edit the program's exit code, and I don't know where that would be.
     
  4. Techtatane

    Techtatane

    Joined:
    Feb 20, 2011
    Messages:
    67
    You can try to synchronize with a time server :


    create a time.bat file and put this inside :


    @echo off
    w32tm /config /sychfromflags:manual /manualpeerlist:time.nist.gov
    net stop w32time && net start w32time
    w32tm /config /update
    w32tm /resync /force


    I tested this on win7 works fine.
    But why do you need to change the execution time of your prog ?
    What is the real deal about all this ?
     
  5. rajaspoorna

    rajaspoorna Thread Starter

    Joined:
    Aug 19, 2009
    Messages:
    38
    Thanks a lot buddy!
    And to answer your question, I had bought a software called "Lipikaar", after trying the trial version, but the full version just doesn't work! It crashes as soon as the installation opens. I tried customer support, but they, for some reason say they don't know what is wrong. So i decided to use the trial version. I paid for it - if they can't get it to work, they can't give me a refund?
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/985824

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice