I have a file name hard coded in a SQL DTS execute process task as shown below:

cmd.exe /c wzunzip \\servername\share\filename.20060411.zip c:\temp\dir\ -o

Can I store a variable and call this file to be unzipped with the current
day/date? How could I use something like this:

Dim sNOW
sNOW = Date
sNOW = (Year(sNOW)*100 + Month(sNOW))*100 + Day(sNOW)

Re: global variable needed? by mr_unreliable

mr_unreliable
Wed Apr 12 11:46:00 CDT 2006

hi SQLCat,

Try this:

--- <snip> ---
Dim sNOW
sNOW = Date
sNOW = Year(sNOW) & Right("0" & Month(sNOW), 2) & Right("0" &
Day(sNOW), 2)

Dim sCMD
sCMD = "/c wzunzip \\servername\share\filename." & sNOW & ".zip
c:\temp\dir\ -o"

oShell.Run "%comspec& " & sCMD
--- </snip> ---

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)


SQLCat wrote:
> I have a file name hard coded in a SQL DTS execute process task as shown below:
>
> cmd.exe /c wzunzip \\servername\share\filename.20060411.zip c:\temp\dir\ -o
>
> Can I store a variable and call this file to be unzipped with the current
> day/date? How could I use something like this:
>
> Dim sNOW
> sNOW = Date
> sNOW = (Year(sNOW)*100 + Month(sNOW))*100 + Day(sNOW)
>
>
>

Re: global variable needed? by SQLCat

SQLCat
Wed Apr 12 12:26:01 CDT 2006

well, the oShell.Run "%comspec& " & sCMD was killing me. I couldn't Dim
oShell.Run (didn't like it). I was using "cmd.exe /c wzunzip
\\servername\etc" which still doesn't work.

I'm really at a loss on this.

"mr_unreliable" wrote:

> hi SQLCat,
>
> Try this:
>
> --- <snip> ---
> Dim sNOW
> sNOW = Date
> sNOW = Year(sNOW) & Right("0" & Month(sNOW), 2) & Right("0" &
> Day(sNOW), 2)
>
> Dim sCMD
> sCMD = "/c wzunzip \\servername\share\filename." & sNOW & ".zip
> c:\temp\dir\ -o"
>
> oShell.Run "%comspec& " & sCMD
> --- </snip> ---
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but,
> no guarantee the answers will be applicable to the questions)
>
>
> SQLCat wrote:
> > I have a file name hard coded in a SQL DTS execute process task as shown below:
> >
> > cmd.exe /c wzunzip \\servername\share\filename.20060411.zip c:\temp\dir\ -o
> >
> > Can I store a variable and call this file to be unzipped with the current
> > day/date? How could I use something like this:
> >
> > Dim sNOW
> > sNOW = Date
> > sNOW = (Year(sNOW)*100 + Month(sNOW))*100 + Day(sNOW)
> >
> >
> >
>

Re: global variable needed? by Dr

Dr
Thu Apr 13 12:33:22 CDT 2006

JRS: In article <utkLyAlXGHA.1348@TK2MSFTNGP05.phx.gbl>, dated Wed, 12
Apr 2006 12:46:00 remote, seen in news:microsoft.public.scripting.vbscri
pt, mr_unreliable <kindlyReplyToNewsgroup@notmail.com> posted :
>hi SQLCat,
>
>Try this:
>
>--- <snip> ---
>Dim sNOW
> sNOW = Date
> sNOW = Year(sNOW) & Right("0" & Month(sNOW), 2) & Right("0" &
>Day(sNOW), 2)

Why do you suggest inferior code giving the same result?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

Re: global variable needed? by mr_unreliable

mr_unreliable
Thu Apr 13 15:16:34 CDT 2006

Forgive me, oh superior and extremely arrogant one, jw

Dr John Stockton wrote:
> Why do you suggest inferior code giving the same result?