Page 1 of 1 1
Topic Options
#52457 - 2000-11-30 07:42 PM USE command doesn't work when using 2 variables
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
#52458 - 2000-11-30 07:54 PM Re: USE command doesn't work when using 2 variables
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
I tried this on win2k and it didn't work - I am creeped out that it did on NT..

I got an error 1200 "The specified device name is invalid."

Why I expect it NOT to work is because KiX won't accept $d: - it is looking for A to Z or * only.

this:

shell "net use $D: $S\SCAN"

works fine on win2k...

cj

Top
#52459 - 2000-11-30 08:13 PM Re: USE command doesn't work when using 2 variables
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Would this work ?

$D = "Q:"

...

USE $D "$S\SCAN"

Shanw.



Top
#52460 - 2000-11-30 08:23 PM Re: USE command doesn't work when using 2 variables
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
thanks!!! yall just pointed out a problem that i didn't even know that I had!!

here is how i fixed it

$code = 'use $drive "$unc"'
$nul = execute($code)


THANKS!
Bryce

Top
#52461 - 2000-11-30 08:47 PM Re: USE command doesn't work when using 2 variables
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
I just got this to work on NT & 2K client:

code:
$d = "t"
use ($d + ":") "\\server\share"
exit

------------------
Box
FACTA NON VERBA

_________________________
Box
FACTA NON VERBA

Top
#52462 - 2000-11-30 08:55 PM Re: USE command doesn't work when using 2 variables
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Bryce:

What was the problem ?

Shawn.

Top
#52463 - 2000-11-30 09:37 PM Re: USE command doesn't work when using 2 variables
Bryce Offline
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 Offline
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
#52465 - 2000-11-30 10:22 PM Re: USE command doesn't work when using 2 variables
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Sounds like a champion project!

I look forward to seeing the finished product.

cj

Top
#52466 - 2000-11-30 10:33 PM Re: USE command doesn't work when using 2 variables
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
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
#52468 - 2000-11-30 11:53 PM Re: USE command doesn't work when using 2 variables
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I think that could be added fairly easy...

But I have no idea how to do it Some pointers on how to do it would be a good starting point. Or if someone has some code that they would be willing to donate to the project?

Also if someone would like to get the full version of the script (at least what i have so far) just say so. Also that above snipit of code was the first rough hack, and was full of bugs......

Bryce

Bryce

Top
#52469 - 2000-12-01 10:56 AM Re: USE command doesn't work when using 2 variables
DrillSergeant Offline
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
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.071 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org