RE: How to determine Windows Temp Folder?

2002-08-28 Thread Fernando Madruga


Maybe this can help?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio
/base/gettemppath.asp

Bye,
  Madruga

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]] On 
 Behalf Of Tillman, James
 Sent: quarta-feira, 28 de Agosto de 2002 11:47
 To: 'Andre Warnier'; Bellenger, Bruno (Paris); perl-win32-users list
 Subject: RE: How to determine Windows Temp Folder?
 
 
 I believe it falls back to c:\windows (Win9x) or c:\winnt 
 (WinNT) when the TEMP and TMP env vars are not set.  (Yes, 
 really!  I'm not kidding. I'm pretty sure I've seen this before)
 
 On Win2k, I think it falls back to the USERPROFILE env var 
 before falling back to c:\winnt\
 
 So I think you'll always get a valid directory of some kind, 
 but not necessarily a very desirable one.
 
 You'll find the API is truly the best way to handle this, 
 since with Win2k, c:\windows\temp is no longer the default 
 location for user's temp files, it's actually a temp 
 directory in their Documents and Settings folder. Since 
 Microsoft uses the API, you can be pretty sure your code 
 won't blow up in future Windows versions if you use the API, 
 too.  The same cannot be said for ENV vars, which Microsoft 
 has always hated as much as they hate the command line.  Too 
 unixy, I guess :-)
 
 When in Rome...
 
 jpt
 
  -Original Message-
  From: Andre Warnier [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, August 28, 2002 5:19 AM
  To: Bellenger, Bruno (Paris); perl-win32-users list
  Subject: RE: How to determine Windows Temp Folder?
  
  
  I bow to the master(s).
  
  Now the question I have is :
  
  If one deletes the Win32 environment variables TEMP and
  TMP, do the
  functions below still work ?
  What is the logic there ? Does WinXX have a notion of 
  temporary directory
  independently of what ones tells it in TEMP ?
  Or are the two necessarily linked ?
  
  
  
  From MS Knowledge Base, hoping it helps the original questioner : 
  quote  (Article # Q195763)
  
  
  GetTempPath
  The GetTempPath API function allows you to determine the path
  location of a
  system's temporary folder. It takes two parameters: the 
  length of a fixed-
  length or pre-initialized string that will contain the path 
  name, and the
  string itself. You must use either a fixed-length string, 
 or a string
  initialized to a length that you believe will be long enough 
  to contain the
  path information. This is to guarantee that Visual Basic 
  allocates enough
  buffer space for Windows to return the information.
  
  GetTempPath returns the length of the path name measured in
  bytes, or 0 if
  an error occurs. If the return value is greater than the 
  buffer size you
  specified, then no path information was written to the string.
  
  The declaration for GetTempPath is provided in the sample below. 
  GetTempFileName The GetTempFileName API function is used to 
 create a 
  fully-qualified temporary file name at a given location. 
 The function 
  takes four
  parameters: the string containing the path for the file, a string 
  containing a prefix used to start the unique file name, a unique 
  number to construct the temp name, and, finally, a fixed-length or
  pre-initialized
  string used to return the fully qualified file name. Both 
 the path and
  prefix strings are required and cannot be empty. The unique 
  number can be 0
  (NULL), in which case GetTempFileName creates a unique number 
  based on the
  current system time.
  
  GetTempFileName returns the unique number used to create the
  file name, or
  returns 0 if an error occurs. 
  
  unquote
  
  
  
  André Warnier
  EIS LP
  [EMAIL PROTECTED]
  
  
  Message text written by Bellenger, Bruno \(Paris\)
   
  
  
 http://opensource.activestate.com/authors/jand
ubois/Perl/TPC3/fun.html
  http://opensource.activestate.com/authors/jandubois/Perl/TPC3
 /fun.html  
 
 also has this slightly improved version from Jan Dubois : 
  
 use strict;
 use Win32::API;
 
 my $GetTempPath = new Win32::API kernel32, GetTempPath, 
 [qw(N P)], 'N';
 
 my $path = ' ' x 256;
 my $len = $GetTempPath-Call(length $path, $path);
 
 if ($len == 0) {
 print GetTempPath() failed: $^E\n;
   }
   elsif ($len  length $path) {
 print Buffer too small; we need $len bytes\n;
   }
   else {
 $path = substr($path,0,$len);
 print Temp path is $path\n;
   }
 
 
 _
 Bruno Bellenger
 Sr. Network/Systems Administrator 
 
 
 
 ___
 Perl-Win32-Users mailing list 
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 ___
 Perl-Win32-Users mailing list 
 [EMAIL PROTECTED]
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: How to determine Windows Temp Folder?

2002-08-28 Thread Fernando Madruga


 Strangely enough, the API docs at the link on Microsoft's web 
 site which Fernando posted to the mailing list directly 
 contradict this behavior!
 
 C'est bizarre!

Non, c'est Microsoft... :)

Later,
  Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Sendkeys and strange program behavior

2002-08-01 Thread Fernando Madruga


 Does anyone know how to sendkeys a mouse click?

Nope. And you'll have to use something different.

You may, however, be able to TAB into the button control, maybe it's
just not focused...

HTH,
  Fernando Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Changing the Windows Background NT 4.0

2002-08-01 Thread Fernando Madruga


 I am trying to automatically change the background on a Windows NT4.0
machine, The code im using is below, it seems to execute fine, however,
the background does not change. 
 Does any one have any ideas regarding this ?

Just this: are you running the script with a logged on user, or running
it automatically from some scheduler?
Also, did you check the registry to find out if it worked?
(You could probably just do that, i.e., change the proper key in the
registry...)

HTH,
  Fernando Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Changing the Windows Background NT 4.0

2002-08-01 Thread Fernando Madruga

 The registry is not getting updated. My guess is that the SystemInfo
call is failing...

I'll give it a try later at home and will let you know what happened.

Bye,
  Fernando Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: CGI Environment Problem (was: Regexp Help)

2002-07-25 Thread Fernando Madruga


I don't have much experience (in fact, nearly none!) with CGI scripts;
you should however remember that, on NT class machines, there are 2
(TWO) sets of environment variables: SYSTEM and USER. So, what may be
the diference is that somehow the two local profiles for the account you
run the CGI scripts may have diferent environment variables on the two
machines.

HTH,
  Fernando Madruga


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Mike Kalinovich
Sent: quarta-feira, 24 de Julho de 2002 19:47
To: [EMAIL PROTECTED]
Subject: RE: Regexp needed


Hello all,

I'm at a bit of a loss as to why the same script on two servers are
experiencing a difference in opinion.

Both are NT4 with all the latest and greatest patches from MS. Both are
running SP6a Both are running ActiveState v5.2.2

The CGI script is from tools4webmasters.com
This is an excerpt:

foreach $key (keys (%ENV)) {
if ($key eq 'DOCUMENT_ROOT') {
print
trtd$key$space=br/tdtd$ENV{$key}br/tdtdYour
base directory (the \/home/yourname\ part)br/td/tr\n;
}
else {
print
trtd$key$space=br/tdtd$ENV{$key}br/td/tr\n;
}
}

The script goes through all the Environment keys and reports them back.
Except for the key of:  Perl5.00503 =

On one server it is blank, on the other it reports
 perl: C:\Perl\bin\perl.EXE

I am at a loss as to where this is coming from.  If someone could share
this information with me.  The system environment variables do not
contain this on either server.

Any help would be much appreciated,
Mike Kalinovich

___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: perl script to actively monitor NT event log and e-mail any error s/warnings

2002-07-18 Thread Fernando Madruga


Don't recall where or when I got this, and I have not even tried it!

If it doesn't suit your needs, try looking here:

http://cwashington.netreach.net/depo/default.asp?topic=repositoryScript
Type=perl

http://hotscripts.com/Perl/

http://www.cgiextremes.com/

HTH,
  Fernando Madruga

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Lewis, Chris
Sent: quarta-feira, 17 de Julho de 2002 17:26
To: '[EMAIL PROTECTED]'
Subject: RE: perl script to actively monitor NT event log and e-mail any
error s/warnings


Does anyone know of a script out there that actively monitors the NT
event log and e-mails any potential errors or warnings?

Thanks,
Chris
___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



eventwatch.ini
Description: Binary data


eventwatch.pl
Description: Binary data


RE: (was Re: win32 and win32::Lanman conflicting?)

2002-07-16 Thread Fernando Madruga


I downloaded Win32::Lanman 1.0.9.2 from CPAN, installed it without any
errors and got the same result.
I'm using ActivePerl 5.6.1.633. Try using Win32::NetAdmin (standard with
ActivePerl) and Win32::AdminMisc (from
http://www.roth.net/perl/adminmisc/). You can install this last module
with the following comand line:

ppm install Win32-AdminMisc --location=http://www.roth.net/perl/packages

I believe that, between these two modules, you'll find what you need.

HTH,
  Fernando Madruga

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Jason Hemak
Sent: terça-feira, 16 de Julho de 2002 0:06
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: (was Re: win32 and win32::Lanman conflicting?)


Hey Jan (and anyone else with thoughts),

So I did what you said.  Completely uninstalled activeperl, removed the
Perl tree, and then reinstalled activeperl (5.6.1 build 633) and lanman
(1.0.9.2).  I still get the mess at the end of this e-mail.  My program
consists of only this much code:

#! perl -w

use strict;
use diagnostics;

use Win32;
use Win32::Lanman;


Do you have any other thoughts?

Thanks…
Jason


Here’s the gook:

Constant subroutine DACL_SECURITY_INFORMATION redefined at
C:/Perl/lib/Exporter. pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Prototype mismatch: sub main::DACL_SECURITY_INFORMATION () vs none at
C:/Perl/li b/Exporter.pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Constant subroutine GROUP_SECURITY_INFORMATION redefined at
C:/Perl/lib/Exporter .pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Prototype mismatch: sub main::GROUP_SECURITY_INFORMATION () vs none at
C:/Perl/l ib/Exporter.pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Constant subroutine OWNER_SECURITY_INFORMATION redefined at
C:/Perl/lib/Exporter .pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Prototype mismatch: sub main::OWNER_SECURITY_INFORMATION () vs none at
C:/Perl/l ib/Exporter.pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Constant subroutine SACL_SECURITY_INFORMATION redefined at
C:/Perl/lib/Exporter. pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV ICE_CONTROL_DESCRIPTIONS',
'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SE
RVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...)
called at C:\Perl\scripts\testprog.pl line 7
main::BEGIN() called at C:/Perl/site/lib/Win32/Lanman.pm line 7
eval {...} called at C:/Perl/site/lib/Win32/Lanman.pm line 7
Prototype mismatch: sub main::SACL_SECURITY_INFORMATION () vs none at
C:/Perl/li b/Exporter.pm line 57.
Exporter::import('NET_INFO_DESCRIPTION',
'NET_STATUS_DESCRIPTION', 'SERV

RE: FILEHANDLE Problem

2002-07-15 Thread Fernando Madruga

 This is going to drive me nuts I have my test snippet below

 When I run this as shown below, I get the error: Invalid argument.

 open(FILE, d:\path_to\textfiles\test.txt) or die Can't open $!;

You need to replace each \ with \\ as a single \ will be interpreted as
an escape character.
Alternatively, use ' (single quotes) instead of  (double quotes) as
single quotes don't interpolate.

 When I run it as:
 open(File, ../textfiles/test.txt)

Are you sure that the starting directory is correct? That the user
account your script runs under has access to it?

HTH,
  Fernando Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Strange change in WinNT environment: File association to .PL now give error message

2002-07-15 Thread Fernando Madruga


 Fernando,
 Thanks for the suggestion.  Unfortunately, the associations and file
typing are correct:

Well, I'm out of sugestions here. Other than trying to upgrade your
current version to the same one, that is, reinstalling ActivePerl, but
that you probably already tried...

Bye,
  Fernando Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Win32::GuiTest SendKeys delay

2002-07-12 Thread Fernando Madruga


I tried on Windows XP Professional with ActivePerl 5.6.1.633 and it dit
NOT work

HTH,
  Fernando Madruga

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Jim Angstadt
Sent: quinta-feira, 11 de Julho de 2002 16:37
To: [EMAIL PROTECTED]
Subject: Re: Win32::GuiTest SendKeys delay



--- Marcus [EMAIL PROTECTED] wrote:
snip
 
 Jim, what did you test on, and which Perl/Guitest
 version do you have?
 I still get an error with NT 4 and AP
 623.
 
 Thanks,
 
 Marcus
 

Hi Marcus,

I used a Win98se box with build 631.  I installed Win32::GuiTest
recently ( just after your message ) using ppm.  The id line in
GuiTest.pm is:

  # $Id: GuiTest.pm,v 1.14 2001/12/01 23:34:50 erngui
Exp $

I do not have NT, so cannot test on it.

hth,
Jim


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com
___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Problem with =~

2002-07-02 Thread Fernando Madruga
Title: Message



Try using STRING 
equal, instead of NUMERIC equal, that is: eq instead of 
==...

HTH,
 Madruga

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]] On Behalf Of 
  Dovalle YankelovichSent: segunda-feira, 1 de Julho de 2002 
  16:22To: Perl32 (E-mail)Subject: Problem with 
  =~
  Hi
  I need to take 
  some data from txt file and im looking for a string within the 
  text.
  here part of the 
  text:
  tionDwsRx: Total 
  allocated bytes (downstream) = 0, bits = 2, 
  
  I need the value 
  after the first '='
  and im 
  doingit this way
  
  if (($line =~ 'DwsRx: 
  Total allocated bytes')and($'=~/(=)/))
  { 
  $noaFolder = 
  0;
  $accum = 0;
  @tmp = split//,$';
  while ((@tmp[$accum] == ' 
  ')and ($accum256 
  )){$accum++;} 
  while (@tmp[$accum] =~ /[0-9]/)
  { 
  $currVal = 
  $currVal.$;
  $accum++; 
  }
  the problem: if 
  the value after the '=' isn't '0' then everything is good, but if the value is 
  zero - it doesn't stopped there but continue to the value of 
  'bits'
  
  if someone have an 
  idea y its happen u know what to do
  
  Thanks a 
  lot
  Dovalle
  
  


RE: Problems with reg expression

2002-06-05 Thread Fernando Madruga


Just my guess: you'll probably need to replace all @ with \@ in the
regexp...

Sem mais assunto de momento,
  Fernando Madruga
  ASC:DSI



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Walter Usyk
Sent: segunda-feira, 3 de Junho de 2002 19:01
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Problems with reg expression


I'm having a problem with a regular expression and I hope that someone
can help me out with.

I have the following:

my $envLU
=/vobs/spifftest/.@@/HDX.LU/lineups/.@@/HDX.LU/hdx.lu@@/main/LATEST;
$envLU   =~ s/^(.*\/)([^\/]+@@[^@@]+)$/$2/;

What it is suppose to return is the string starting after the /? before
the last @@. That is hdx.lu@@/main/LATEST

It does do this but I get errors below.

When the reg expression get executed I start receiving the following
errors and I do not know why.

Bareword found where operator expected at (eval 740) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 741) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 743) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 744) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 745) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)

