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

VBSCRIPT + INCLUDE FILE + ASYNCHRONOUSLY

Status
Not open for further replies.

SHILOH123

Programmer
Sep 16, 2007
3
GB
Hello

I am in need of some assistance and help on this please.
I have been required to write a vbscript to run asynchronously(I take it that means to run in the background). I am not fluently familiar with the language.

As in the original ASP, we have includes files, most of the includes file are ASP.

How is it done in VBScript to include an asp file?? An example would be appreciated.

If so, how do you map the file path as most of the include files usually have this : - ../test/test.asp

As it has to run asynchronously, how is it possible to finish the running of the script when it has inserted all the data into the database?? An example would be appreciated.

How do you make the VBScript to run in the background silent and only overnight??

On ASP, how is it possible to call the vbscript and pass parameters in for example an ID, or a number into it.

It would be an immense help if anyone could show me how this is done and I would be grateful as well.

Thanks
Newbie
 
Shiloh123 what are you actually trying to do? Your questions are all over the map and hard to follow.

VBScript can't include an ASP page. An ASP page can include VBScript code.

You can pass parameters to a script using arguments. Use scheduled tasks to have a script run automatically at night, though that need seems to contradict the need to pass parameters to the script. If the parameters will always be the same then put them in the script.

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.
 
Hi

I need to create a vbscript that has to run asynchronously in the background overnight. The vbscript has to insert data (large volume ) to the database.

I realised that VBScript can't include an ASP page, so I have converted most of the include files into vbs and use ExecuteGlobal to include them in.

Then on the Classic ASP, I have button that should call the VBScript file, passing the ID, UserID, as they are dynamic. So I am not sure how to pass parameters to a script using arguments. How is this done?

I have created this code in ASP, although I keep getting permission denied. I have ISUSER and IWAM do have full control. In IIS, the executable permission is set to "scripts only".

Dim WshShell,intReturn
Set WshShell = Server.CreateObject("WScript.Shell")
a= "c:\inetpub\a = a & " " & ID & " " & UBound(aryUsers,2)
intReturn = WshShell.Run("%comspec% /c cscript " & a, 0, True)
Response.Write(intReturn)
Set WshShell = Nothing

As it has to run asynchronously, how is it possible to run the script asynchronously?? An example would be appreciated.

It would be an immense help if anyone could show me how this is done and I would be grateful as well.

Thanks
Newbie
 
[1] asynchronous version
>intReturn = WshShell.Run("%comspec% /c cscript " & a, 0, True)
>Response.Write(intReturn)
[tt]intReturn = WshShell.Run("%comspec% /c cscript " & a, 0, false)
[red]'[/red]Response.Write(intReturn) 'write it is pointless for asynchronous processing[/tt]

[2] The permission to allow is not limited to the script only, why should the m/c allow it to run apriori %comspec% /c?
 
I have ISUSER and IWAM do have full control
Really ? It's a HUGE security hole ...
 
Hi

Thank you for your information.

I agree with ISUSER and IWAM having full control does pose huge security hole. However it is only on my PC that I am just purely testing.

I have had to do another rethink, and felt calling VBScript file in classic ASP is not neccesary. I felt it would be better to run the VBScript directly. Perhaps through the scheduler list on PC that help to run the script on a daily basis.

However, how it is possible to do in an asynchronous version(silently in the background overnight) in vbscript file? Is it this done through scheduler list?
An exameple would be most helpful

Thanks Newbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top