Page 1 of 1 1
Topic Options
#112046 - 2004-01-19 11:04 PM Terminal Services Scripting
Sardis Offline
Fresh Scripter

Registered: 2004-01-16
Posts: 28
Loc: Montgomery, AL
Hello, I am using KiX ver 4.22 under Windows 2000 Server letting all my users login to the terminal server. All scripts are run through group policies in AD users and computers. I have made a script the deletes all network connections when a user logs out and it works fine, however, I got another script from this bullitan board that allows me to pop-up a random quote from a text file. If I add the code to the small network connection delete script I wrote earlier, the new script works fine, but the delete connections script happens on logoff. If I put it in the logon section, the new code never appears to work. If I add the script to execute AFTER the network connections deletion script runs, the terminal hangs during logoff and will not be released until I manually release it using terminal services manager. DOes anyone know what this is all about?
_________________________
Jason A King

Top
#112047 - 2004-01-19 11:49 PM Re: Terminal Services Scripting
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
You're not providing enough information. Most likely it's messed-up code. Run the scripts with DEBUG ON to step throught he code and see where it fails.
_________________________
There are two types of vessels, submarines and targets.

Top
#112048 - 2004-01-20 12:01 AM Re: Terminal Services Scripting
Sardis Offline
Fresh Scripter

Registered: 2004-01-16
Posts: 28
Loc: Montgomery, AL
I have run the code in debug, I can't find out where it errors out, it's like it just stops. What can I do?
_________________________
Jason A King

Top
#112049 - 2004-01-20 12:07 AM Re: Terminal Services Scripting
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Now, if you've run the code in debug mode, then you'd know which was the last line that got executed correctly, wouldn't you, as the executed lines get displayed in the console?

So, then take a look at the last line that got executed and the line after. Also, make sure that all strings are correctly enclosed in quotes and all conditional statements are closed correctly. It migth also help to start a script with
Code:

$rc=setoption('explicit,'on')
$rc=setoption('novarsinstrings','on')



Finally, it helps to post the code when asking why a particular piece of code does not work.
_________________________
There are two types of vessels, submarines and targets.

Top
#112050 - 2004-01-20 05:22 AM Re: Terminal Services Scripting
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Jens:

Ya had me scratching my head for a few moments.. that's dangerous, because I keep expanding the bald spot.

Anyway, you might want to clarify that "strings of text" (<= like this one) should be enclosed in matching quotes, but String Variables should not. This is especially important if you turn on the NoVarsInStrings option.

Sardis:
When I'm troubleshooting a script, I usually only turn one option at a time on - usually EXLICIT is done first. Otherwise you might be overwhelmed with error messages AND wierd output.

Another thing I do when writing or debugging code is identify the EndIf statements, as such:
Code:
 

If $RC = 0
'OK!' ?
Else
'Fail!' ?
EndIF ; $RC = 0


This helps locate missing EndIfs (or loops, too).

Finally, I sprinkle little print statements through the code where I suspect the problem might be, even something so simple as Code:
 '.' 

, which prints a series of dots. I can count the dots and know what line I made it to before the script ended.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#112051 - 2004-01-20 02:45 PM Re: Terminal Services Scripting
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Lastly, if you want, you can download a parser like KiXStrip from MCA's site to check your code as well. It will also check for missing ENDIFs, LOOPs too..

But, with the talent lurking around here, if you post your code, you should have a response in oh about 10 minutes (no joke)..

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#112052 - 2004-01-20 04:26 PM Re: Terminal Services Scripting
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The funny thing is, we even invested the time and effort to create FAQs dealing with debugging, e.g. Debugging script without user input. also during logging on. the advanced way and Debugging without user input .
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.049 seconds in which 0.021 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