Win32::KillProcess
http://www.perlmonks.org/index.pl?node_id=336024
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: Daniel Wilson [SMTP:[EMAIL PROTECTED]
: Wednesday, June 23, 2004 7:08 PM
To: Anderson, Mark (Service Delivery); Daniel Wilson;
perl-win32-admin@listserv.ActiveState.com
Cc: perl-win32-users@listserv.ActiveState.com
Subject: RE: Remote Execution, Something Simple Needed
*** WARNING : This message originates from the Internet
/GTrswi/
-Original Message-
From: Tim Johnson [SMTP:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 8:43 AM
To: Anderson, Mark (Service Delivery); Lloyd, Steve; Daniel Wilson;
perl-win32-admin@listserv.ActiveState.com
Cc: perl-win32-users@listserv.ActiveState.com
Subject: RE
That would be the location their Roaming or local profile would normally be
stored $ENV{USERPROFILE} - their home directory is an attribute of their
account.
I've used Win32::NetAdmin in the past and the UserGetAttributes routine when
I needed to see this sort of stuff.
Kind regards,
Mark
Hi, Andrew
a) can you run the DIRMON.pl script as yourself, interactively?
b) can you rediect STDERR to a file in a BEGIN{} block to see if you're able
to capture any errors from server mgr.
c) That error isn't always a problem - sometimes the service does start, I'm
guessing it's not in your
(We initially used a goto FINISH, but I hated that, too. You can
use a break if you're in a loop.)
you can also just surround the code in {} to make it a block and then use
last;
in perldoc -f last
Note that a block by itself is semantically identical to a loop
that
perl 5.8.4 on NT4
C:\perl -e use Win32::OLE;use Win32::OLE::Variant; my
$Array=Variant(VT_ARRAY|
VT_R8,[1,2],2); $Array-Put([1,2],[2,3]);
Win32::OLE(0.1701): Win32::OLE::Variant-Put(): Wrong number of indices;
dimension of SafeArray is 2 at -e line 1.
This works fine... it's normally easier
Looks like it's just because the window doesn't update until you return from
the callback. Are you trying to create some sort of special effect? Perhaps
asking how to create that effect might be simpler - the Text widget doesn't
look like it likes that sort of thing!
Kind regards,
Mark Anderson
Perl makes this even easier if the script is in a file... read from
filehandle 0 (stdin for perl.exe as opposed to which will be your
terminal rather than stdin).
---cut---
$x=q/test test test/;
open 0 or die('eek');
undef $/;
$a=0;
close (0);
print $a;
print \n$x\n;
---cut---
Kind
Hi, Markus
you could try aliasing your childs STDERR to a file
open (STDERR, , stderr.$$) or die(eek);
the parent will know the pid of the child if you fork() or you can use the
$thread-tid and threads-self-tid methods instead of $$.
The normal unix-style open with an argument of -| isn't
perldoc -f goto
eval {
...
goto EOB;
...
...
EOB: return;
};if($@){
...
}
Kind regards,
Mark Anderson
Service Improvement Programme
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063
-Original Message-
this is one of the standard annoyances... the concept of a CDW, PWD, OLDPWD
or whatever is a shell environment variable...
1) so you create a new shell (perl.exe) and cs somewhere and store the
directory in a file... (or whatever)
2) your batch file (running in a cmd.exe of its own) then does a
from perldoc -f glob you can either:
@ARGV=glob(*.html);
while( ) {...}
or
while( *.html) { ...}
Kind regards,
Mark Anderson
Service Improvement Programme
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063
-Original Message-
From: [EMAIL
You could investigate touch or a windows port of it.
Kind regards,
Mark Anderson
Service Improvement Programme
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063
-Original Message-
From: [EMAIL PROTECTED]
[SMTP:[EMAIL PROTECTED] On Behalf Of
Fish,
Remember that a response to ping doesn't actually mean the machine's
alive, only that the NIC is responding. I've seen servers and
workstations that have crashed respond to ping far too often. I'd recommend
you $response=`NBTSTAT -a $computer` the machines instead then grep the
results for the
if you use LDAP, ADO or ADSI (IADS) you can simply ask for everything in the
computers OU. Treating the entire AD forest as a domain you'll probably
get away with
use strict;
use Win32::OLE qw/in/;
my $pcs_in_domain=Win32::OLE-GetObject(WinNT://domainname,computer);
print $_\n for (in
Why not just use open()?
Kind regards,
Mark Anderson
Service Improvement Programme
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063
-Original Message-
From: [EMAIL PROTECTED]
[SMTP:[EMAIL PROTECTED] On Behalf Of
Maxmelbin Neson (RBIN/EDM3)
Yes but how you do it depends on various factors...
If it's AD you should check out the EZADScriptomatic tool from The
Scripting guys at technet (www.microsoft.com/technet)
If you really want to use Perl you can either use the ADSI objects and
Win32::OLE or you can go with Win32::AdminMisc from
Hi Hirosi
what do you intend to use your MAPI session for (this matters).
It is possible to logon to a MAPI session in various ways, including
anonymously or using NTLM authentication. All of the methods are documented
on MSDN but what you intend to do will determine the easiest method of
MAPI.Session Object:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_o
lemsg_session_object.asp
MAPI.Session Object Logon Method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_o
lemsg_logon_method_session.asp
You will find that the
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
http://www.google.com/;
This is the VBA for doing it where Anchor:=Selection indicates the currently
selected Cell... so a Range object...
so something like...
$MySheet-Hyperlinks-Add(Anchor=$MySheet-Range(a1) , Address=$url);
If you know the index number of the array element you can use delete but
that leaves a hole in the array.
If you know the index number of the array element you can use two array
slices to completely remove the element.
If you use a hash and have the computername as the key then delete
=~ m//g returns the number of matches if evaluated in list context so...
$_ = ABabcde12345BAABabcde1234blahblah5BA;
print $1 if /(AB.*?BA)/ ;
becomes
$_ = ABabcde12345BAABabcde1234blahblah5BA;
@count=$_=~/(AB.*?BA)/g;
print I matched . scalar @count . times\n;
If you
Shell cmd.exe /c perl.exe ?
Kind regards,
Mark Anderson
Service Improvement Project
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063
-Original Message-
From: Chris Jones [SMTP:[EMAIL PROTECTED]
Sent: Tuesday, December 21, 2004 2:32 PM
To:
for integers you can simply use the mod operator %
if (0==$number%2) {
#no remainder so it's even
}else{
#odd
}
from perldoc perlop
Binary ``%'' computes the modulus of two numbers. Given integer operands $a
and $b: If $b is positive, then $a % $b is $a minus the largest
Try using
use File::Path; #see the docs
mkpath will emulate a unix mkdir -p
Kind regards,
Mark Anderson
Service Improvement Project
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063
-Original Message-
From: Ella Cai [SMTP:[EMAIL PROTECTED]
mkdir -p /path/to/some/new/directory on unix will create the entire path if
you have the rights to do so.
use File::Path;
mkpath('/path/to/some/directory/or/other',0,0755);
perldoc File::Path;
perldoc umask
man umask
man mkdir
Kind regards,
Mark Anderson
Service Improvement Project
Level 2,
Hi,
this is a general enquiry rather than a technical question. Have any of you
implemented any automated password reset systems using Perl? I am talking
about something roughly equivalent to PasswordCourier (www.courion.com) or
psynch (www.psynch.com).
Kind regards,
Mark Anderson
The
WMI
http://www.google.co.uk/microsoft?hl=enq=WMI+SID+site%3Amsdn.microsoft.com;
meta=
Kind regards,
Mark Anderson
Service Improvement Project
Ground Floor, 34 Fettes Row
Edinburgh, EH3 6UY
Tel: 07808 826 063
-Original Message-
From: MJG [SMTP:[EMAIL PROTECTED]
Sent: Thursday,
Or you can simply:
use lib 'v:/utilities/perlutil';
use utils;
This should work just as well with an ENV var representing your list of
extra INC dirs, too.
Kind regards,
Mark Anderson
Service Improvement Project
Ground Floor, 34 Fettes Row
Edinburgh, EH3 6UY
Tel: 07808 826 063
-Original
use strict;
use warnings;
my @array;
for (0..3) {
push @array, [$_:, 1, 2, 3];
}
for my $R (@array) {
print join(,, @$R) , \n;
# for (0..3) {
# my $col = $_;
# print $array[$row][$col], unless ($col == 3);
# print
The $@ is dereferencing the ananymous array you created using push...
consider...
push @array, [0,1,2,3]; #- adds an anon array to @array
for my $arrayref (@array) {
print ref($arrayref) . \t . @$arrayref . \t( @$arrayref )\n;
}
so you can a) tell it's an array ref
use utf8;
my $test1 = AAgUhYJAAAgAhsqdtbb/K0f7PU\+D;
print string match\n if ( $test1 =~ m/\Q$test1\E/ ) ;
You don't need to escape the / inyour string, simply anchor it in the regexp
with \Q \E. See perldoc perlre for details.
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of
Nope... try it :-) It only returns the integer component.
C:\logchecksperl -e print int(1.7)
1
C:
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: [EMAIL
://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: Anderson, Mark (Service Delivery)
Sent: Wednesday, September 08, 2004 2:59 PM
To: '[EMAIL PROTECTED]'; Chris
Cc: perl-win32-users; [EMAIL PROTECTED]
Subject: RE: Round Numbers
*** WARNING : This message originates from
What you're asking isn't clear... do you mean..
C: program.pl another_prograpm.pl arg arg arg
or
... some code ...
system($commandline);
#or
my @cmds=qw/prog.exe arg1 arg2 arg3/;
system(@cmds);
#or
exec(...) # Your program will never return from here!
Kind regards,
Mark Anderson
SMS
As you want the quotes passed to the shell try...
$arg1 = \c:/my_scripts/file.txt\;
or
$arg1= 'c:/my_scripts/file.txt'; (single quoted string with 's
inside)
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
At the line: if($_ =~ m/ORA-/ ){
a) you don't need the m/ just /
b) what are you expecting to be in $_ and have you checked (print stderr
$_;)?
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
Win32::KillProcess
http://www.perlmonks.org/index.pl?node_id=336024
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: Daniel Wilson [SMTP:[EMAIL PROTECTED]
Yes there is loads of stuff...
Win32::Process
Win32::OLE WMI
or you can handily download a module which does Starting/Listing/Killing of
processes from here:
http://www.perlmonks.org/index.pl?node_id=336024
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas
exec(/bin/sh);
But I'm guessing that's not going to help!
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: $Bill Luebkert [SMTP:[EMAIL PROTECTED]
Sent:
Hi, Jim,
Have you tried:
my $mtq = Win32::OLE-GetActiveObject(yada yada)... #if it's already running
my $mtq = Win32::OLE-GetObject(blah blah)... #if it isn't
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
For files you just need the
@stuff=stat($filename);
see perldoc -f stat
I don't know if it works for directories (suspect not).
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
No...
you [don't really] want
perl -e $x='hello';${$x}='Check this';print $hello;
YOU WOULD BE BETTER TO USE A HASH... Why do you need this [very unsafe]
construct?
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
Win32 Classes.url
Start here and work your way down the list... Win32_Product looks good if
stuff is installsed using MSI...
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
-Original
Do a google for Perl2EXE of PerlApp
Kind regards,
Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: Ken Cornetet [SMTP:[EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004
://www.manufacturing.rbs.co.uk/GTrswi/
-Original Message-
From: Eric Edwards [SMTP:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 7:52 AM
To: Anderson, Mark (Service Delivery);
[EMAIL PROTECTED]
Subject: Re: write to a file
*** WARNING : This message originates from the Internet ***
From
where Panel Item = $facia_panel_item and where Panel Sub-Item =
$Data{\Window\};
This needs to be
...yourSQL.. WHERE [Panel Item]=$facia_panel_item AND [Panel Sub-Item]= .
$Data{'Window'}
However, this doesn't really handle quoting very well so you should use
PLACEHOLDERS... then you can
48 matches
Mail list logo