RE: drag'n'drop onto desktop icon ???
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Linderman Sent: May 30, 2005 3:08 PM To: Ken Cornetet Cc: perl-win32-users mailing list; Michael D Schleif Subject: Re: drag'n'drop onto desktop icon ??? [snip] Jack's solution may be best of all, but it gets into magic hex strings and object IDs, which most people don't understand. And although I don't know for sure what he means by any icon with the .pl extension, since icons have .ico extensions, I'm guessing that what he means is that any file with the .pl extension, displayed in Windows Explorer as an icon in a file listing, can then be dropped to. I don't profess to understand it either :-) (if I did - I would definitely be in the wrong profession) I'll probably screw up this explanation too - but here goes. A desktop icon is linked to either a file/program/folder or a shortcut to a file/program/folder. So if we assume that the .pl extension is linked to perl.exe - and the file/program that the icon *represents* has a .pl extension, then any files dropped onto this icon will have their associated full pathnames available in @ARGV of the associated perl script. The class ID I used is the .exe drop handler which is somehow linked magically to shell32.dll. The same handler is used for the following classes: - batfile, cmdfile, comfile, exefile, piffile, scrfile, shcmdfile All my script did was to add it to the perlfile class too. Bills solution effectively does the same thing but through the batfile class. Of course Glenn is correct that with this new handler, a perl program within a file/folder listing in windows explorer will also accept a drop. This makes sense as the desktop is just a folder itself .. J. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: drag'n'drop onto desktop icon ???
-Original Message- From: Jack D. [mailto:[EMAIL PROTECTED] Sent: May 30, 2005 11:57 PM To: 'perl-win32-users mailing list' Subject: RE: drag'n'drop onto desktop icon ??? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Linderman Sent: May 30, 2005 3:08 PM To: Ken Cornetet Cc: perl-win32-users mailing list; Michael D Schleif Subject: Re: drag'n'drop onto desktop icon ??? [snip] Jack's solution may be best of all, but it gets into magic hex strings and object IDs, which most people don't understand. And although I don't know for sure what he means by any icon with the .pl extension, since icons have .ico extensions, I'm guessing that what he means is that any file with the .pl extension, displayed in Windows Explorer as an icon in a file listing, can then be dropped to. I don't profess to understand it either :-) (if I did - I would definitely be in the wrong profession) I'll probably screw up this explanation too - but here goes. A desktop icon is linked to either a file/program/folder or a shortcut to a file/program/folder. So if we assume that the .pl extension is linked to perl.exe - and the file/program that the icon *represents* has a .pl extension, then any files dropped onto this icon will have their associated full pathnames available in @ARGV of the associated perl script. The class ID I used is the .exe drop handler which is somehow linked magically to shell32.dll. The same handler is used for the following classes: - batfile, cmdfile, comfile, exefile, piffile, scrfile, shcmdfile All my script did was to add it to the perlfile class too. Bills solution effectively does the same thing but through the batfile class. Of course Glenn is correct that with this new handler, a perl program within a file/folder listing in windows explorer will also accept a drop. This makes sense as the desktop is just a folder itself .. J. Oops - I forgot - one last thing. Indeed it *is* the short names which are dropped. Put this script in a file on your desktop and drop stuff to see the arguments. ### use Tk; my $mw=tkinit; my $t=$mw-Scrolled('Text')-pack; $t-insert('end',$_\n) for (@ARGV); $t-see('end') MainLoop; ### J. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Win32::NetAdmin Module.
Hi all, My Requirement is to list all user names in domain with pw hash. I am using following script to get the same. == use Win32::NetAdmin qw(GetUsers GroupIsMember UserGetAttributes UserSetAttributes); my %hash; GetUsers(, FILTER_NORMAL_ACCOUNT , \%hash) or die GetUsers() failed: $^E; foreach (keys %hash) { my ($password, $passwordAge, $privilege, $homeDir, $comment, $flags, $scriptPath); if (GroupIsMember(, Domain Users, $_)) { UserGetAttributes(, $_, $password, $passwordAge, $privilege,$homeDir,$comment,$flags, $scriptPath); print $_ = $password,$homeDir\n; } } I am getting user name and other attribute like homeDir but not password. Can you please help me to figure out the problem? Thanks in advance, Mallika. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Win32::NetAdmin Module.
I think this is just a placeholder variable in this function. You cannot retrieve actual passwords with this module (or anything else that I'm aware of in Windows). You can, however, set a password with the UserSetAttributes function in the same module (provided you have perms). == use Win32::NetAdmin qw(GetUsers GroupIsMember UserGetAttributes UserSetAttributes); my %hash; GetUsers(, FILTER_NORMAL_ACCOUNT , \%hash) or die GetUsers() failed: $^E; foreach (keys %hash) { my ($password, $passwordAge, $privilege, $homeDir, $comment, $flags, $scriptPath); if (GroupIsMember(, Domain Users, $_)) { UserGetAttributes(, $_, $password, $passwordAge, $privilege,$homeDir,$comment,$flags, $scriptPath); print $_ = $password,$homeDir\n; } } I am getting user name and other attribute like homeDir but not password. Can you please help me to figure out the problem? ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Script printing its own source code
Title: RE: Script printing its own source code 1) H. . . Did you chomp? 2) I don't think there's any problem at all with a script opening itself as a text file. Keep in mind that when it's running it's been interpreted and is in memory (so no file sharing issue). It could, of course, destroy or modify itself. Whether you think that's a good thing or not depends on the purpose and methods of your script. Sam Gardner GTO Application Development Keefe, Bruyette Woods, Inc. 212-887-6753 -Original Message- From: Ted Schuerzinger [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 28, 2005 1:05 PM To: Perl Mailing List Subject: Script printing its own source code Over on rec.puzzles on Usenet ([EMAIL PROTECTED]), somebody posted a puzzle asking about using programming languages to print out a program's own source code. So, I quickly whipped up the following 11-line script in Perl: snip #! perl -w use strict; my $selfprint=c:/scripts/selfprint.pl; open SELFPRINT, $selfprint or die Cannot open $selfprint for read :$!; while (SELFPRINT) { print; } /snip I opened up the DOS prompt in Windows 98, and ran the script. The result was the following: snip Microsoft(R) Windows 98 (C)Copyright Microsoft Corp 1981-1999. C:\WINDOWScd\scripts C:\scriptsperl selfprint.pl #! perl -w use strict; my $selfprint=c:/scripts/selfprint.pl; open SELFPRINT, $selfprint or die Cannot open $selfprint for read :$!; while (SELFPRINT) { print; } C:\scripts /snip Two questions: 1) When the script prints itself out, it prints an extra blank line before giving me the command line again. (I've got the script open in my text editor, set to show line numbers, and there are definitely only 11 lines.) Where's the blank line coming from? 2) Is it really a good idea for a script to be allowed to open itself? I don't know if I want to try having a script open itself for write, even if only to see what would happen. :-) -- Ted Schuerzinger, [EMAIL PROTECTED] ___ 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: Script printing its own source code
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 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 Gardner, Sam Sent: Tuesday, May 31, 2005 1:58 PM To: '[EMAIL PROTECTED]'; Perl Mailing List Subject: RE: Script printing its own source code *** WARNING : This message originates from the Internet *** 1) H. . . Did you chomp? 2) I don't think there's any problem at all with a script opening itself as a text file. Keep in mind that when it's running it's been interpreted and is in memory (so no file sharing issue). It could, of course, destroy or modify itself. Whether you think that's a good thing or not depends on the purpose and methods of your script. Sam Gardner GTO Application Development Keefe, Bruyette Woods, Inc. 212-887-6753 -Original Message- From: Ted Schuerzinger [ mailto:[EMAIL PROTECTED]] Sent: Saturday, May 28, 2005 1:05 PM To: Perl Mailing List Subject: Script printing its own source code Over on rec.puzzles on Usenet ([EMAIL PROTECTED]), somebody posted a puzzle asking about using programming languages to print out a program's own source code. So, I quickly whipped up the following 11-line script in Perl: snip #! perl -w use strict; my $selfprint=c:/scripts/selfprint.pl; open SELFPRINT, $selfprint or die Cannot open $selfprint for read :$!; while (SELFPRINT) { print; } /snip I opened up the DOS prompt in Windows 98, and ran the script. The result was the following: snip Microsoft(R) Windows 98 (C)Copyright Microsoft Corp 1981-1999. C:\WINDOWScd\scripts C:\scriptsperl selfprint.pl #! perl -w use strict; my $selfprint=c:/scripts/selfprint.pl; open SELFPRINT, $selfprint or die Cannot open $selfprint for read :$!; while (SELFPRINT) { print; } C:\scripts /snip Two questions: 1) When the script prints itself out, it prints an extra blank line before giving me the command line again. (I've got the script open in my text editor, set to show line numbers, and there are definitely only 11 lines.) Where's the blank line coming from? 2) Is it really a good idea for a script to be allowed to open itself? I don't know if I want to try having a script open itself for write, even if only to see what would happen. :-) -- Ted Schuerzinger, [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs File: ATT5659778.txt The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective investment schemes and pension products and advises only on the Marketing Group's range of these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Script printing its own source code
... called quines ... And, in perl, one of the most amazing quine programs is Damian Conway's SelfGol. It's also the game of Life and a quine-izer for other programs - don't even think about looking at it. http://libarynth.f0.am/cgi-bin/twiki/view/Libarynth/SelfGOL I had the good fortune to sit in a nice enough bar, drinking beer (not the best idea considering) while he char by char worked his way through the script (it was an obfusticated perl submission). He includes evil things like stray parens/curlies so vi's '%' won't help you de-parse it and, even at a merer 1000 chars, managed to slip in useless code just to further befuddle. It was beyond humbling, made you want to give up even typing on a computer and go back to banging rocks and sticks together. a Andy Bach, Sys. Mangler Internet: [EMAIL PROTECTED] VOICE: (608) 261-5738 FAX 264-5932 self-reference, n. - See self-reference ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl-Win32-Users Digest, Vol 16, Issue 31
Bill, Thanks for your suggestions I have tried them both. I am getting a new error now. Invocation line: perl test_unzip_file.pl N:\test N:\test\uploaded password *.zip Script: local $sourcedir; local $destdir; local $password; local $newfile; unzipfiles(); sub unzipfiles { $sourcedir = shift (@ARGV); $destdir = shift (@ARGV); $password = shift (@ARGV); $newfile = glob (@ARGV); my @filelist = `C:\\WINNT\\system32\\CMD.exe /C dir /b $sourcedir\\$newfile`; I get this message for the every time these variables are mentioned: Global symbol $sourcedir requires explicit package name at test_unzip_file.pl line 16. Global symbol $destdir requires explicit package name at test_unzip_file.pl line 17. Global symbol $password requires explicit package name at test_unzip_file.pl line 18. Global symbol $newfile requires explicit package name at test_unzip_file.pl line 19. Global symbol $sourcedir requires explicit package name at test_unzip_file.plline 25. Global symbol $destdir requires explicit package name at test_unzip_file.pl line 26. Global symbol $password requires explicit package name at test_unzip_file.pl line 27. Global symbol $newfile requires explicit package name at test_unzip_file.pl line 28. Global symbol $sourcedir requires explicit package name at test_unzip_file.plline 43. Global symbol $newfile requires explicit package name at test_unzip_file.pl line 43. Execution of test_unzip_file.pl aborted due to compilation errors. Thanks, Liza -Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Monday, May 30, 2005 5:55 PM To: Liza Das Cc: perl-win32-users@listserv.ActiveState.com Subject: Re: Perl-Win32-Users Digest, Vol 16, Issue 31 Liza Das wrote: To the experts, I have an existing script to unzip encrypted files that I wasn't passing any variables to. I am now modifying it to pass it different values so that it can be used by anyone, instead of hardcoding the information. In the below excerpt, I'm populating my variables then trying to get a list of all the files from the path I pass to it. The problem is the @filelist. The dir command is not working and I get the following message: The filename, directory name, or volume label syntax is incorrect. The @filelist should show me: xxx.ZIP xxx.ZIP $sourcedir = shift (@ARGV); $destdir = shift (@ARGV); $password = shift (@ARGV); $newfile = glob (@ARGV); # my @filelist = `dir `.$sourcedir.$newfile.` /b`; my @filelist = `dir .$sourcedir.$newfile. /b`; # dir N:\Test\*.ZIP /b # Assuming : use strict; use warnings; # Assuming for example : my $sourcedir = 'c:\temp'; my $newfile = '*.txt'; # or similar. This may work: my @filelist = `dir /b $sourcedir\\$newfile`; # if not, try this: my @filelist = `D:\\windows\\system32\\cmd.exe /C dir /b $sourcedir\\$newfile`; What does your invocation line look like ? -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /-- o // // Castle of Medieval Myth Magic http://www.todbe.com/ -/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
auditing shutdowns for win2000
hi all, i'm trying to write the simplest program to log win2000 activity - first step is distinguish between graceful vs. non graceful shutdowns. is there a way to write something in a file during the event of a shutdown? Or rather can i write something in a file that is guaranteed to be there as long as there's no ungraceful shutdown and definetely NOT there is an ungraceful shutdown happens? Thanks a lot, Dan __ Do you Yahoo!? Yahoo! Small Business - Try our new Resources site http://smallbusiness.yahoo.com/resources/ ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl-Win32-Users Digest, Vol 16, Issue 31
Replace local with my. And actually you don't even need that since the variables are global. At 03:01 PM 5/31/05 -0400, Liza Das wrote: local $sourcedir; local $destdir; local $password; local $newfile; I get this message for the every time these variables are mentioned: Global symbol $sourcedir requires explicit package name at test_unzip_file.pl line 16. -- REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =-- ...ne cede males 0100 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
list acting up
Has anyone else been getting kicked off the list over and over again? I keep getting suspended for too many bounces but all my other mail seems to be getting here just fine. It's just everything from ActiveState that is causing problems. Now if I don't get any traffic for a couple days I know to go see what's wrong. Do they have the servers set to ultra finicky mode or what... -- REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =-- ...ne cede males 0100 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: list acting up
[EMAIL PROTECTED] wrote: Has anyone else been getting kicked off the list over and over again? I keep getting suspended for too many bounces but all my other mail seems to be getting here just fine. It's just everything from ActiveState that is causing problems. Now if I don't get any traffic for a couple days I know to go see what's wrong. Do they have the servers set to ultra finicky mode or what... Never any real problmes with AS, but a few others I have trouble with. I have one face which the world sees, but the return email is a different one. This has caused me to be able to receive all emails, but on some lists that is all I can do because it will always come back and say I am not part of the list. Have talked w/ different list moderators, but have not been able to clear it up. Wags *** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. *** ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
PalmOS Outlook sync?
Does anyone know of a module out there that does a PalmOS to Outlook HotSync? Searching cpan, it looks like there are several Palm modules and several Outlook modules, but not necessarily one to act as a conduit and to synchronize them. Certainly seems do-able but I didn't want to reinvent this wheel if I could help it. Thanks ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: A question about Win32:OLE!
Thanks for you guys' help! I have a application installed on my system. I can start the application by using: my $app = Win32::OLE-GetActiveObject('Aaa.Bbb'); The problem is that I cannot find Aaa.Bbb in OLE/COM Object Viewer or OLE-Browser. I did a thorough search! Another question is: How do I shut the application down? On 5/31/05, Steven Manross [EMAIL PROTECTED] wrote: Well, the registry is a good place to start... (HKCR) It has all the ProgIDs that are installed on your system... Then, the OLE-Browser would help you find out what methods are available to you with that particular ProgID. Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J aperlh Sent: Sunday, May 29, 2005 7:09 PM To: perl-win32-users@listserv.ActiveState.com Subject: A question about Win32:OLE! A question about Win32:OLE! Where can I get the program ID of an application? Get it from OLE/COM Object Viewer or something else? my $app = Win32::OLE-new('Word.Application', 'Quit'); ___ 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: list acting up
Chris Wagner graced perl with these words of wisdom: Has anyone else been getting kicked off the list over and over again? I keep getting suspended for too many bounces but all my other mail seems to be getting here just fine. It's just everything from ActiveState that is causing problems. Now if I don't get any traffic for a couple days I know to go see what's wrong. Do they have the servers set to ultra finicky mode or what... I've been kicked off a couple of times already, and the last few times I posted, nobody else seemed to have the same problem. It's nice to see finally that I'm not the only person to have experienced this. -- Ted fedya at bestweb dot net TV Announcer: It's 11:00. Do you know where your children are? Homer: I told you last night, *no*! http://www.snpp.com/episodes/4F06.html ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs