Jump to content

Send command arguments to running script


Go to solution Solved by orbs,

Recommended Posts

Is it possible to send argument to already running script, I'll try to explain as I can, 

I create some CUI script to write something to console and idle if nothing to write, I want when I execute the same script with some argument script will not start the second instance instead the first instance  will take the argument and then write the argument to console

- script.exe (instance 1) running and idle

- then I run the script.exe again with argument

- instead script.exe (instance 2) running, I want script.exe (instance 1) write argument to the console,

is this posibble?

Thanks,

Link to comment
Share on other sites

  • Solution

this has been discussed many times, lately here:

'?do=embed' frameborder='0' data-embedContent>>

and here:

'?do=embed' frameborder='0' data-embedContent>>

in short: you can do some kind of IPC. for your example, i'd go for quick and dirty, like in the 1st link above.

script is launched:

option 1) with arguments. script writes a file with the arguments and exits.

option 2) without arguments: script runs and remains idle, waiting for a file with arguments. when such file exists, script processes the arguments.

 

if you prefer a more elegant way, check out the 2nd link above.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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