From: "Rosenstein, Leon" <[EMAIL PROTECTED]> > The code: > #Ok we have renamed the files now we need to run the expand command: > system("expand perfc009.DA_ %windir%\\system32\\perfc009.DAT") && die > "no $!"; > > and when I run I get it: > > C:\Perf>perl -w maintest.pl.txt > Microsoft (R) File Expansion Utility Version 5.00.2134.1 > Copyright (C) Microsoft Corp 1990-1999. All rights reserved. > > Expanding perfc009.da_ to %windir%\system32\perfc009.dat. > Can't open output file: %windir%\system32\perfc009.dat. > > no at maintest.pl.txt line 5. > > My first question is; did I do the right thing by putting a \ before > the \ in the path?
Yes. > My second question is whether or not the % sign is > messing things up? It seems the %variable% was not espanded to the path. What version or Perl are you using? (run perl -v to find out). It's safer to let Perl expand the variable: system("expand perfc009.DA_ $ENV{windir}\\system32\\perfc009.DAT") HTH, Jenda P.S.: You should use something better than Notepad to edit your scripts. And save them with .pl extension, not with .pl.txt. See eg. http://www.scintilla.org/SciTE.html ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]