VoiceGuide IVR Software Main Page
Jump to content

batch file not working same in script as in cmd

Recommended Posts

Hi,

 

How to start batch file in run module in open cmd window or how other way analyze what happen executing batch file?

We have problem because batch file working properly opened in cmd window but called from RUN module not run properly  all commands.

Share this post


Link to post

batch problem is with network addresses, locally working properly but copy or move to network drive (folder) .

like:

        move /Y C:\callrecord\%1.mp3 \\192.168.1.120\callrecord

Share this post


Link to post

Accessing networked drives from Windows Services is not that straightforward.

VoiceGuide runs a s a Windows Service under the "Local System" account. (most Windows Services use "Local System" account).

Access to remote drives from a "Local System" account is done without sending any login credentials, so the system that is hosting the networked drive needs to be set up to allow such anonymous logins and allow writes/modifys from such sources. This is usually undesirable and is hard to set up on many systems.

You can try running VoiceGuide service under one of the user accounts. Use Windows' Services applet and open VoiceGuide IVR Service Properties pages, and go to Log On tab to select a different account. The system that is hosting the networked drive then needs to be set up to allow writes/modifys from that selected account.

 

Probably a better approach is to FTP/SCP/SFTP/etc. the files across instead of using the above workaround configuration changes.

eg. look at psftp and pscp utilities from PuTTY.

The destination system will need to run the FTP/SCP/SFTP/etc. server to accept the incoming connections.

OpenSSH is often used to run the server service, but there are other server applications available as well (from Bitvise, Solarwinds, freeSSHd, etc.). Google "SFTP Servers" or "SCP Servers" for more.

Share this post


Link to post

After SFTP or SCP functionality has been enabled on your other machine or NAS, here is one command that can be used in batch file to transfer file using SFTP or SCP :

c:\path_to\pscp.exe -pw my_password C:\somepath\myfile.wav username@ip_address:/Directory/

The first time you run it from VoiceGuide (windows service) you  should run it as:

echo y | c:\path_to\pscp.exe -pw my_password C:\somepath\myfile.wav username@ip_address:/Directory/

so that Windows can cache the server's host key into registry under the LocalSystem account.

(Run PSCP.EXE in normal command line to test it out first to see why you need to send the "y" the first time.)

Note that in this simple approach you need to specify the password for the login account. It is possible to set up PSCP so that the password does not need to be specified each transfer time.

PSCP utility is on PuTTY downlaod page.

Please let us know if you have any more questions on setting this up.

Share this post


Link to post

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
×