Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
external task system command
chrystel
Hi !
With TS6.1 SP1 / Windows 2000 server
I want to execute a script perl which may execute a system command "xcopy"
I run my perl script in a cmd window => it works (authenticated as an administrator)
As an external task => the xcopy doesn't work. (executed as user SYSTEM)
I verify the authorisation on xcopy (everyone full control).
I tried with a whoami cmd , it works ...
I don't know windows 2000 enough to have another idea ....
Thanks for your help or idea
Chrystel
Find more posts tagged with
Comments
Adam Stoller
As an external task => the xcopy doesn't work. (executed as user SYSTEM)
You need to provide better, more detailed, diagnostics; "doesn't work" doesn't mean anything by itself.
How
doesn't it work?
What
happens?
What
does the code look like?
What
error messages, if any, exist in
which
log files?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
chrystel
Hi,
doesn't work = the xcopy seems to be ignored, no action, no trace, no error return code =0
WFT:
...
<command v="C:\iw-home\iw-perl\bin\iwperl.exe C:\iw-home\custom\bin\my_script.ipl -opt1=var1 -opt2=var2" />
.....
PERL:
my_script.ipl :
my %hCmd = (
'xcopy' => "xcopy $$hWkarea{WKUpdSrcPath} $$hWKarea{WkareaNTpatch} /I /E /C /R /Y",
.....
);
my %NTCmd = (
...
'sCmd' => "$hCmd{$$hWkarea{method}} 1>$$nomfic1 2>$$nomfic2 (where $$hWkarea{method} is xcopy)
);
processSystemCmd(\%hNTCmd);
.....
script.pm:
....
sub processSystemCmd {
....
chomp(
@aStdOut
= `$$href{sCmd}`
....
}
The command sCmd is logged and is well formed.
Is that better ???
chrystel
I forget the end of the "chomp " line in my message but not in the script ....
BIRT_stacked_bar_chart.jpg
Adam Stoller
Yes - that's better - now can you show us what the actual value of $$href{sCmd} is - from an actual debugging printout when it does work (from the command line) and when it doesn't work (from within a workflow externaltask) ?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
chrystel
Hello,
From a command line
2004-12-22 09:10:44|3044|3|- |chm_core_utilities|processSystemCmd|Executing : xcopy Y:\default\main\BrancheTST\EDITION\ed_0003 Y:\default\main\BrancheTSTxfer\WORKAREA\workTST /I /E /C /R /Y 1>F:/TeamSite/utils/setup/output/update_files_3044_1.txt 2>F:/TeamSite/utils/setup/output/failed_files_3044_1.txt
the file F:/TeamSite/utils/setup/output/update_files_3044_1.txt contains the file list copied
the file F:/TeamSite/utils/setup/output/failed_files_3044_1.txt is empty
All files are copied in the workarea WORKTST
From an external task
2004-12-22 09:11:37|1888|3|- |chm_core_utilities|processSystemCmd|Executing : xcopy Y:\default\main\BrancheTST\EDITION\ed_0003 Y:\default\main\BrancheTSTxfer\WORKAREA\workTST /I /E /C /R /Y 1>F:/TeamSite/utils/setup/output/update_files_1888_1.txt 2>F:/TeamSite/utils/setup/output/failed_files_1888_1.txt
the files are empty and files are not copied
I can't see any difference ?!
Adam Stoller
You might try using system() rather than back-ticks when running the command from within the script, or you might try prefacing the entire command string with: cmd /C "xcopy ....."
My guess is that the context/environment in which it is being (or attempted at being) run when used within a workflow externaltask is not identical to the context/environment you have when running from the command line yourself - and that more than likely it's not a case of xcopy failing - it's a case of xcopy not being recognized as a command and thus the back-ticks are essentially performing a no-op.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
chrystel
Hi,
I will try with system() thank you !
I've maid other tests and found that a command like whoami | xcopy ..... does work in the two cases ?! but whoami&xcopy not
Does it
Strange no !!!!!!