SunQuest
           Windows Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsWindows Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old October 16th, 2002, 03:30 AM
robot1's Avatar
robot1 robot1 is offline
In the midst of insanity
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 171 robot1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 36 m 3 sec
Reputation Power: 8
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!

Reply With Quote
  #2  
Old October 16th, 2002, 03:54 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
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.

Reply With Quote
  #3  
Old October 16th, 2002, 04:08 AM
robot1's Avatar
robot1 robot1 is offline
In the midst of insanity
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: UK
Posts: 171 robot1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 36 m 3 sec
Reputation Power: 8
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?

Reply With Quote
  #4  
Old October 16th, 2002, 09:16 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 8 m 45 sec
Reputation Power: 27
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsWindows Help > Batch File Dates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway