Prompt User for Input

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
carmine
Posts: 15
Joined: 18 Nov 2013 13:12

Prompt User for Input

#1 Post by carmine » 29 Oct 2015 11:32

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.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Prompt User for Input

#2 Post by Squashman » 29 Oct 2015 12:06

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

Post Reply