Custom script for Windows

Forum / NoMachine for Windows / Custom script for Windows

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38071
    tithapheap
    Participant

    I have 2 Windows boxes, 1 is Windows 10 and 1 is Windows Server 2019. Both are stand-alone.  I installed NoMachine on both.  I want to remote from Windows 10 to Windows Server 2019.  I have a simple batch script or powershell script that I want to run at the UserScriptAfterSessionStart in the node.cfg.  I tried

    UserScriptAfterSessionStart = "c:\temp\myscript.bat" and UserScriptAfterSessionStar = "c:/temp/myscript.bat" and UserScriptAfterSessionStart "c:\temp\myscript.bat" and UserScriptAfterSessionStart "c:/temp/myscript.bat"

    but none executes after I connected to Windows Server 2019.  I executed the myscript.bat file manually and it works as expected.  Please help.

    #38444
    Britgirl
    Keymaster

    Apologies for the late response.

    Try defining the key as:

    UserScriptAfterSessionStart “C:\test.bat”

    And the body:

    @echo off
    mkdir C:\Users\tester\anydir

    Bear in mind that custom scripts need to finish within 30 seconds otherwise the session will be terminated. So if you would like to be able to open a program or carry out some kind of activity for longer, you will have to run an application in the background.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic was marked as solved, you can't post.