Thanks Ray & others who answered,
I did in fact end up using &SAVEDLISTS&. ;-) The reason for using a generic
file and not creating one is that 1. I don't know which account it will run
in. 2. i don't want the time factor of creating a file and 3. if it can't
open the file then it doesn't need to run the script.
However, executing the cscript.exe command required the ampersands to be
escaped. Quoting all or any part of the string in a myriad of different
permutations didn't work. Whereas using the circumflex worked just fine (and
it is documented at msdn - I just didn't put in the right search for
combination the first time i searched :-S.
execute 'dos /c cscript ^&savedlists^&/myscript.vbs' capturing cap
Cheers, Stuart
ps. the script reads some stuff from the windows registry, I don't think
there's another easier way to do it.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Ray Wurlod
Sent: Tuesday, 3 February 2004 19:31
To: U2 Users Discussion List
Subject: Re: [UV] escaping "&temp&" in dos diectory
&TEMP& can't be guaranteed to exist. It's created if, during an upgrade,
items are found in VOC that are different in type to the replacement that's
to be installed in VOC as part of the upgrade. If an account has never been
upgraded, there won't be a &TEMP& file. You'd be better off choosing
&SAVEDLISTS&, which does always exist, but which doesn't help you get over
your escaping problem.
You *should* be able to use double quotes around the pathname. For example:
execute 'dos /c cscript "&temp&/myscript.vbs"' capturing cap
But this has two pieces of grief.
One is that the entire command must also be quoted (for the DOS /C command)
if the command contains white space. For example:
execute 'dos /C "cscript &temp&/myscript.vbs"' capturing cap
You can probably fiddle around with the third quote character, for example:
execute \dos /C 'cscript "&temp&/myscript.vbs"'\ capturing cap
The other is that EXECUTE - under what circumstances I can't quite
remember - has a tendency to strip a level of quotes.
Anyway, try some of those variations. If that doesn't work, create a Type
19 file as part of the command. For example:
execute 'DOS /C "mkdir mytmp; cscript mytmp/myscript.vbs"' capturing cap
or even
execute 'DOS /C "mkdir mytmp; cscript mytmp/myscript.vbs; del /S mytmp"'
capturing cap
- Original Message -
From: "Stuart Boydell" <[EMAIL PROTECTED]>
Date: Tue, 3 Feb 2004 15:25:33 +1100
To: "U2-Users" <[EMAIL PROTECTED]>
Subject: escaping "&temp&" in dos diectory
> Just a quick curly one, UV 10 Windows.
>
> I need to run a script in a &temp& directory because that's the only one
> that is generally going to be a type 1/19 in any given account.
>
> The ampersands are causing me grief, does anyone know how to escape them?
If
> it's not possible, I'll just write it to a path but I would prefer it to
be
> there for houskeeping.
>
> execute 'dos /c cscript &temp&/myscript.vbs' capturing cap
>
> Regards,
> Stuart Boydell
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> **
> This email message and any files transmitted with it are confidential
> and intended solely for the use of addressed recipient(s). If you have
> received this email in error please notify the Spotless IS Support Centre
(61 3 9269 7555) immediately who will advise further action.
>
> This footnote also confirms that this email message has been scanned
> for the presence of computer viruses.
> **
>
> ___
> u2-users mailing list
> [EMAIL PROTECTED]
> http://www.oliver.com/mailman/listinfo/u2-users
>
___
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users
**
This email message and any files transmitted with it are confidential
and intended solely for the use of addressed recipient(s). If you have
received this email in error please notify the Spotless IS Support Centre (61 3 9269
7555) immediately who will advise further action.
This footnote also confirms that this email message has been scanned
for the presence of computer viruses.
**
--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users