Passing parameter into iM from batch file

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Passing parameter into iM from batch file

by ABob on Mon Mar 27, 2017 6:25 pm

Hi!
I'm trying to use iMacros to pass information from one system to another.
I have a process that uses a .bat to launch iMacros, such as;

"C:\Program Files (x86)\Ipswitch\iMacros\imacros.exe" -macro test.iim

then, in the .iim it specifies the input file;

SET !DATASOURCE C:\iMacros\test.csv

This works fine, but i have the issue where there may be multiple output files.
I need to be able to run the macro and specify the input file so i'm getting the correct data.
I now have a timestamp, (ie ddMMyyhhmmss) on the input file's filename (to make sure its unique in windows).

I would like to be able to pass the filename into iMacros from the .bat.
So, pass in "C:\iMacros\test28032017120000.csv" as a parameter, so iMacros will pick up the correct .csv.

System information;
Server - Server2012r2 x64 with ie11 (this is likely where this process will end up)
Desktops - Win10 x64 with FF52.
iMacros is currently a trial version v11.5

Thanks for any help,
ABob
 
Posts: 1
Joined: Sat Mar 18, 2017 9:19 pm

Re: Passing parameter into iM from batch file

by chivracq on Mon Mar 27, 2017 6:43 pm

ABob wrote:Hi!
I'm trying to use iMacros to pass information from one system to another.
I have a process that uses a .bat to launch iMacros, such as;

Code: Select all
 "C:\Program Files (x86)\Ipswitch\iMacros\imacros.exe" -macro test.iim


then, in the .iim it specifies the input file;
Code: Select all
SET !DATASOURCE C:\iMacros\test.csv


This works fine, but i have the issue where there may be multiple output files.
I need to be able to run the macro and specify the input file so i'm getting the correct data.
I now have a timestamp, (ie ddMMyyhhmmss) on the input file's filename (to make sure its unique in windows).

I would like to be able to pass the filename into iMacros from the .bat.
So, pass in "C:\iMacros\test28032017120000.csv" as a parameter, so iMacros will pick up the correct .csv.

System information;
Code: Select all
Server - Server2012r2 x64 with ie11  (this is likely where this process will end up)
Desktops -  Win10 x64 with FF52.
iMacros is currently a trial version v11.5


Thanks for any help,

Yep, simply use the '-var_' Switch when launching the iMB '.EXE'... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to General Support & Discussions

Who is online

Users browsing this forum: Bing [Bot] and 6 guests

-->