Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running perl from a batch file in windows 7

Status
Not open for further replies.

robwheeler

Instructor
May 19, 2010
1
GB
I have several perl scripts that run in batch files and which are passed parameters from those files. I have been running them on XP for ages without trouble. Now I have moved them to Windows 7 - exactly the same paths and directory structures and even the same version of perl - suddenly they do not work. The perl scripts run but do not pick up the parameter text from the command line. Any ideas why this might be? Does batch work differently under win7?
 
is it strawberry perl??

See this

even if not I'd check that for activestate perl..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
This comment is strictly from a WinXP perspective (don't personally have Win7) - Anyway with an XP OS that 'knows' *.pl files, under an explorer window you can find tools > folder options > file types > pl - then click 'advanced > open > edit' and examine the syntax. I've found some weirdness (and/or normality for win?) with %1 versus "%1" vs. "%*". Can this be mimicked under Win7?
-OR-
Do *.bat files still work as what could be expected under XP? You can always make a .bat file that effectively has: <path>/perl.exe <your file>.pl "%1" "%*" (please note weird factor above)
 
I know with strawberry perl I have had to manually make that change regardless if it was xp, vista, or 7. But I don't use batch files :)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top