Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS command question

Status
Not open for further replies.

ashley75

Technical User
Oct 4, 2002
94
US
In DOS, how do you write a statement like this into DOS coding "if date= current date then copy whatever"

another word, I am looking for something like this

c:\if date =???? (where ??? is current date)

thanks,
 
Sounds like you are trying to do some scripting? Tell us your over all goal, and then maybe we could help you find a path to achieve it.
 
VBScript is the way to go.
Code:
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Enclose date in # signs to ensure it is treated as a date.
strDate = #04/17/07#

'Compare date to vairable and copy file as needed
If strDate = Date Then
	objFSO.CopyFile(sourcepath, destinationpath, True)
End If

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top