web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to avoid security warning message while running .bat file via job queue?

(0) ShareShare
ReportReport
Posted on by 2,641

Hi,

We are running .bat file via job queue that will run WinRAR and extract the files.

When we run it will wait for security warning message for user confirmation, but in job queue user interaction is not allowed. so how we can avoid such message while running .bat file via job queue?

The other concerns are:

1. How to keep cmd window minimized.

2. How to keep WinRAR window minimized.

Please suggest.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at

    you can avoid that by running a codeunit (in the job queue) using an assembly which delivers zip/rar functionality.

    follow www.codeproject.com/.../C-NET-Interface-for-Zip-Archive-DLLs

  • Jatin Patel Profile Picture
    2,641 on at

    We can't use 7-Zip as rar extractor. Only WinRAR we can use it.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    it's free, so why not.

    but if you need to use winrar, use the extract library unrar.dll direct from rarlabs.

    www.rarlab.com/rar_add.htm

    www.rarlab.com/.../UnRARDLL.exe

    and if you really want to use executables, then do not use winrar.exe, but instead the dos commands rar.exe and unrar.exe (also in the winrar folder). they can be used without user interaction.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    if you mean the security warning when executing external programs with the shell command,

    then follow my answer on
    http://dynamicsuser.net/forums/p/80499/445645.aspx#445645
    result: use shell command with parameters (text variables)

     
    also follow techblog.byllemos.com/.../execution-of-batch-jobs-and-other-programs-from-navision

    result: use WshShell (automation) instead of shell command.

    you can also use the dotnet class System.Diagnostics.Process.

    for that follow msdn.microsoft.com/.../system.diagnostics.process%28v=vs.110%29.aspx

  • Jatin Patel Profile Picture
    2,641 on at

    I got below error while accessing it using System.Diagnostics.Process

    I have access to the file location but it still gives error.

    Microsoft Dynamics NAV

    ---------------------------

    A call to System.Diagnostics.Process.Start failed with this message: The system cannot find the file specified

    ---------------------------

    OK

    ---------------------------

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    does it work, if you run the codeunit directly in the dev.env.?

    are all called/used files in the command string on the server?

    what is the command string, argument of startinfo?

    did you set runonclient to false?

  • mmv Profile Picture
    11,471 on at

    hi,

    At times, it's been noticed that there are some constraints on the length of the file name (restricted by the system settings).  Please ensure that the file name is correct at the location.

    Best Regards,

    MMV

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Jatin,

    just view the below link for extract the files with rar.

    comptb.cects.com/.../uncompress_rar.bat_.txt

  • Jatin Patel Profile Picture
    2,641 on at

    No it didn't work in the dev env also.

    Yes all the files are available on the server.

    I have written below command:

    DNETSysDiagProcess := DNETSysDiagProcess.Start('"UnRAR.exe" e -y "G:\Test\IN\ABC.rar" "G:\Test\IN\"');

    runonclient is false already.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    unrar.exe needs also the full file path for calling.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans