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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on vbs file 1

Status
Not open for further replies.

EdRev

Programmer
Aug 29, 2000
510
US
Can I include a txt file into a vbs file (just like <!--#include file= &quot;sometext.txt&quot;--> in an asp file)?
 
what you are showing above is a (SSI) Server Side Include which isnt strictly speaking to do with asp. SSI's are more to do with CGI i think.
It used to be that to get ssi parsed u had to call your file .shtml

iirc you cant use ssi to include .asp coded pages cos ssi is executed after asp.

are you asking about including txt files in wsh scripts?
===============
Security Forums
 
Yes. I need to include a file in a wsh script.
 
I will be including a .txt file. Though I wouldn't mind it if you can provide me with samples of both, just in case.
 
u cant include a .txt file ina wsh script.
it just doesnt work like that. wsh is pure code. there's no place for the contents of .txt files.

if you want to process a text file that a different matter. You need to use filesystem object to open the file and then you can read the contents into a string or something. there many different ways.

perhaps if you can explain what this text file is, what it contains we can see how to proceed.

hth ===============
Security Forums
 
I have a script that will be scheduled to run everyday for three days on the two last days of the month and the first day of the next month. The processing will depend on the
the day (i.e. day = -2, day = -1, day = 0), and my script will go out and increment this variable after execution.
I want this script to run in batch so that I do not have to manually set the value of day (I might run the risk of forgetting to).
 
ok. vbscript has quite a lot of date functions in. I'm sure it's possible to write some algorithm that can determine whether its the appropriate day to run or not. then you can just schedule your vbs file to run every day.

i'll think about it later... ===============
Security Forums
 
i need clarification:

the script has to run on the last 2 days of the month and the first day of the next month, and this happens every month?

what about...

xtoday = date
newdate = dateadd(2,d,xtoday)
if (month(newdate) > month(xtoday)) or (day(xtoday) = 1) then
do stuff
end if

===============
Security Forums
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top