RE: Help with LookupAccountSID (again)
Sorry, forgot to copy the group. Here's what I sent to Barry: The Win32 API to do that is ConvertStringSidToSid: http://msdn.microsoft.com/en-us/library/windows/desktop/aa376402(v=vs.85).as px My Perl isn't strong enough to know how to call this from Perl, but I'm sure someone stronger in Perl could handle it. -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry Brevik Sent: Wednesday, July 18, 2012 2:30 PM To: perl Win32-users Subject: Help with LookupAccountSID (again) Previously I had asked for help with Win32::LookupAccountSID(). Specifically, the call requires that the SID be in a binary format. One helpful user pointed me to this: http://code.activestate.com/lists/perl-win32-users/26301/ All of that works, except the article's author is first getting the binary SID from the Win32::LookupAccountName() call, which is a chicken and egg thing. I need to know how to convert a SID like this: '{S-1-5-21-1406052347-744958519-1677701-1424}' ...into its equivalent binary form for use in the Win32::LookupAccountSID() call. Does anyone out there know how to do this? TIA, Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Help with LookupAccountSID (again)
Found a Perl solution. Here you go: http://search.cpan.org/dist/Win32-Security/lib/Win32/Security/SID.pm -Original Message- From: Barry Brevik [mailto:bbre...@stellarmicro.com] Sent: Wednesday, July 18, 2012 2:46 PM To: Howard Tanner; Perl-Win32-Users@listserv.ActiveState.com Subject: RE: Help with LookupAccountSID (again) I tried to implement that call using Win32::API, but I just don't know enough about Windows to make it work. Thank you for posting, Barry Brevik -Original Message- From: Howard Tanner [mailto:tan...@optonline.net] Sent: Wednesday, July 18, 2012 11:31 AM To: Barry Brevik; Perl-Win32-Users@listserv.ActiveState.com Subject: RE: Help with LookupAccountSID (again) Sorry, forgot to copy the group. Here's what I sent to Barry: The Win32 API to do that is ConvertStringSidToSid: http://msdn.microsoft.com/en-us/library/windows/desktop/aa376402(v=vs.85 ).as px My Perl isn't strong enough to know how to call this from Perl, but I'm sure someone stronger in Perl could handle it. -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry Brevik Sent: Wednesday, July 18, 2012 2:30 PM To: perl Win32-users Subject: Help with LookupAccountSID (again) Previously I had asked for help with Win32::LookupAccountSID(). Specifically, the call requires that the SID be in a binary format. One helpful user pointed me to this: http://code.activestate.com/lists/perl-win32-users/26301/ All of that works, except the article's author is first getting the binary SID from the Win32::LookupAccountName() call, which is a chicken and egg thing. I need to know how to convert a SID like this: '{S-1-5-21-1406052347-744958519-1677701-1424}' ...into its equivalent binary form for use in the Win32::LookupAccountSID() call. Does anyone out there know how to do this? TIA, Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Template Toolkit on Windows 7
You said when ttree tries to create his .ttreerc file the OS will not let him do so. As Leo was pointing out, this is probably a problem with authority. Running the Perl script as an administrator would probably help, but that's not a fix. The issue is probably that you don't have create authority to the folder where the script is creating the file. To fix this, you need to have administrator access to the PC where the script is running. Assuming you do, you can use cacls (from the command line) to grant yourself create authority to the folder (make sure you run cmd as administrator). Assuming you have administrator access, you can also use the graphical interface to do this (easier for beginners). Open Windows Explorer and navigate to the folder. Right-click the folder and select Properties, then select the Security tab. Since you probably need administrator authority to make changes to this folder, click Continue. Click Add, type in your Windows user name and click Check Names. Assuming you entered the correct user name, the fully qualified name should be returned (e.g. COMPUTER\USERNAME). Click OK. Your user name should now appear in the list of authorized users. With your name highlighted, check off Full control in the Allow column. Click OK, then OK again and you should be back to Windows Explorer. Your script should now be able to create the file. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Dennis Daupert Sent: Wednesday, July 11, 2012 1:48 PM To: leosusa...@gmail.com Cc: perl Win32-users Subject: Re: Template Toolkit on Windows 7 Run the script or cmd as admin (right click on the command icon, select run as admin) would probably help This is a Perl script, configure.pl, no command icon to click on. Is there another way I can run it as admin? best, /dennis Upcoming time off: none planned Dennis Daupert, PhD Software Engineer, Supplementary Applications Development Global Service Development Deployment, Global Enterprise Services Management CSC GOS | o: 1.317.298.9499 | ddaup...@csc.com | www.csc.com This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::OLE events callback not executed
From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of haratron Sent: Monday, March 19, 2012 11:21 AM To: perl-win32-users@listserv.ActiveState.com Subject: Win32::OLE events callback not executed Hello, I want to implement karaoke functionality on my TTS (text to speech) editor. Meaning that I want to highlight words the moment they are spoken by the TTS system. I read that I need to watch for the onWord event. I have the same problem with this person: http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/msg275 30.html The callback never gets executed. How can I fix this? Thank you, haratron ___ Here's the dox from M$ on the Word event: http://msdn.microsoft.com/en-us/library/ms723593(v=vs.85).aspx It includes a VB example that does exactly what you want. Perhaps someone here better at Perl than me can help you translate it. I don't know where Mr. James Brown got his ordinal from, but I suspect the number 32, if that's correct at all, will be O/S version dependent, since different versions of Windows have slightly different versions of SAPI. Perhaps there's a better way in Perl to trap the Word event than using the ordinal. And note that the event is Word, not onWord. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::OLE events callback not executed
I couldn't get any events to be fired either. Perhaps Jan can weigh in since he seems to be around today. Here's my test code: use strict; use Win32::OLE qw(EVENTS); my $vox = Win32::OLE-new ('SAPI.SpVoice') || die Unable to create SAPI object\n; sub Event { my ($Obj, $Event, @Args) = @_; print Event: $Event\n; } Win32::OLE-WithEvents ($vox, \Event); $vox-{'EventInterests'} = 32; #Fire only new word events my $text = This is the Microsoft Speech Library.; $vox-Speak ($text, 1); #Read text asynchronously Win32::OLE-MessageLoop (); -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of haratron Sent: Monday, March 19, 2012 1:54 PM To: Howard Tanner Cc: perl-win32-users@listserv.activestate.com Subject: Re: Win32::OLE events callback not executed Thanks for the answer. I've also found these links that can help maybe: http://code.activestate.com/lists/activeperl/13161/ -- tried it, callback still doesn't get executed http://www.perlmonks.org/?node_id=429272 -- tried it, doesn't work I'm finding it difficult to translate that VB code to Perl. If anyone can help, much appreciated. On Mon, Mar 19, 2012 at 7:01 PM, Howard Tanner tan...@optonline.net wrote: From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of haratron Sent: Monday, March 19, 2012 11:21 AM To: perl-win32-users@listserv.ActiveState.com Subject: Win32::OLE events callback not executed Hello, I want to implement karaoke functionality on my TTS (text to speech) editor. Meaning that I want to highlight words the moment they are spoken by the TTS system. I read that I need to watch for the onWord event. I have the same problem with this person: http://www.mail-archive.com/perl-win32-users@listserv.activestate.com/ msg275 30.html The callback never gets executed. How can I fix this? Thank you, haratron ___ Here's the dox from M$ on the Word event: http://msdn.microsoft.com/en-us/library/ms723593(v=vs.85).aspx It includes a VB example that does exactly what you want. Perhaps someone here better at Perl than me can help you translate it. I don't know where Mr. James Brown got his ordinal from, but I suspect the number 32, if that's correct at all, will be O/S version dependent, since different versions of Windows have slightly different versions of SAPI. Perhaps there's a better way in Perl to trap the Word event than using the ordinal. And note that the event is Word, not onWord. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Setting file server time
NET TIME was my first thought too, but it only allows you to set your time to that of another machine. -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Tobias Hoellrich Sent: Monday, September 26, 2011 7:12 PM To: 'Barry Brevik'; perl-win32-users@listserv.ActiveState.com Subject: RE: Setting file server time Also take a look at net time: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en- us/net_time.mspx?mfr=true Cheers - T -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Howard Tanner Sent: Monday, September 26, 2011 5:08 PM To: 'Barry Brevik'; perl-win32-users@listserv.ActiveState.com Subject: RE: Setting file server time You can use the DOS TIME command to set the time (it uses military time). To execute it on a remote computer, I recommend psexec from Sysinternals. The advantage of psexec is you don't have to install anything on the remote machine - pstools installs itself there automatically if it needs to (and you have admin rights on the machine). psexec isn't available on its own, you have to download the entire command line suite, called pstools: http://download.sysinternals.com/Files/PsTools.zip ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Setting file server time
You can use the DOS TIME command to set the time (it uses military time). To execute it on a remote computer, I recommend psexec from Sysinternals. The advantage of psexec is you don't have to install anything on the remote machine - pstools installs itself there automatically if it needs to (and you have admin rights on the machine). psexec isn't available on its own, you have to download the entire command line suite, called pstools: http://download.sysinternals.com/Files/PsTools.zip -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry Brevik Sent: Monday, September 26, 2011 5:24 PM To: perl-win32-users@listserv.ActiveState.com Subject: Setting file server time Using Perl 5.8.8. I have both of the Win32 books and I've googled for this but I've come up short. Does anyone know how to set the time on a Windows server from a remote machine? Barry Brevik ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: I have a secondary Inbox folder and trying to read the messages in the 2ndary inbox
There's a Folders collection in the MAPI namespace. You should be able to index that by name. -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Wagner, David --- Sr Programmer Analyst --- CFS Sent: Monday, July 25, 2011 1:35 PM To: perl-win32-users@listserv.activestate.com Cc: Wagner, David --- Sr Programmer Analyst --- CFS Subject: I have a secondary Inbox folder and trying to read the messages in the 2ndary inbox I got some code from a reply I found on Perl Monks and brought over to my Desktop and ran the code. It does what I am after, BUT I do not want the default inbox, but another inbox. The code for the default inbox is: my $folder = $namespace-GetDefaultFolder(olFolderInbox); How do I get a different folder to read from messages from??? I have looked at the OLE browser, but there is way too many things to look at and I am lost at this point. Thoughts?? If you have any questions and/or problems, please let me know. Thanks. Wags ;) David R. Wagner Senior Programmer Analyst FedEx Services 1.719.484.2097 Tel 1.719.484.2419 Fax 1.408.623.5963 Cell http://Fedex.com/us ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Parsing a PDF with empty fields
Disclaimer: I'm using Acrobat 10 and Office 2010, so YMMV. I opened the PDF in Acrobat and selected File, Save As, then chose Tables in Excel Spreadsheet (*.xml). I opened the resulting xml in Excel, and the data was properly lined up in columns. There were only 50 entries per sheet (one PDF page per sheet), but there were only 5 sheets, and the fifth sheet had the last page of the PDF. So it was missing most of the data from the PDF. I was able to highlight the table in Acrobat, right click in one of the highlighted fields, and select Open Table in Spreadsheet. This opened Excel automatically with the table data properly populated. I was then able to export the table as a CSV, which gives you the data in a format you can use. However, this only worked one page at a time, but it worked for every page in the PDF. This, therefore, is your best bet. This will be tedious for all 25 pages in the PDF, especially considering you have to do this more than once. I recommend looking into AutoIt for automating the conversion to CSV. AutoIt is my favorite automation tool, and it's free. Good luck! -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Ted Schuerzinger Sent: Wednesday, April 13, 2011 4:53 PM To: Perl-Win32-Users@listserv.ActiveState.com Subject: Parsing a PDF with empty fields From time to time I need to parse the rankings PDF files from the Women's Tennis Association. I would do it by copying all the text, pasting it into a text file, and then using a Perl script to take each line, splitting it by spaces into an array, and then manipulating those arrays as need be. (Some tennis players have multiple spaces in their names, such as the Spanish players who use their matronymics, but reversing the array gets around that fairly easily.) That meant getting rid of fields I don't need (eg. a player's nationality), putting in tabs, and printing the modified list to a different text file so that I could use a spreadsheet to open the modified PDF as a tab-delimited spreadsheet. However, the WTA has changed its PDFs. There used to be numerical fields where some of the values would be a 0. The WTA has repaced these 0's with *empty fields*. Consider a player who has values for every field: 1 (1) WOZNIACKI, CAROLINE DEN 9930 23 470 200 280 200 The various fields are in order, This week's ranking, Last week's ranking, Name, Nationality, Total ranking points, Events played, Points earned last week, Points coming off the rankings for next week, Points earned in 16th-best result, and Points earned in 17th-best result. Now it's fairly obvious that not everybody plays every week, so there are going to be players with 0's in either the points earned last week field or the points coming off the rankings (the rankings are a rolling 52-week system, so this field is the number of points the player earned in the same calendar week last year). Also, there are players who haven't played 16 events and so have a 0 for the 16th or 17th result. In the past, such fields would have an actual 0, which makes parsing the PDF easy. Now, those are blank fields. In a PDF file, it's visually obvious which fields are empty: http://www.wtatennis.com/SEWTATour-Archive/Rankings_Stats/Singles_Numeric.p df However, copying to text gets rid of these empty fields, making the old Perl script I used now useless. If you download the ~140KB PDF, you'll see that #3 Zvonareva and #11 Peer each have one field (and they're different for the two players) that would have a 0, but when copied to a text file, you get these results: 3 (3) ZVONAREVA, VERA RUS 7815 20 320 125 60 11 (11) PEER, SHAHAR ISR 3030 22 60 60 60 You can't tell which field would have had the 0. (And if you look far enough down the rankings, wait until you get to #172 Sloane Stephens, who has exactly 16 events, which means she's got a 0 for the 17th tournament, but this particular week has an event added but none coming off the rankings.) Any good idea on how to get around this? I presume there's a PDF-parsing module, but I don't do all that much Perl programming, limiting myself to text parsing, regexes and a bit more, so I'm not very good with modules. (Many years ago, the WTA rankings used to be fixed-with text files. Boy do I miss those days.) -- Ted S. fedya at hughes dot net Now blogging at http://justacineast.blogspot.com ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Changing Subject color using MIME::Lite
The limitation is the MIME protocol, not the Perl module. So the answer is still no. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of A F Sent: Sunday, August 22, 2010 1:31 PM To: Howard Tanner Cc: perl-win32-users@listserv.ActiveState.com Subject: Re: Changing Subject color using MIME::Lite Is there any other mail module that allows that? _ From: Howard Tanner tan...@optonline.net To: A F perl95...@yahoo.com Sent: Fri, August 20, 2010 2:13:30 PM Subject: RE: Changing Subject color using MIME::Lite No. You can’t change the color of the subject since it’s text only, not marked up like HTML or RTF. Typically, highlighting of subjects is done with asterisks, as in “*** SPAM”. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of A F Sent: Friday, August 20, 2010 4:53 PM To: perl-win32-users@listserv.ActiveState.com Subject: Changing Subject color using MIME::Lite Hi All, Is there a way to make the subject (not the body) of the email sent by MIME::Lite in different color like red or something? sub sendmail { my ($to,$cc,$subject,$data) = @_; my $msg = MIME::Lite-new( From ='$from, To =$to, Bcc=$cc, Subject =$subject, Type ='text/html', Data =$data ); $msg-add('X-Priority' = 1); $msg-send('smtp',$mailhost,Debug=0); } Thanks A. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: TaskScheduler and Win32::OLE
Sorry, I don't have a Windows 2003 Server to test this on. However, I do have an XP virtual machine, and schtasks is indeed available, although the /XML option is not. So if XML isn't available on Win2K3, use a different format, like CSV. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Brzezinski, Paul J Sent: Saturday, April 03, 2010 10:55 AM To: Howard Tanner Cc: perl-win32-users@listserv.activestate.com Subject: RE: TaskScheduler and Win32::OLE Respectively, XML might be an option for Vista and above, but I'm talking about W2K3 server. Yes, I should have stated I looked at the WMI method and dismissed that because it only gets the tasks added to the system via the AT command. The OLE objects are different between W2K3/XP and older vs. Vista/Win7/W2K8 and up, when I realized this I stopped trying to figure out the TaskLibrary 1.1 interface. I'm looking to be able to do this in-process instead of any kind of shell-out to launch schtasks. My original issue still stands. I would like to get all the configured tasks, finding any that contain a pattern in the task name and then display all/any details I can about those tasks. -- Paul J. Brzezinski Integration Engineering - GM HP Enterprise Services From: Howard Tanner [mailto:tan...@optonline.net] Sent: Friday, April 02, 2010 10:41 PM To: Brzezinski, Paul J Cc: perl-win32-users@listserv.activestate.com Subject: RE: TaskScheduler and Win32::OLE There is no OLE object to work with tasks created by the Scheduled Tasks Wizard (the Win32_ScheduledJob object in WMI only works with tasks scheduled with AT). You can, however, use the schtasks command to produce a list of all scheduled tasks and then walk that list. schtasks can produce the output in several formats, xml probably being the most useful for your purposes. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Brzezinski, Paul J Sent: Friday, April 02, 2010 10:05 PM To: perl-win32-users@listserv.activestate.com Subject: TaskScheduler and Win32::OLE I'm trying to use Win32::OLE to access the TaskScheduler [on Win2K3]. I would like to get all the configured tasks, finding any that contain a pattern in the task name and then display all/any details I can about those tasks. I'm using OleView.exe to look at the SCHEDULERLib (Scheduler 1.0 Type Library). Schedule: Scheduler.EnumTask: CLSSID: {056ADD67-DDB0-47BE-9F7D-DC652206F766} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0x139e35c) 1.0\ = Scheduler 1.0 Type Library Scheduler.Schedule: CLSSID: {4EF17F94-3975-4ACF-B228-29485BDE5860} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0x13bb3cc) 1.0\ = Scheduler 1.0 Type Library Scheduler.Task: CLSSID: {3AEC7772-2766-4C67-8487-4189C55DDE4E} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0x13bb45c) 1.0\ = Scheduler 1.0 Type Library Scheduler.Trigger: CLSSID: {D8D9EEBC-0640-47AC-84FF-97C3A6B2FC79} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0xdc6ff4) 1.0\ = Scheduler 1.0 Type Library I have to say I'm quite lost and have reviewed Jan Dubois' doco on Win32::OLE but just haven't been able to understand it well enough. use Win32::OLE qw(in); $obj = Win32::OLE-new(Scheduler.Schedule) or die Error OLE:.Win32::OLE-LastError(); $obj-Reset; $obj-Activate; foreach $tsk (in $obj-Invoke( 'EnumAllTask')) { # print $tsk-Name, \n; # this generates an error my %NAMES; my @props = map { $_-{Name} } ( in $tsk-{Properties_} ); print Props = , join( , , @props), \n; } # no output is produced -- Paul J. Brzezinski Integration Engineering - GM HP Enterprise Services ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: TaskScheduler and Win32::OLE
There is no OLE object to work with tasks created by the Scheduled Tasks Wizard (the Win32_ScheduledJob object in WMI only works with tasks scheduled with AT). You can, however, use the schtasks command to produce a list of all scheduled tasks and then walk that list. schtasks can produce the output in several formats, xml probably being the most useful for your purposes. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Brzezinski, Paul J Sent: Friday, April 02, 2010 10:05 PM To: perl-win32-users@listserv.activestate.com Subject: TaskScheduler and Win32::OLE I'm trying to use Win32::OLE to access the TaskScheduler [on Win2K3]. I would like to get all the configured tasks, finding any that contain a pattern in the task name and then display all/any details I can about those tasks. I'm using OleView.exe to look at the SCHEDULERLib (Scheduler 1.0 Type Library). Schedule: Scheduler.EnumTask: CLSSID: {056ADD67-DDB0-47BE-9F7D-DC652206F766} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0x139e35c) 1.0\ = Scheduler 1.0 Type Library Scheduler.Schedule: CLSSID: {4EF17F94-3975-4ACF-B228-29485BDE5860} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0x13bb3cc) 1.0\ = Scheduler 1.0 Type Library Scheduler.Task: CLSSID: {3AEC7772-2766-4C67-8487-4189C55DDE4E} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0x13bb45c) 1.0\ = Scheduler 1.0 Type Library Scheduler.Trigger: CLSSID: {D8D9EEBC-0640-47AC-84FF-97C3A6B2FC79} TypeLib: {C83F84A8-241A-4837-A6BA-1C5131141743} Library: Win32::TieRegistry=HASH(0xdc6ff4) 1.0\ = Scheduler 1.0 Type Library I have to say I'm quite lost and have reviewed Jan Dubois' doco on Win32::OLE but just haven't been able to understand it well enough. use Win32::OLE qw(in); $obj = Win32::OLE-new(Scheduler.Schedule) or die Error OLE:.Win32::OLE-LastError(); $obj-Reset; $obj-Activate; foreach $tsk (in $obj-Invoke( 'EnumAllTask')) { # print $tsk-Name, \n; # this generates an error my %NAMES; my @props = map { $_-{Name} } ( in $tsk-{Properties_} ); print Props = , join( , , @props), \n; } # no output is produced -- Paul J. Brzezinski Integration Engineering - GM HP Enterprise Services ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: execute script
Check out smbpasswd. And by the way, google is your friend. Try that first before looking for help on a mailing list. -Original Message- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl- win32-users-boun...@listserv.activestate.com] On Behalf Of bigthepaco Sent: Wednesday, March 24, 2010 11:21 AM To: perl-win32-users@listserv.ActiveState.com Subject: execute script Hi, I need your help. I must develop a script to change periodically all local administrator passwords of about 1000 clients of my LAN (NT domain). I'd like to do it with Perl. I'd like to develop with a Linux box, but it's not possible ok, I can do it on Windows. Can I do it on Linux box? Is this a problem? Have you some script (examples) similar to this? Is a problem if I don't know old passwords? Of course I'm LAN administrator and then I know domain password admin. Thank you very much ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Determining if a file is open
An easier solution is to try to open the file exclusively. If it fails, one of the errors will be unable to obtain the exclusive lock (because the file is open already). From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Steve Howard (PFE) Sent: Thursday, February 18, 2010 10:34 AM To: Jason Lowder; perl-win32-users@listserv.ActiveState.com Subject: RE: Determining if a file is open Excuse me for being in a rush and not having time to develop a sample, but I think what you want to do can be determined using WMI, in the CIM_Datafile class, there is a property named InUseCount: http://msdn.microsoft.com/en-us/library/aa387236(VS.85).aspx http://www.slideshare.net/ddn123456/win32-perl-wmi (Haven't checked that one out, but it says it is an introduction to using Perl and WMI) http://forums.cacti.net/about5816.html (Contains an example of using WMI in Perl). Almost all properties of windows objects can be found in some WMI class. You can also connect to remote machines and run WQL queries against those machines, so it is not just for local machines. If needed, I'll see if I can provide an example when I get off work today. Hopefully, this gets you going in the right direction. From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Jason Lowder Sent: Thursday, February 18, 2010 7:20 AM To: perl-win32-users@listserv.ActiveState.com Subject: Re: Determining if a file is open And yes, this is under Windows. (Vista) Jason On 2/18/2010 8:38 AM, Jason Lowder wrote: Hello, Is there anyway to determine if a file is currently open by another process? I want to look at a file that is being generated by another program (sometimes a very large file) and determine when it is finally closed. I see the file attributes for things like size, owner, type etc. but nothing to really determine it's state. Thanks, Jason ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2693 - Release Date: 02/17/10 01:35:00 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs