|
-
Sep 30th, 2005, 11:02 AM
#1
Thread Starter
Lively Member
VBScript Logon script
Hi all,
I am rewriting my login scripts with VBScript, here is what I am trying to do,
I have one "control file" that everyone will get called: logon.vbs
it will have "rules"
example:
if ismember("some group") then
on error resume next
objshell.run "/subvbs/subdept.vbs"
and then, a script called "subdept.vbs (one for every dept or group)
so the logon.vbs could / will have about 50 or so of these rules, and each sub script will have rules like so:
'app name
if ismember("some group here") then
on error resume next
objNetwork.MapNetworkDrive "n:" , "\\server\share"
if err.number <> 0 then
on error goto 0
objNetwork.RemoveNetworkDrive "n:"
objNetwork.MapNetworkDrive "n:" , "\\server\share"
end if
on error goto 0
end if
and so on where printer and such will also be added, my question is this:
i would like to have a 'header" like file that when a subscript is run a process and gets all the drive mappings from, basicly i dont want to hard code 50 scripts. i want a "config file" al la vb.net config.xml file.
that way if a server or share name changes i can change it in one place.
any ideas?
-Nex6
Last edited by nex6; Sep 30th, 2005 at 11:07 AM.
-
Sep 30th, 2005, 05:32 PM
#2
Fanatic Member
Re: VBScript Logon script
Hi,
If youre using ASP with Visaul Basic Scrinting Model, you can do this one of two ways.
1. Use a Virtual SSI file at the top of your page, above you dec tags, thsi will look like this.
<!--#include virtual="//filepatchway" -->
www.ssi-developer.net
everything you ned to know. NOTE.. If you using ASP. Profusely ignore the conditional SSI. It wont work with ASP as youre not using CGI,or JSP as the base language for the page, also, as ASP uses key value pairings in querystrings, it wont fully recognise these, so youre only left with server variables, which,m is a mute point when youre workig with login scripts
therefor eif a servername\pathway changes or subject varialbe changes, then just referr to the include file, and done. Every time the page loads, it will load the file. Disadvantages. youwill ahve to code idividual files for each subscript, or have a very ling function containing conditionls, test functions or case switchers. Wont slow the application down, just will make for long coding though, but is worthwhile in the long run on a maintainance scope.
2. Use the Global.ASA file. this is similar to the config file or the .DLL files when your writing COM objects, e-commerce or intrnet applicaitons. This is a great option for what you want to do, although requires a great deal of planning and can involve great metamorphosis ot your design structure to integrate such a procedure, but does provide for more scope in secure logons, user checks and post login validation. does require a bit of planning on the developers part and, can drain memorty recourses if not planned properly, or constructed improperly.
www.powerasp.com
search under global.asa-- very good article.
Both solutions to this problem are very visable and useable, solution 1 is the easy option and the more widely used, both on a commercial and enterprise level, especially when writing CGI emulators, or dynamic web pages when not using SHTML or PHP.
solution 2 is a more business development and intranet level solutions as it covers autommated tasks, information collection and distribution of infomration and events,hanlesand exception navigation basedupon th euser input, but does requiere a great deal of development..
As you can see, I have posted good links to sites that cover these. so hoep you get what you need. If you ned mroe input, mail me.
ta
kai
As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..
A few things that make a good Developer a Great One.
Methodical and a thorough approach to research and design inevitably leads to success.
Forward thinking is the key to Flow of control.
Never test in the design environment, always test in real time, you get the REAL results.
CBSE & OOSE are the same animal, they just require different techniques, and thinking.
SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
The key to good design is explicit attention to both detail and response.
Think Freely out of the "Box" you're in..... You will soar to better heights.
Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|