RE: Remote Execution, Something Simple Needed

2006-03-07 Thread Anderson, Mark \(Service Delivery\)
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]

RE: Remote Execution, Something Simple Needed

2006-03-07 Thread Anderson, Mark \(Service Delivery\)
: 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

RE: Remote Execution, Something Simple Needed

2006-03-07 Thread Anderson, Mark \(Service Delivery\)
/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

RE: Finding the user's home directory?

2005-12-08 Thread Anderson, Mark (Service Delivery)
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

RE: Error 1053 starting Win32::Daemon service

2005-08-09 Thread Anderson, Mark (Service Delivery)
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

RE: Change in goto behavior

2005-07-13 Thread Anderson, Mark (Service Delivery)
(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

RE: It seems that Win32::OLE::Variant doesn't work!

2005-06-01 Thread Anderson, Mark (Service Delivery)
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

RE: perl Tk question

2005-06-01 Thread Anderson, Mark (Service Delivery)
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

RE: Script printing its own source code

2005-05-31 Thread Anderson, Mark (Service Delivery)
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

RE: propper handling if a child thread die

2005-04-21 Thread Anderson, Mark (Service Delivery)
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

RE: die() without setting $@

2005-04-20 Thread Anderson, Mark (Service Delivery)
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-

RE: Passing back results to calling command or CD

2005-04-19 Thread Anderson, Mark (Service Delivery)
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

RE: Globbing

2005-04-11 Thread Anderson, Mark (Service Delivery)
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

RE: File creation date is not maintained when being replaced by a deleted file

2005-04-06 Thread Anderson, Mark (Service Delivery)
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,

RE: ithreads

2005-03-31 Thread Anderson, Mark (Service Delivery)
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

RE: Win32::AdminMisc

2005-03-18 Thread Anderson, Mark (Service Delivery)
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

RE: How to 'touch' in Windows

2005-03-10 Thread Anderson, Mark (Service Delivery)
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)

RE: Create User Accounts Using Perl

2005-02-08 Thread Anderson, Mark (Service Delivery)
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

RE: Logon with MAPI.session without hand

2005-01-26 Thread Anderson, Mark (Service Delivery)
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

RE: Logon with MAPI.session without hand

2005-01-26 Thread Anderson, Mark (Service Delivery)
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

RE: Win32 inserting URLs into excel sheet

2005-01-11 Thread Anderson, Mark (Service Delivery)
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);

RE: to remove a particular element from array

2004-12-24 Thread Anderson, Mark (Service Delivery)
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

RE: count of matches

2004-12-22 Thread Anderson, Mark (Service Delivery)
=~ 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

RE: Calling Perl from Excel

2004-12-21 Thread Anderson, Mark (Service Delivery)
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:

RE: Odd, Even, or Multiple of a number

2004-11-22 Thread Anderson, Mark (Service Delivery)
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

RE: mkdir questions on unix platform

2004-11-15 Thread Anderson, Mark (Service Delivery)
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]

RE: mkdir questions on unix platform

2004-11-15 Thread Anderson, Mark (Service Delivery)
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,

[OT] Perl Automated Pasword Reset Systems

2004-10-29 Thread Anderson, Mark (Service Delivery)
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

RE: SID Collection

2004-10-28 Thread Anderson, Mark (Service Delivery)
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,

RE: external library

2004-10-27 Thread Anderson, Mark (Service Delivery)
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

RE: Help with array of arrays!

2004-10-13 Thread Anderson, Mark (Service Delivery)
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

RE: Help with array of arrays!

2004-10-13 Thread Anderson, Mark (Service Delivery)
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

RE: String matching ?

2004-09-13 Thread Anderson, Mark (Service Delivery)
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

RE: Round Numbers

2004-09-08 Thread Anderson, Mark (Service Delivery)
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

RE: Round Numbers

2004-09-08 Thread Anderson, Mark (Service Delivery)
://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

RE: exec usage

2004-09-03 Thread Anderson, Mark (Service Delivery)
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

RE: Help with exec command

2004-09-03 Thread Anderson, Mark (Service Delivery)
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

RE: Pls Help with a Basic Script.

2004-08-20 Thread Anderson, Mark (Service Delivery)
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

RE: Remote Execution, Something Simple Needed

2004-06-23 Thread Anderson, Mark (Service Delivery)
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]

RE: Retrieve process list

2004-05-14 Thread Anderson, Mark (Service Delivery)
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

RE: Setting Linux Env Variables from Perl script

2004-05-11 Thread Anderson, Mark (Service Delivery)
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:

RE: Using ActiveXObject in perl

2004-04-13 Thread Anderson, Mark (Service Delivery)
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

RE: perl module to check the folder/file size

2004-04-01 Thread Anderson, Mark (Service Delivery)
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/

RE: Can a variable be made like this?

2004-03-24 Thread Anderson, Mark (Service Delivery)
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

[PMX:VIRUS] RE: WMI to determine if Outlook installed?

2004-03-19 Thread Anderson, Mark (Service Delivery)
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

RE: perl executable

2004-03-17 Thread Anderson, Mark (Service Delivery)
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

RE: write to a file

2004-03-12 Thread Anderson, Mark (Service Delivery)
://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

RE: (no subject)

2004-03-09 Thread Anderson, Mark (Service Delivery)
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