1

I need wanted to use a % as an argument for a command I am running in WiseScript Wise Package Studio. using a double percent such as %% doesn't seem to work.

I verified this command works great from the command prompt:

WMIC PRODUCT WHERE "Name LIKE '%Adobe%'" GET Name, Version>"%INSTPATH%\appwizcheck.txt"

But when I put it in wise:

item: Execute Program
  Pathname=cmd.exe
  Command Line=WMIC PRODUCT WHERE "Name LIKE '%Adobe%'" GET Name, Version>"%INSTPATH%\appwizcheck.txt"
  Flags=00001010
end

I receive an error because it is parsing it as a variable. I understand I need to escape it as a literal, but how?

Note: I really want to avoid using an external .bat file etc. for this exe, so please do not advise working around the problem that way.. thanks!

Dave
  • 1,823
  • 2
  • 16
  • 26

1 Answers1

1

turned out I forgot the /c but the double %% was correct:

item: Execute Program
  Pathname=cmd.exe
  Command Line=/c WMIC PRODUCT WHERE "Name LIKE '%%Adobe%%'" GET Name, Version>"%INSTPATH%\appwizcheck.txt"
  Flags=00001010
end
Dave
  • 1,823
  • 2
  • 16
  • 26