Unsolved

This post is more than 5 years old

691

December 11th, 2006 07:00

EMC autostart in a workgroup. How to excute script that require login.

Hi

We're running Autostart V5.2.1 in a workgroup. It seems like the installation is OK.
Then we want to execute a script with Utility processes. But in the settings we need to specify login info including domain (which we don't have,we're in a workgroup).
I've tried using the PCname, workgroupname, blank, dot, node alias, virtual domain name, usergroupname without success.
The log file created just contain on line describing that the file is created.

Any ideas?

Best regards
Arild Fossbakk

157 Posts

December 11th, 2006 07:00

How do you usually start it from the command line?
In Perl, you can execute external commands by enclosing it in between backtick characters, for example:
@result=`echo "blah..."`;
This will execute the command and store the output in the @result array.
Or you can use the system() function:
$result = system("echo \"blah...\"");
This one executes whatever you give it as a parameter and returns the errorcode 0 if successfull or not if the operation fails.

December 11th, 2006 07:00

Thanks for your fast reply.

So to avoid spending to much time learing perl... How do I execute a js (JScript) file from perl?

regards
Arild

157 Posts

December 11th, 2006 07:00

You can't use the utility process in your case, however you can use the script within the resource group. Open the resource group setting, and add the "Script" resource in the startup and/or shutdown sequence. You will be able to edit the script right there. In this case it has to be a perl script, but you can call the external shell script from there if necessary.

157 Posts

December 11th, 2006 08:00

No, echo was just an example command, in your case I would do the following:

$err=system("c:\\test.js");
if ($err) {
exit (1);
} else {
exit (0);
}

This will do the basic error checking, causing the script to fail if for whatever reason test.js fails. If you don't care about error handling, then you can just use the firt line. Also note that two backslash characters (\\) are not a typo.

December 11th, 2006 08:00

e.g my js file is called test.js
In command prompt I can just type test.js and it runs.

Previously when I installed Autostart in a domain I used Utility processes and just added a script like this (this worked)

@echo off
c:\test.js

But now in a workgroup I have to run this js file from Perl.
So in Perl it should be like this? (which a cannot get working)

@result=`echo "c:\test.js"`;

or
$result = system("echo \"c:\test.js\"");

Actually I don't need a returning value, I just want to execute the file.

December 12th, 2006 03:00

Thanks, that did the trick. (Sorry for my bad Perl Know-how). There was one more trick, I did not run because my autostart service was running with the system account. It seems like a cannot execute JScript from the system account context. Batch and CMD files worked. I change the user to a local admin and it now works with js files also.

Thanks
No Events found!

Top