And they just keep going on until I kill the application.

Can any one tell me what the problem is?

--
Walter Usyk - Tools Developer
Software Development Environment Tools (1P67)
email: [EMAIL PROTECTED]
ESN: 398-4603
Tel: (613) 768-4603


___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Problems with reg expression

2002-06-05 Thread Fernando Madruga


Correction to my previous post:
You'll probably need to preceed all @ in the $envLU variable with a \,
that is:
my $envLU
=/vobs/spifftest/.\@\@/HDX.LU/lineups/.\@\@/HDX.LU/hdx.lu\@\@/main/LATE
ST;

Otherwise, just use single quotes instead of double ones like this:

my $envLU
='/vobs/spifftest/.@@/HDX.LU/lineups/.@@/HDX.LU/hdx.lu@@/main/LATEST';

That will prevent it from trying to find an array variable named @ (@@).

Hope this helps,
  Fernando Madruga

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Walter Usyk
Sent: segunda-feira, 3 de Junho de 2002 19:01
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Problems with reg expression


I'm having a problem with a regular expression and I hope that someone
can help me out with.

I have the following:

my $envLU
=/vobs/spifftest/.@@/HDX.LU/lineups/.@@/HDX.LU/hdx.lu@@/main/LATEST;
$envLU   =~ s/^(.*\/)([^\/]+@@[^@@]+)$/$2/;

