rocknrollstar Posted June 26, 2011 Report Posted June 26, 2011 Hi, In a logon script I am writing, I use the following line: for %%a in (\\server\netlogon\shortcuts.zip) do set shorcuts_timestamp=%%~taa It works in trying to get the timestamp of the shortcuts.zip folder. However, sometimes it takes a very long time e.g. 20seconds, when it is only checking the timestamp of 1 file. Any ideas if I am doing something wrong? Is it checking the whole netlogon folder or something? Thanks!
Uraken Posted June 26, 2011 Report Posted June 26, 2011 Try a different file is it the .zip it's having issues with? 1
rocknrollstar Posted June 26, 2011 Author Report Posted June 26, 2011 Try a different file is it the .zip it's having issues with? Will give that a try in the morning. Thanks.
rocknrollstar Posted June 27, 2011 Author Report Posted June 27, 2011 Doesn't seem to make a difference I'm afraid, renamed it to .zip or even .txt and still can take time. Interestingly, sometimes it is instant, sometimes it takes 20secs. This happened even when it was a .zip file. Any ideas?
Steve21 Posted June 27, 2011 Report Posted June 27, 2011 What exactly are you trying to do? Read the files "in" the zip file? or just get the date/time of the zip file? Steve 1
rocknrollstar Posted June 27, 2011 Author Report Posted June 27, 2011 Just get the time stamp of the zip file, and stick it into a dos variable!
Steve21 Posted June 27, 2011 Report Posted June 27, 2011 Just get the time stamp of the zip file, and stick it into a dos variable! Shouldn't it be a single "a" then? for %%a in (myfile.zip) do set timestamp=%%~ta Steve 1
rocknrollstar Posted June 27, 2011 Author Report Posted June 27, 2011 Thanks, but a single 'a' doesn't make a difference unfortunately.
rocknrollstar Posted June 27, 2011 Author Report Posted June 27, 2011 Does anyone know of a different way to check if 2 files are the same in dos?
Arthur Posted June 28, 2011 Report Posted June 28, 2011 Are you checking the date and/or time because you only want to copy/extract the zip file when it has been updated? Does anyone know of a different way to check if 2 files are the same? http://www.dostips.com/DtCodeCmdLib.php#Function.CmpFTime? 1
rocknrollstar Posted June 29, 2011 Author Report Posted June 29, 2011 Are you checking the date and/or time because you only want to copy/extract the zip file when it has been updated? DOS Batch - Functions? Pretty much. Thanks for the link- very interesting and helpful.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now