Hello Monks

This worked on Windows XP but is not working on Windows 7.

So, I have a file open in XMetaL and having edited, parsed and saved the file, I need to check internal links are ok. The script "check.pl" does this.

This is from my XMetal Macro:

sub CheckMarkup { # document must be saved unless ($ActiveDocument->{Saved}) { $Application->Alert("Document must be saved before checking"); return; } # document must be valid unless ($ActiveDocument->{IsValid}) { $Application->Alert("Document must be valid before checking (r +un Validate)"); return; } # get the path to this document my $path = $ActiveDocument->{FullName}; # run the check script my $shell = Win32::OLE->new('WScript.Shell'); unless ($shell) { $Application->Alert("Can't make WScript.Shell object"); return; } $shell->Run("I:\\...\\check.bat \"$path\"", 5); }

This is the content of the check.bat file:

perl -w I:\...\xml2sgm.pl %1

perl -w I:\...\check.pl %1

The check.bat file is being found ok, but %1 comes up empty.

It certainly appears Windows 7 is the culprit as nothing else has changed.

Incidentally I: is a mapped drive to our Unix server.

Can anyone help with this problem? Your collective wisdom would be most appreciated.


In reply to perl subroutine in XMetaL macro - $path not being passed to batch file on Windows 7 by spb54

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.