Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Setting Terminal Services settings using ASP.NET (or... calling Server-side vbscript from ASP.NET)

Reply
Thread Tools

Setting Terminal Services settings using ASP.NET (or... calling Server-side vbscript from ASP.NET)

 
 
Roja Doja
Guest
Posts: n/a
 
      04-13-2005
I need to be able to change the Terminal Services attributes.

Using vbscript on Server 2003 this is easy enough, as described at

http://www.microsoft.com/technet/scr...s/default.mspx

for example.

I want to be able to write a web interface to do this, to make it
easier for those who will be setting these settings, and to log
changes, control access etc. However, doing the same simple task in
..Net languages (C# VB.NET etc) is proving damn near impossible. After
wrapping a Win32 API, I find I can now alter string type settings in
C#, such as TerminalServicesProfilePath, but not DWORD settings such
as MaxDisconnectionTime, which is the one I really want to be able to
change via a web interface.

As it's easy enough in vbscript, I'm wondering if there is any way I
can call a server-side vbscript plus parameters from within an ASP.NET
page?

Thanks,
Roger
 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      04-14-2005
Some of the interop stuff can get really messy. You could use the
System.Diagnostics.Process class to spin off a vbs script.

--
Scott


On 13 Apr 2005 10:02:27 -0700, (Roja Doja)
wrote:

>I need to be able to change the Terminal Services attributes.
>
>Using vbscript on Server 2003 this is easy enough, as described at
>
>http://www.microsoft.com/technet/scr...s/default.mspx
>
>for example.
>
>I want to be able to write a web interface to do this, to make it
>easier for those who will be setting these settings, and to log
>changes, control access etc. However, doing the same simple task in
>.Net languages (C# VB.NET etc) is proving damn near impossible. After
>wrapping a Win32 API, I find I can now alter string type settings in
>C#, such as TerminalServicesProfilePath, but not DWORD settings such
>as MaxDisconnectionTime, which is the one I really want to be able to
>change via a web interface.
>
>As it's easy enough in vbscript, I'm wondering if there is any way I
>can call a server-side vbscript plus parameters from within an ASP.NET
>page?
>
>Thanks,
>Roger


 
Reply With Quote
 
 
 
 
Roja Doja
Guest
Posts: n/a
 
      04-14-2005
Of course, yes, thanks v.much. I'd even used
System.Diagnostics.Process before in an application, somehow I always
think of webserver code as different...

Anyway, just in case it's helpful, here's my working code (I don't
clainm anything, other than it works for me...) I could only get it
to work by calling cscript first, and I could only call cscript if I
set the working directory to C:\Windows\System32\ to find cscript,
rather than use the directory of the script.

Process myProcess = new Process();
myProcess.StartInfo.WorkingDirectory = @"C:\Windows\System32\";
myProcess.StartInfo.FileName=@"cscript";
myProcess.StartInfo.UseShellExecute=false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.Arguments=@"/b
W:\Virtual\webdir\bin\myscript.vbs";
myProcess.Start();
string result = myProcess.StandardOutput.ReadToEnd();

Cheers,
Roger
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
v = vte.Terminal() AttributeError: 'module' object has no attribute 'Terminal' Steve Python 2 12-07-2010 05:48 PM
Settings.settings file with settings for multiple regions donet programmer ASP .Net 3 11-20-2009 03:05 PM
open a new terminal window from another terminal window in linux/unixsystem gaurav kashyap Python 3 10-31-2008 12:10 PM



Advertisments