|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Batch File Dates
Hello again
As you can see form my last post, I'm really stuck when it comes to DOS commands (absolute novice). I need to create a batch file whose purpose is to: Create a mapped drive - done this OK. Check to see if mapped drive exists - need help with this one, who do I get some sort of boolean return to see if drive exists? Check to see if a flag file exists on mapped drive OR check the date on a file is less than x days old - having really troubles with this one, how do I capture the number of days in a variable? Backup/Copy the mail '.pst' file to mapped drive - done this OK. Check if file exists on remote drive. - think this one will be ok with if(exists(filename)) If anyone can help or point me in some sort of direction toward success, I will be eternally grateful. Cheers ![]()
__________________
Take it easy - but take it! |
|
#2
|
||||
|
||||
|
Personally i don't think DOS batch files would be able to accomplish all of this. I have had to do similar things and I wrote a PHP script which I then ran using the PHP interpreter. This was an easy way to solve my problem. DOS batch files were designed just to run a batch of commands... checking files and that sort of thing was not really their purpose. You might be able to get programs that give it that functionality, but i dont like the chances.
|
|
#3
|
||||
|
||||
|
Thanks for your help Andreas. I guess it is very limited as to what commands etc you can use in a batch file. I'm now thinking of either:
installing a PHP intepreter and using a PHP script OR installing bash utils (for windows) thingy and using a bash script I guess installing the bash tools would take up less space and time etc What do you think/suggest? |
|
#4
|
||||
|
||||
|
If its only going to be used for that then i would get the bash utils. I had installed PHP on the system I was using already so that was why it was the most logical thing to use, but it does have quite a large size and would be a serious underuse of its power doing something like that.
With bash scripts & utils you have access to that sort of information that you need so it should work well. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Windows Help > Batch File Dates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|