Welcome to the community forums for Theopenem. All responses are provided by other users that wish to help out. Theopenem will not respond to these posts. If you require more assistance than what the community can provide, we offer various paid support options.

Command module failing because of space


  • I am trying to run a command module using a file path from a copy file module. Using toec.exe --console, I can see that the command is running with the proper file path and immediately failing. Logs:

    2022-10-04 17:22:00,438 INFO [4] ModuleCommandManager DESKTOP-S73CSJ1\Administrator - Running Command Module: PC Check-ins
    2022-10-04 17:22:00,438 DEBUG [4] ServiceProcess DESKTOP-S73CSJ1\Administrator - Starting Command: cmd.exe /c  "C:\Program Files\Toec\AppData\2eb9ecc7-db9c-434e-b824-aa7b9cb4ff22\Check-Ins-Setup-1.10.0.exe" /S
    2022-10-04 17:22:00,469 INFO [4] ModuleCommandManager DESKTOP-S73CSJ1\Administrator - {"ExitCode":1,"StandardError":"","StandardOut":""}
    2022-10-04 17:22:00,469 INFO [4] ModuleCommandManager DESKTOP-S73CSJ1\Administrator - Command Module: PC Check-ins Finished
    2022-10-04 17:22:00,469 ERROR [4] PolicyExecutor DESKTOP-S73CSJ1\Administrator - An Error Occurred In Module PC Check-ins
    2022-10-04 17:22:00,469 ERROR [4] PolicyRunner DESKTOP-S73CSJ1\Administrator - Aborting Current Policy
    

    And if I run the command it says it is running:

    C:\Users\Administrator>cmd.exe /c  "C:\Program Files\Toec\AppData\2eb9ecc7-db9c-434e-b824-aa7b9cb4ff22\Check-Ins-Setup-1.10.0.exe" /S
    'C:\Program' is not recognized as an internal or external command,
    operable program or batch file.
    

    It looks like it is failing because of the space in Program Files not being properly escaped. Is there a fix for this?


  • can you post the command you are using for the command module?


  • @theopenem_admin [module-2eb9ecc7-db9c-434e-b824-aa7b9cb4ff22]Check-Ins-Setup-1.10.0.exe
    And in the arguments field: /S


  • Are you referencing a different module or just the current module, if the file is attached to this same module, you should just be able to put.
    Check-Ins-Setup-1.10.0.exe


  • @theopenem_admin That worked, thank you! I didn't know I could reference files uploaded there like that, I tried .\ and it didn't work.


  • no problem. That said, it looks like there is an issue when using [module-] format, which really isn't needed anymore anyway. It was used more in older versions.


  • Yeah, thought it might be good to point out. The documentation on that page also says nothing about the uploads right there, it actually points to a file copy module.


  • yea, the older version required the use of a file copy module also.


  • Hey, I'm back with a likely related problem. Trying to use a command module to use netsh to add a wifi profile via XML:

    2022-10-06 14:52:41,855 INFO [22] ModuleCommandManager DOMAIN\user - Running Command Module: Add wifi
    2022-10-06 14:52:41,858 DEBUG [22] ServiceProcess DOMAIN\user - Starting Command: cmd.exe /c  "netsh" wlan add profile filename="Wi-Fi-wifiname.xml" user=all
    2022-10-06 14:52:41,896 INFO [22] ModuleCommandManager DOMAIN\user - {"ExitCode":1,"StandardError":"'netsh\" wlan add profile filename=\"Wi-Fi-wifiname.xml' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n\r\n","StandardOut":"\r\n"}
    2022-10-06 14:52:41,897 INFO [22] ModuleCommandManager DOMAIN\user - Command Module: Add wifi Finished
    2022-10-06 14:52:41,898 ERROR [22] PolicyExecutor DOMAIN\user - An Error Occurred In Module Add wifi
    2022-10-06 14:52:41,898 ERROR [22] PolicyRunner DOMAIN\user - Aborting Current Policy```

  • Have you tried putting that entire command in the command field instead of using the arguments field?