<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Run Program at Login in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007146#M104310</link>
    <description>&lt;P&gt;&amp;gt; [...] to me, it looks like the session is getting it's input from the&lt;BR /&gt;&amp;gt; terminal. [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Most likely, it's getting its input from SYS$INPUT, but the value of&lt;BR /&gt;that logical name depends on your environment.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ show logical sys$input&lt;BR /&gt;&amp;gt; "SYS$INPUT" = "_TNA57506:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&amp;gt; $ show logical sys$command&lt;BR /&gt;&amp;gt; "SYS$COMMAND" = "_TNA57506:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Yup.&amp;nbsp; In an interactive environment, both SYS$INPUT and SYS$COMMAND&lt;BR /&gt;normally point to your (Telnet-connected?) terminal.&amp;nbsp; But, if you stick&lt;BR /&gt;those commands into a DCL script (as I did, above), and execute (@) that&lt;BR /&gt;script, then you'll see that SYS$INPUT is different, and your program&lt;BR /&gt;will try to read its input from the DCL script (SYS$INPUT), not the&lt;BR /&gt;terminal (SYS$COMMAND).&amp;nbsp; Redefining SYS$INPUT to SYS$COMMAND puts things&lt;BR /&gt;back to the way they were when the program was run interactively, with&lt;BR /&gt;SYS$INPUT pointing to your terminal.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; If your program accepts interactive commands, like, say, "help" and&lt;BR /&gt;"exit", then you could write a DCL script which does those:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ run main_user_interactive_program&amp;nbsp; ! Or whatever you do.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; help&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit&lt;BR /&gt;&lt;BR /&gt;Execute (something like) that, and see what happens.&amp;nbsp; Note that DCL&lt;BR /&gt;normally stops reading input from the script when it sees a line&lt;BR /&gt;beginning with "$" (but see HELP DECK for more fine print).&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 20:03:47 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2018-05-25T20:03:47Z</dc:date>
    <item>
      <title>Run Program at Login</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007036#M104306</link>
      <description>&lt;P&gt;I could really use some help with my login procedure.&lt;/P&gt;&lt;P&gt;I added, to the end of my login.com, the command to execute and start our main user interactive program instead of dropping users at the $ to run the command themselves. The program starts okay and prompts the users to login (with program specific credentials) but the keyboard doesn't work. I can't type letters or numbers. I can CTRL+C to get back to the $, run the program again manually and all is fine.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;* Update: Running the program form any com file has the same result, it's not limited to the login.com. I created another com file, all it does is start the program and the result is the same. I can't type my usename.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Any ideas would be greatly appreciated. Even a sample login menu, or something.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 22:43:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007036#M104306</guid>
      <dc:creator>gbarcalow</dc:creator>
      <dc:date>2018-05-24T22:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Run Program at Login</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007046#M104308</link>
      <description>&lt;P&gt;&amp;gt; [...] but the keyboard doesn't work. [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Does your "main user interactive program" get its input from&lt;BR /&gt;SYS$INPUT (C "stdin")?&amp;nbsp; That's defined differently in a DCL script:&lt;BR /&gt;&lt;BR /&gt;ITS $ type test.com&lt;BR /&gt;$ show logical sys$input&lt;BR /&gt;ITS $ @ test.com&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "SYS$INPUT" = "_ITS$DKA1:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; That is, it's the (text in) the DCL script itself (thus, the disk&lt;BR /&gt;device name), not the user's terminal.&amp;nbsp; SYS$COMMAND, on the other hand,&lt;BR /&gt;may be what you want:&lt;BR /&gt;&lt;BR /&gt;ITS $ type test2.com&lt;BR /&gt;$ show logical sys$command&lt;BR /&gt;ITS $ @ test2.com&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "SYS$COMMAND" = "_ITS$FTA411:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; So, in the DCL script, before running your "main user interactive&lt;BR /&gt;program", try:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ define /user_mode sys$input sys$command&lt;BR /&gt;&lt;BR /&gt;(The "/user_mode" option causes this redefinition to evaporate when the&lt;BR /&gt;next executable image (your program) exits.)&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 01:58:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007046#M104308</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2018-05-25T01:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Run Program at Login</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007138#M104309</link>
      <description>&lt;P&gt;First, thank you for your reply. Below are the results of the commands you mentioned. I'm not a VMS person, but to me, it looks like the session is getting it's input from the terminal. But, I put your command in there anyway and&amp;nbsp;voila, it works. You sir are my new hero. 1M thanks to you.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$ show logical sys$input&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"SYS$INPUT" = "_TNA57506:" (LNM$PROCESS_TABLE)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$ show logical sys$command&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"SYS$COMMAND" = "_TNA57506:" (LNM$PROCESS_TABLE)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 19:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007138#M104309</guid>
      <dc:creator>gbarcalow</dc:creator>
      <dc:date>2018-05-25T19:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Run Program at Login</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007146#M104310</link>
      <description>&lt;P&gt;&amp;gt; [...] to me, it looks like the session is getting it's input from the&lt;BR /&gt;&amp;gt; terminal. [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Most likely, it's getting its input from SYS$INPUT, but the value of&lt;BR /&gt;that logical name depends on your environment.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ show logical sys$input&lt;BR /&gt;&amp;gt; "SYS$INPUT" = "_TNA57506:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&amp;gt; $ show logical sys$command&lt;BR /&gt;&amp;gt; "SYS$COMMAND" = "_TNA57506:" (LNM$PROCESS_TABLE)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Yup.&amp;nbsp; In an interactive environment, both SYS$INPUT and SYS$COMMAND&lt;BR /&gt;normally point to your (Telnet-connected?) terminal.&amp;nbsp; But, if you stick&lt;BR /&gt;those commands into a DCL script (as I did, above), and execute (@) that&lt;BR /&gt;script, then you'll see that SYS$INPUT is different, and your program&lt;BR /&gt;will try to read its input from the DCL script (SYS$INPUT), not the&lt;BR /&gt;terminal (SYS$COMMAND).&amp;nbsp; Redefining SYS$INPUT to SYS$COMMAND puts things&lt;BR /&gt;back to the way they were when the program was run interactively, with&lt;BR /&gt;SYS$INPUT pointing to your terminal.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; If your program accepts interactive commands, like, say, "help" and&lt;BR /&gt;"exit", then you could write a DCL script which does those:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ run main_user_interactive_program&amp;nbsp; ! Or whatever you do.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; help&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit&lt;BR /&gt;&lt;BR /&gt;Execute (something like) that, and see what happens.&amp;nbsp; Note that DCL&lt;BR /&gt;normally stops reading input from the script when it sees a line&lt;BR /&gt;beginning with "$" (but see HELP DECK for more fine print).&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 20:03:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007146#M104310</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2018-05-25T20:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Run Program at Login</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007147#M104311</link>
      <description>&lt;P&gt;So, it's only partially working. There are commands inside the program "functions" that pull up different features/utilities. I always thought they look like part of the main program, but now I am guessing they are not, because some of the functions run into the same problem as the login screen. I can login and navigate the program quite a bit, but there are two functions that, once I enter them the keyboard no longer types.&lt;/P&gt;&lt;P&gt;Is there a way to make that command perpetual for the duration of the session instead of just the next command?&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 20:13:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007147#M104311</guid>
      <dc:creator>gbarcalow</dc:creator>
      <dc:date>2018-05-25T20:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Run Program at Login</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007148#M104312</link>
      <description>&lt;P&gt;&amp;gt; [...] There are commands inside the program "functions" that pull up&lt;BR /&gt;&amp;gt; different features/utilities. [...]&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Ok.&amp;nbsp; If the magic program is not a monolith, then /USER_MODE may be&lt;BR /&gt;too gentle.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; (The "/user_mode" option causes this redefinition to evaporate when the&lt;BR /&gt;&amp;gt; next executable image (your program) exits.)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Close to true.&amp;nbsp; For more accurate fine print:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HELP DEFINE /USER_MODE&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; So, for example, a spawned subprocess would also be unaffected by a&lt;BR /&gt;/USER_MODE logical name definition.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Is there a way to make that command perpetual for the duration of the&lt;BR /&gt;&amp;gt; session instead of just the next command?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Without /USER_MODE, that logical name definition would persist.&amp;nbsp; If&lt;BR /&gt;running the magic program is the last thing you'll ever do in that DCL&lt;BR /&gt;script, then it may not matter.&amp;nbsp; If you'll be doing other stuff after&lt;BR /&gt;the magic program exits, then you might want to do something more like:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ define sys$input sys$command&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ run main_user_interactive_program&amp;nbsp; ! Or whatever you do.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ deassign sys$input&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Everything's complicated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 21:43:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/run-program-at-login/m-p/7007148#M104312</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2018-05-25T21:43:09Z</dc:date>
    </item>
  </channel>
</rss>

