C
capt edgar
Hi there
I need help passing extra arguments to one of the function in my
script. The code below is one of the functionality of the script and
it
creates Log Folder
function CreateNewLogSubDir(pBuildID,pLogID,pDescription)
{ var strSubdirName='';
strSubdirName=WScript.Arguments.Named.Item'New');
if('string'!=typeof(strSubdirName)||0==strSubdirName.length)
{ var strDate = new Date();
var iMonth =Number(strDate.getMonth()+1);
var sMonthPrefix = '';
if(Number(iMonth)<10)sMonthPrefix='0';}
strSubdirName=strDate.getFullYear()+'-';
strSubdirName+=sMonthPrefix+iMonth +'-'+
(strDate.getDate() < 10 ? '0':'')+(strDate.getDate());
strSubdirName+='-B-' + pBuildID + '-L-' + pLogID+ '-' + pDescription;
The problem is this creates a log folder as follows
2010-01-05-B-undefined-L-undefined-undefined
The script doesn't prompt or ask me for entering B which is Build ID
or L which is LogID or does it ask for entering the issue
description
When i run that file, all i have is
2010-01-05-B-undefined-L-undefined-undefined
While actually the script should be asking me Build ID and then
passing whatever argument i'm passing onto Name of the Log Folder
For Ex: I run the script and then the script should ask enter the
value of B, i then enter B= 105475
and then script should ask to enter the value of L, i then enter L=
165487
and then the script should ask to enter a short description and then
i
should enter testlog
and then the script should create a new log folder as follows:
2010-01-05-B-105475-L-165487-testlog
Is there some sort of Prompt function to call within the Script which
can help achieve the above? Please help
I need help passing extra arguments to one of the function in my
script. The code below is one of the functionality of the script and
it
creates Log Folder
function CreateNewLogSubDir(pBuildID,pLogID,pDescription)
{ var strSubdirName='';
strSubdirName=WScript.Arguments.Named.Item'New');
if('string'!=typeof(strSubdirName)||0==strSubdirName.length)
{ var strDate = new Date();
var iMonth =Number(strDate.getMonth()+1);
var sMonthPrefix = '';
if(Number(iMonth)<10)sMonthPrefix='0';}
strSubdirName=strDate.getFullYear()+'-';
strSubdirName+=sMonthPrefix+iMonth +'-'+
(strDate.getDate() < 10 ? '0':'')+(strDate.getDate());
strSubdirName+='-B-' + pBuildID + '-L-' + pLogID+ '-' + pDescription;
The problem is this creates a log folder as follows
2010-01-05-B-undefined-L-undefined-undefined
The script doesn't prompt or ask me for entering B which is Build ID
or L which is LogID or does it ask for entering the issue
description
When i run that file, all i have is
2010-01-05-B-undefined-L-undefined-undefined
While actually the script should be asking me Build ID and then
passing whatever argument i'm passing onto Name of the Log Folder
For Ex: I run the script and then the script should ask enter the
value of B, i then enter B= 105475
and then script should ask to enter the value of L, i then enter L=
165487
and then the script should ask to enter a short description and then
i
should enter testlog
and then the script should create a new log folder as follows:
2010-01-05-B-105475-L-165487-testlog
Is there some sort of Prompt function to call within the Script which
can help achieve the above? Please help