CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Problem passing parameters from DOS command line under Windows 7

 



bkimelman
Novice

Mar 15, 2010, 8:02 PM

Post #1 of 8 (1385 views)
Problem passing parameters from DOS command line under Windows 7 Can't Post

My OS is Windows 7 Home Professional 64 bit.

My version of Perl is v5.10.1 built for MSWin32-x64-multi-thread

When I run perl scripts from the command line of a DOS window the parameters don't seem to be passed through. my script checks the number of parameters and it received zero parameters even though I passed in several as follows:

script.pl -p pattern source_dir dest_dir

Any ideas as to the nature of the problem ?


FishMonger
Veteran / Moderator

Mar 16, 2010, 5:24 AM

Post #2 of 8 (1377 views)
Re: [bkimelman] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

The .PL file type association is not setup correctly.

The Open action should look like this (adjust the path if needed):

Quote
"C:\Perl\bin\perl.exe" "%1" %*

The "%1" %* portion is what tells it to accept arguments.


(This post was edited by FishMonger on Mar 16, 2010, 5:24 AM)


bkimelman
Novice

Mar 16, 2010, 3:19 PM

Post #3 of 8 (1368 views)
Re: [FishMonger] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

Thanks for the quick reply. However Windows 7 doesn't seem to have any way of settting an "open action". It just seems only to be able to associate a program with a file type and that's it.

Any ideas ?


FishMonger
Veteran / Moderator

Mar 16, 2010, 3:38 PM

Post #4 of 8 (1366 views)
Re: [bkimelman] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

This shows you how.

http://www.winvistaclub.com/t19.html


bkimelman
Novice

Mar 16, 2010, 5:37 PM

Post #5 of 8 (1363 views)
Re: [FishMonger] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

I have already tried the solution on the webpage you indicated. When I get to the "Open With" screen there is now way to specify the "Open Action". I have tried clicking and right clicking everywhere on that screen and no luck.

Any other ideas ?


FishMonger
Veteran / Moderator

Mar 16, 2010, 6:17 PM

Post #6 of 8 (1358 views)
Re: [bkimelman] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

I don't use Windows 7, so I can't troubleshoot that end, other than point you to online resources that I can find via google.

Which perl port are you using?

If you use Activestate and choose the defaults during the install, it will correctly setup the file association.


bkimelman
Novice

Mar 16, 2010, 6:29 PM

Post #7 of 8 (1354 views)
Re: [FishMonger] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

I have already done much searching with google and plan to do yet more. I am using perl, v5.10.1 built for MSWin32-x64-multi-thread. I am using Activestate and I did accept all the defaults but somehow this win 7 version seems to have an issue with setting up parameter passing.


FishMonger
Veteran / Moderator

Mar 16, 2010, 7:52 PM

Post #8 of 8 (1347 views)
Re: [bkimelman] Problem passing parameters from DOS command line under Windows 7 [In reply to] Can't Post

At this point, I'm not sure how to direct you. I've never had the problem of not being able to manually configure the file type association, but I've never worked with Windows 7 and I don't think I want to.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives