Page 1 of 1

Prompt User for Input

Posted: 29 Oct 2015 11:32
by carmine
Hello,

I need a batch file which accepts user input for file name once the file name is provided by the user it will verify with system date/time and file creation date/time and flash on screen the difference between them and prompt the user to proceed with it or not, if yes then call 2nd batch file else NO then exit.

Default folder D:/Usage/

Thanks.

Re: Prompt User for Input

Posted: 29 Oct 2015 12:06
by Squashman
You can use the SET command with the /P option to get user input.

You can get the SYSTEM date and time by using the %DATE% & %TIME% variables.

To get the creation date and time of a file you will need to use the DIR command with the /TC option.

You can then manipulate those date and time stamps into the same format and then use Dave's GetTimeStamp.bat file to get the difference in time.
viewtopic.php?p=38387