Re: How Can Execute this with WSH?
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 May 2008 09:17:58 -0500
"Nelson Rodriguez" <neroig@xxxxxxxxxxxxx> wrote in message
news:46BA9565-D9A0-419F-B0B4-B7620830F0A7@xxxxxxxxxxxxxxxx
I have problemas with the blank between words RESPALDOS and NELSON.
Can someone help me please?
Thanks.
Set fso = CreateObject("Scripting.FileSystemObject")
set shell=createobject("Wscript.Shell")
cdirbkp="D:\CTM\*.*"
mes=month(date)
if month(date)<10 then
mes="0"&month(date)
end if
dia=day(date)
if day(date)<10 then
dia="0"&day(date)
end if
ctarget2="\\sg05\DSATA\Respaldos Nelson\CTM_"&year(date)&mes&dia & ".ZIP"
if fso.FileExists(ctarget) then
fso.DeleteFile(ctarget)
end if
xcmd_zip="C:\Archivos de Programa\winzip\winzip32.exe -min -a -r -p -ex "
& ctarget2 & " " & cdirbkp
Set oShell=shell.exec(xcmd_zip)
Do While oShell.Status = 0
WScript.Sleep 500
Loop
If the parameter passed to winzip32 has spaces it must be enclosed in
quotes. Any quotes in a quoted string must be doubled. Try:
ctarget2 = """\\sg05\DSATA\Respaldos Nelson\CTM_" & year(date) & mes & dia &
".ZIP"""
You can troubleshoot by echoing the value at command prompt. For example:
ctarget2 = """\\sg05\DSATA\Respaldos Nelson\CTM_" & year(date) & mes & dia &
".ZIP"""
Wscript.Echo ctarget2
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
.
- References:
- How Can Execute this with WSH?
- From: Nelson Rodriguez
- How Can Execute this with WSH?
- Prev by Date: How Can Execute this with WSH?
- Next by Date: Re: How Can Execute this with WSH?
- Previous by thread: How Can Execute this with WSH?
- Next by thread: Re: How Can Execute this with WSH?
- Index(es):
Relevant Pages
|
Loading