So I was doing a development project for my work and basically the idea is that we have a Excel VBA macro that needs to do some parsing of files, create a new file and send the file location to a Unix script running on the mainframe.
The location of the file is different every time you run the macro and thanks to Samba, I can create the file in Windows and it is immediately accessible to the Unix system.
Now the problem arises: how can I pass in the location of the file. The issue is a program called plink (which is a version of putty that allows configuration file to sit alongside the program itself rather than in the registry of PC) is the only approved option to do this work (I know Cgywin would do this quite easily) and the program sits on a network drive with multiple people would probably need to run it concurrently. The authorized_keys file has a exec to point to the Unix script that needs to run and for security reasons, I can not change that. However I can write a script in Unix to take the unnamed parameter and use it to run the script that only takes the parameter (file location) as a named parameter (--file=/directory/datafile).
I tried to run that script with (in cmd) plink.exe serverIP /directory/datafile (the login is already configured) but apparently the parameter could not get passed in this way.
I have also tried plink.exe serverIP "/directory/datafile" and there is no luck there as well.
I am just wondering if there is a short and neat way to get this done. We had a sample project with the similar configuration but the script to do this took like 10000 lines which I don't want to read, I sort of believes this should be done in like a short script with 10 or 20 lines. I am free to create whatever Windows script if I need to, provided that I could run multiple sessions of the program with different parameters concurrently.