The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday 7:30am (PST)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

PPM Report - How do you connect to Windows Server via Unix command

SOLVED
Go to solution
Highlighted
Ed Foerster
Occasional Contributor

PPM Report - How do you connect to Windows Server via Unix command

Hi,

I am trying to run a VBS file from a custom PPM Report from one Windows server and checking the existance of a file on another Windows server.

The code snipet is


ksc_set MY_PATH="d:/scripts"
ksc_local_exec cmd /c cscript.exe '[MY_PATH]/size.vbs //teitgda1/d$/connectDirect/changes.txt "<=" 120000'

I get an error saying the file can't be found. It's the first parameter starting with "//..."

Thanks.
7 REPLIES
Erik Cole_1
Esteemed Contributor

Re: PPM Report - How do you connect to Windows Server via Unix command

Are you sure that the file it's referring to isn't cscript.exe?

Can you post the exec log?
Ed Foerster
Occasional Contributor

Re: PPM Report - How do you connect to Windows Server via Unix command

Hi,

Here is the log output from the failed report. The "1" is an error (parameters being passed in). I know when I didn't pass any parameters, an error code of 2 was returned.

I don't know why it would be complaining about "Input Error: There is no script engine for file extension ".txt"."

Is it something as simple as needing another pair of single quotes?

This is what works from a Windows Command Prompt

cscript.exe size.vbs \\teitgda1\d-read$\connectDirect\changes.txt "<=" 1500000

**** Log file output ********

KSC Set

Source Command: Check for changes.txt plus file size

MY_PATH=d:/scripts
Succeeded

CL Local Exec

Source Command: Check for changes.txt plus file size

cmd /c cscript.exe 'd:/scripts/size.vbs //teitgda1/d/connectDirect/changes.txt'
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: There is no script engine for file extension ".txt".
exit code = 1
Errors occurred during command execution.
Erik Cole_1
Esteemed Contributor

Re: PPM Report - How do you connect to Windows Server via Unix command

Ed,

Did you try something like

cscript.exe '[MY_PATH]/size.vbs' '//teitgda1/d$/connectDirect/changes.txt "<=" 120000'

It looks like it's seeing both the script and parameter as one...
Jim Esler
Honored Contributor

Re: PPM Report - How do you connect to Windows Server via Unix command

When we have used cscript.exe in a command set, we have not placed all of the parameters inside quotes. Have you tried without the quotes?

Jim Esler
Honored Contributor
Solution

Re: PPM Report - How do you connect to Windows Server via Unix command

Maybe this snippet of code from one of our Object Types will help. A vbs script does not understand UNIX style file paths within the Cygwin file space, which is what PPM will be generating.

WPATH="$(cygpath -a -w [DEST_ENV.ENV.SERVER_BASE_PATH]/[P.P_SUB_PATH]/[P.P_FILENAME])"

cscript.exe scripts/itg_sql_scan.vbs $WPATH
Ed Foerster
Occasional Contributor

Re: PPM Report - How do you connect to Windows Server via Unix command

Using cygpath with a "-w" switch worked via the Windows Command Prompt. However, I could not get the parameters to be passed in via an HP PPM Report.

I had to hard code the VBS file with the parameter values.

In the report, I could only call the VBS file like "ksc_local_exec cmd c/ cscript.exe size.vbs"

Thanks.
Cesar Roque
Regular Collector

Re: PPM Report - How do you connect to Windows Server via Unix command

Hi Ed,

I have get some errors like yours. When but I have never used MY_PATH var, when you run the ksc_local_exec command it start or used the directory as BASE_PATH, maybe you can solve it at a simple way.

Create a batch file that with the necesary commands to run what you want and locate it at the directory.

I think this will solve your issue.

Regards
//Add this to "OnDomLoad" event