 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
mholman
Joined: 15 Jun 2009 Posts: 3 Country: United States |
|
Custom Commands not working |
|
What I mean by this is that I run certain commands in a batch file that won't work when executed by 24x7 but will work when run from the command line. The 2 commands that I know are doing this are gpg (used for encryption) and psexec (which i am using to run an iisreset on another machine. I have been running these scripts for years on another box, but after making a new server and testing some of the scripts, many of them are not working and I cannot finish transferring to the new machine without them. The old box was a 2003 and this one is a 2008.
I really have no idea what this problem could be, any help would be appreciated.
|
|
Tue Jun 16, 2009 6:08 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
If this works when you run the batch manually, then it must be an environment specific issue.
Do you run the batch from the same folder? Do you use the same user ID? Is the PATH environment variable set the same for the user account running 24x7 and for your account? Does 24x7 run as a service?
|
|
Tue Jun 16, 2009 6:26 pm |
|
 |
mholman
Joined: 15 Jun 2009 Posts: 3 Country: United States |
|
|
|
I do run the batch from the same folder. I am using the same user ID, I'm logged in as the 24x7 user account and 24x7 does not run as a service. One thing I should note is that when I restarted the server one of the batches - the main one that I had been working on - began working, but all of the other ones continued to fail at the aforementioned commands. I didn't really change anything, was only adding pauses, etc. to isolate the offending line. I editted other files doing the same thing, because I had no idea what was happening, but none have fixed themselves since then.
edit: I have been working on more files, and in some files gpg will work, and will work every time, but in other files it will never work, and postie (a command for email) will work if i change directory to the path.
edit2: actually gpg may not work, but may work if i put in the path (havent had a chance to test yet). I believe it is a path problem.
|
|
Wed Jun 17, 2009 10:25 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
What errors do you get, when they don't work?
|
|
Wed Jun 17, 2009 1:19 pm |
|
 |
mholman
Joined: 15 Jun 2009 Posts: 3 Country: United States |
|
|
|
For postie it tells me it isn't recognized as an internal or external command. For gpg the batch crashes. Also I've tested now, and gpg will not work even if I change directory to the path. For some files I have confirmed that GPG does work all the time, regardless of the current directory. For postei at least it seems like the environment path isn't being read correctly. I was under the impression that it was system wide, but it seems like I need to change something outside of the environment path, can you guide me with that?
|
|
Wed Jun 17, 2009 1:46 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
There are 2 types of environment variables - System and User. You can see them here Desktop -> My computer -> right-click then Properties -> Advanced tab -> Environment Variables button. The PATH and all other variables required for your programs should be in the System section. Please update them as needed. Hope this helps to resolve the issue.
Here is a link to Microsoft document describing step-by-step How To Manage Environment Variables in Windows XP. It is for XP, but the same steps work for W2000/Vista/2003/2008
http://support.microsoft.com/kb/310519
|
|
Wed Jun 17, 2009 6:02 pm |
|
 |
DEEPAK JAIN
Joined: 26 Jun 2018 Posts: 5 Country: India |
|
Observing similar issue |
|
All the jobs are getting failed and showing below error when we put its path with environment variable as highlighted:
Job errors: Create process error. Extended error: Cannot run program "%ZN_TASKS_PRICE_UPLOAD%\ZN_Batches\credit_margin_export.bat": CreateProcess error=2, The system cannot find the file specified
But when we are using complete URL then scheduler is able start the job.
|
|
Tue Jun 26, 2018 9:19 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Please create a simple test batch file and a test job with hardcoded path to the batch file.
In the batch file run
echo "/%ZN_TASKS_PRICE_UPLOAD%/" > c:\temp\test.log
Please create c:\temp if it doesn't exist. Please run the job and see what it prints to the log. I added extra / symbols in front and back of the value so that extra spaces, if any, can be seen in the log file.
|
|
Tue Jun 26, 2018 10:57 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|