What it is suppose to return is the string starting after the /? before
the last @@. That is hdx.lu@@/main/LATEST

It does do this but I get errors below.

When the reg expression get executed I start receiving the following
errors and I do not know why.

Bareword found where operator expected at (eval 740) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 741) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 743) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 744) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)
Bareword found where operator expected at (eval 745) line 6, near
/vobs/spifftest
(Missing operator before pifftest?)

And they just keep going on until I kill the application.

Can any one tell me what the problem is?

--
Walter Usyk - Tools Developer
Software Development Environment Tools (1P67)
email: [EMAIL PROTECTED]
ESN: 398-4603
Tel: (613) 768-4603


___
Perl-Win32-Users mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: PLEASE - can any one help on this?

2002-06-05 Thread Fernando Madruga


 I have written before on this and now I am in pressing need to know
where I am going wrong with this code.

 Can anyone give me any ideas?

Unfortunately, the only help I can give you is tell you that you're
not alone here...

I've both Dave Roth's books and tried setting the privileges said to be
required, however it didn't improve the end result a single bit...
As you can see from below, I've added all 4 required attributes (even
though I'm a member of the Domain Admins), and still got the same
incorrect function. Maybe Dave Roth will want to shed some light on
this? I'm running Windows XP.

[d:\work]Admin Handbook Examples\chapter2\priv.pl FMADRUGA
From the book 'Win32 Perl Scripting: The Administrator's Handbook' by
Dave Roth

