PC Review


Reply
Thread Tools Rate Thread

Cannot access qwinsta.exe programmatically

 
 
Kristofer Skaug
Guest
Posts: n/a
 
      21st May 2009
Hi -

I have a piece of Delphi source code here that is calling the 'qwinsta'
utility and parses its output, in order to detect the presence of a Remote
Desktop login session.
This has always worked well on Windows XP (except on some XP-Embedded images
where 'qwinsta.exe' was not pre-installed).

Now I have a new Vista x64 Ultimate system. I have verified that 'qwinsta'
is installed, and it works properly from a command prompt.
However, the routine in my test program fails to access 'qwinsta' - here is
the commandline I use to invoke it:

'cmd.exe /c qwinsta.exe /server'

(this is invoked using CreateProcess) - which returns the following message:

-> "'qwinsta.exe' is not recognized as an internal or external command,
operable program or batch file."

PATH for the system has been set to include %systemroot%\System32, and just
to be sure, I've set the "start in" directory for this command to
c:\Windows\System32 - which is where qwinsta.exe is installed. Using the
same commandline invocation format on the same system, I am able to
succesfully invoke other utilities in the same directory, e.g. SYSTEMINFO.

My account is member of the "Administrators" group, and I've even tried
running the test program "As Administrator" (from the context menu) but no
difference.
I have completely turned off UAC. The last bit of 'relevant' information I
can think of is that all this testing is taking place using a Remote Desktop
connection. The 'qwinsta' output I get from the Command Prompt (i.e.
manually) is as follows:

SESSIONNAME USERNAME ID STATE TYPE DEVICE
services 0 Disc
console 1 Conn
>rdp-tcp#0 kgs 2 Active rdpwd

rdp-tcp 65536 Listen

Please, if someone has an idea what I'm doing wrong, let me know!
Also, if there's a better forum somewhere to ask this question - -

TIA, Kristofer







 
Reply With Quote
 
 
 
 
Kristofer Skaug
Guest
Posts: n/a
 
      22nd May 2009
Additional information - by dumb experimentation I have found that also the
commands qprocess.exe and shadow.exe fail in the same way (i.e. they work
when typed manually into a command prompt, but fail to be launched via
cmd.exe /c). Yet other commands like tasklist, ping, netstat etc. do work in
both ways.

Kristofer

Kristofer Skaug wrote:
> Hi -
>
> I have a piece of Delphi source code here that is calling the
> 'qwinsta' utility and parses its output, in order to detect the
> presence of a Remote Desktop login session.
> This has always worked well on Windows XP (except on some XP-Embedded
> images where 'qwinsta.exe' was not pre-installed).
>
> Now I have a new Vista x64 Ultimate system. I have verified that
> 'qwinsta' is installed, and it works properly from a command prompt.
> However, the routine in my test program fails to access 'qwinsta' -
> here is the commandline I use to invoke it:
>
> 'cmd.exe /c qwinsta.exe /server'
>
> (this is invoked using CreateProcess) - which returns the following
> message:
> -> "'qwinsta.exe' is not recognized as an internal or external
> command, operable program or batch file."
>
> PATH for the system has been set to include %systemroot%\System32,
> and just to be sure, I've set the "start in" directory for this
> command to c:\Windows\System32 - which is where qwinsta.exe is
> installed. Using the same commandline invocation format on the same
> system, I am able to succesfully invoke other utilities in the same
> directory, e.g. SYSTEMINFO.
> My account is member of the "Administrators" group, and I've even
> tried running the test program "As Administrator" (from the context
> menu) but no difference.
> I have completely turned off UAC. The last bit of 'relevant'
> information I can think of is that all this testing is taking place
> using a Remote Desktop connection. The 'qwinsta' output I get from
> the Command Prompt (i.e. manually) is as follows:
>
> SESSIONNAME USERNAME ID STATE TYPE DEVICE
> services 0 Disc
> console 1 Conn
>> rdp-tcp#0 kgs 2 Active rdpwd

> rdp-tcp 65536 Listen
>
> Please, if someone has an idea what I'm doing wrong, let me know!
> Also, if there's a better forum somewhere to ask this question - -
>
> TIA, Kristofer



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Re: Problems on qwinsta Querrying Robert L. \(MS-MVP\) Windows XP Work Remotely 0 29th May 2008 09:32 PM
Is it any way to programmatically store and hide data inside an Access database that it is not shown on the Access user interface? SammyBar Microsoft Access 5 30th Nov 2006 07:03 PM
Is it any way to programmatically store and hide data inside an Access database that it is not shown on the Access user interface? SammyBar Microsoft Access Security 5 30th Nov 2006 07:03 PM
QWINSTA.exe and SP2 John Whitmer Windows XP Help 1 25th Mar 2005 03:02 PM
QWINSTA.EXE and long scan disk time... MF Windows XP General 9 6th Nov 2003 02:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:36 AM.