#52457 - 2000-11-30 07:42 PM
USE command doesn't work when using 2 variables
|
Anonymous
Anonymous
Unregistered
|
Hello Guys, I need help. I'm trying to map a drive using the USE command. The device and resource are variables. Trying to use the USE command in this way results in a INVALID DRIVE SPECIFICATION message. This works fine on NT, this does NOT work on Windows 98. Kixtart Ver: 3.61 on NT 4.0 box SP4 Here's the snippet: GLOBAL $D, $S $D = "Q" $S = "\\BOBSERVER" ? "* Connecting to resource" ? ? "The DRIVE is: $D" ? USE $D: "$S\SCAN" I've spent much time on this. I give up. Thanks, - Bob Archer
|
|
Top
|
|
|
|
#52463 - 2000-11-30 09:37 PM
Re: USE command doesn't work when using 2 variables
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Working on more of the code for operateion "Bad Logic" :) I am at the drive mapping part. I am pulling all information from a INI type database. So I would have variables for the USE command also.... here is the drive mapping code. code:
$script = @curdir + "kixwin.kix" Goto Logon_script ;do not remove these 2 lines! ;----------------------------------------------------------------------------[drives] status = on ;set the TDNUm to equal the total number of drive mappings TDnum = 3 ;The drive mapping entires should eb in this format. ;OS type (All,9X,NT) | (G,L)Group G=global L=local | UNC for resource | Drive ;mapping1 = all|GDoamin Admins|\\server1\admins|w: mapping1 = all|GDomain users|\\server\@userid$$|i: mapping2 = 9x|GDomain users|\\server\share|j: mapping3 = nt|L\\@wksta\administrators|\\server\share$$|k: ---------------------------------------------------------------------------- Do not edit below this line. ---------------------------------------------------------------------------- :Logon_script cls gosub Load_Variables
if readprofilestring($script,"Drives","status") = on Gosub Drives endif exit ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- :Load_Variables ;This is where all Global variables are set $cr = chr(13)+chr(10) $lf = chr(10)
$notice = "" $welcome = "" $DNum = 1 $code = "" return ;---------------------------------------------------------------------------- :Drives $TDNum = val(readprofilestring($script,"drives","TDnum")) do $rawdata = readprofilestring($script,"Drives","mapping$dnum") $OSMap = substr($rawdata,1,instr($rawdata,"|")-1) $rawdata = substr($rawdata,instr($rawdata,"|")+1,len($rawdata)) $GlobalLocal = substr($rawdata,1,1) $Group = substr($rawdata,2,instr($rawdata,"|")-2) $rawdata = substr($rawdata,instr($rawdata,"|")+1,len($rawdata)) $UNC = substr($rawdata,1,instr($rawdata,"|")-1) $drive = substr($rawdata,instr($rawdata,"|")+1,len($rawdata)) select case @inwin = 1 and $osmap = "nt" select case ingroup($group) = 2 $localGlobal = "L" $code = 'use $drive "$unc"' case ingroup($group) = 1 $localGlobal = "g" $code = 'use $drive "$unc"' case 1 ? "can't find $group" endselect case @inwin = 2 and $osmap = "9x" select case ingroup($group) = 2 $localGlobal = "L" $code = 'use $drive "$unc"' case ingroup($group) = 1 $localGlobal = "g" $code = 'use $drive "$unc"' case 1 ? "can't find $group" endselect case $osmap = "all" select case ingroup($group) = 2 $localGlobal = "L" $code = 'use $drive "$unc"' case ingroup($group) = 1 $localGlobal = "g" $code = 'use $drive "$unc"' case 1 ? "can't find $group" endselect endselect if $code <> "" $nul = execute($code) endif $code = "" $dnum = $dnum + 1 until $Dnum = $TDNum + 1 return
Bryce
[This message has been edited by Bryce (edited 30 November 2000).]
|
|
Top
|
|
|
|
#52464 - 2000-11-30 10:13 PM
Re: USE command doesn't work when using 2 variables
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
LOL !Operation BadLogic  [chuckle] For the benefit of others, Operation "BadLogic" is a pet project Bryce and I are working on to help brand new Kixtart users (and those unfamiliar with scripting) to quicky and painlessly get up and running. The intent is to build a generic login script (template) that is completly driven from an INI file. Specific things like welcome messages, legal notices, group based drive mappings and registry settings can be specified and changed from within the INI file... Looking forward - I'm designing a GUI program that will provide a graphical front-end for the whole thingy. One can configure the script through the GUI - then simply test and promote it without having to write a single line of code. The nice thing about this concept is that a new user will get the benefit of proven and tested Kix code - but still be able to easily tailor it to their specific environment. I think I speak for Bryce when I ask if anyone has any thoughts, critizisms or neat ideas in regards to this concept... Shawn.
|
|
Top
|
|
|
|
#52466 - 2000-11-30 10:33 PM
Re: USE command doesn't work when using 2 variables
|
Anonymous
Anonymous
Unregistered
|
Much thanks to everyone for the speedy and helpful responses. Shawn's suggestion was the simplest and quickest to implement. Thanks Shawn. It worked great.$D = "Q:" This is a great board. Lot's of ideas, good info, knowledgeable discussion. - Bob Archer
|
|
Top
|
|
|
|
#52467 - 2000-11-30 11:42 PM
Re: USE command doesn't work when using 2 variables
|
Anonymous
Anonymous
Unregistered
|
Sounds like a cracking idea, will the base script include exchange mail profile creation , printer etc...sounds like a gnu run on script logic cool ------------------ there can be only one!
|
|
Top
|
|
|
|
#52469 - 2000-12-01 10:56 AM
Re: USE command doesn't work when using 2 variables
|
DrillSergeant
MM club member
   
Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
|
Yes please,I would like to see the rough draft. I'm working with a company that has developed a Logon Processor. This is an application based on variables entered in an Access97 database. I can't send it to anyone (copyrights) but if i can see what you've got now, I can compare it with the things that they have. It's always better to let someone else do the thinking ;-) Greetings, Roger the Young
_________________________
The Code is out there
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|