DOMAIN\FMADRUGA:
SE_ASSIGNPRIMARYTOKEN_NAME Replace a process level token
SE_INCREASE_QUOTA_NAME Adjust memory quotas for a process
SE_TCB_NAMEAct as part of the operating system
SE_CHANGE_NOTIFY_NAME  Bypass traverse checking

[d:\work]Teste.pl
Successfully logged on as USER.
Failed.
Error: Incorrect function.

[d:\work]type Teste.pl
use Win32::AdminMisc;
use Win32;

$Domain   = 'DOMAIN';
$User = 'USER';
$Password = 'test';
$Process  = 'NOTEPAD.EXE';

if (Win32::AdminMisc::LogonAsUser($Domain, $User, $Password,
LOGON32_LOGON_INTERACTIVE)){
  $LogonUser = Win32::AdminMisc::GetLogonName();
  print Successfully logged on as $LogonUser.\n;
  $Result = Win32::AdminMisc::CreateProcessAsUser( $Process );
  if ($Result){
print Successful! The new PID is $Result.\n;
  } else {
print Failed.\n\tError:  .
Win32::FormatMessage(Win32::AdminMisc::GetError()) . \n;
  }
} else {
  print Failed to logon.\n\tError:  .
Win32::FormatMessage(Win32::AdminMisc::GetError()) . \n;
}

Yours truly,
  Fernando Madruga

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs