Jump to content

Recommended Posts

Posted

Hi all,

I'm pretty new with AutoIT and scripting in general.

I'm using this tool to type in extensive queries into a program (ADP Drive, Automotive industry) and the queries generate reports.

The problem is that these long queries used quotes, parenthesies and other odd characters.  I also need to be able to dump a really long power shell command, that has the same issue.

Rather than typing out a Send ("giant command string here") is there a way to make it call the contents of a text file and have that text file contain the huge string?   And hopefully it dump the contents of the text file verbatim?

One of the powershell strings I need to issue is:

(gc C:adpautomationhondaaaxoutputsHTO_Accounting.csv) | % {$_ -replace '"', ""} | out-file C:adpautomationhondaaaxoutputspowershellconvertedHTO_Accounting.csv -Fo -En ascii

Any help is greatly appreciated!!

-g

Posted (edited)

You just need to know when to double up on the quotes...output them to the console for debugging...2 ways to do the same output:

output:

$string = '(gc C:\adpautomation\honda\aax\outputs\HTO_Accounting.csv) | % {$_ -replace ''"'', ""} | out-file C:\adpautomation\honda\aax\outputs\powershellconverted\HTO_Accounting.csv -Fo -En ascii'
ConsoleWrite($string & @CRLF)

$string = "(gc C:\adpautomation\honda\aax\outputs\HTO_Accounting.csv) | % {$_ -replace '""', """"} | out-file C:\adpautomation\honda\aax\outputs\powershellconverted\HTO_Accounting.csv -Fo -En ascii"
ConsoleWrite($string & @CRLF)

(gc C:adpautomationhondaaaxoutputsHTO_Accounting.csv) | % {$_ -replace '"', ""} | out-file C:adpautomationhondaaaxoutputspowershellconvertedHTO_Accounting.csv -Fo -En ascii

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...