Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.lang.visual-basic > #19597

Re: Aggiungere carattere in stringa registro

Path csiph.com!aioe.org!.POSTED.y/OwqQB/mYEXQFAEWO7nNg.user.gioia.aioe.org!not-for-mail
From SB <stNOOObenevSPAM@tin.it>
Newsgroups it.comp.lang.visual-basic
Subject Re: Aggiungere carattere in stringa registro
Date Wed, 13 Mar 2019 23:03:49 +0100
Organization Aioe.org NNTP Server
Lines 58
Message-ID <4uui8edefm3q5cidkpdo6lc5uucepcqsso@4ax.com> (permalink)
References <q6b400$18f6$1@gioia.aioe.org> <dl7i8edhgfnnkngkp5csjd457uj0sj15ik@4ax.com> <q6b9ep$34o$1@gioia.aioe.org> <auai8epqrui12jo18mi2porpshadjhqoc7@4ax.com> <q6barb$9v7$1@gioia.aioe.org> <q6bcak$gu9$1@gioia.aioe.org> <sndi8e1ufe437vvumc5e3olrut4u72g65t@4ax.com> <q6be4p$pek$1@gioia.aioe.org> <t5fi8eh2eh62uejh5kjqheurv8e845afof@4ax.com> <q6beq8$slb$1@gioia.aioe.org> <qufi8ed4e4nthrud9nkjtfibk0iqk12tm1@4ax.com> <q6bmd3$1vvl$1@gioia.aioe.org> <q6bp9n$djd$1@gioia.aioe.org>
Reply-To stNOOObenevSPAM@tin.it
NNTP-Posting-Host y/OwqQB/mYEXQFAEWO7nNg.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
X-Newsreader Forte Agent 1.93/32.576 English (American)
X-Notice Filtered by postfilter v. 0.9.2
Xref csiph.com it.comp.lang.visual-basic:19597

Show key headers only | View raw


Il giorno Wed, 13 Mar 2019 21:30:45 +0100, "Cerebus" <Cerebus@test.it> ha
scritto:

>
>"Cerebus" <Cerebus@test.it> ha scritto nel messaggio 
>news:q6bmd3$1vvl$1@gioia.aioe.org...
>
>> Hai STRAragione!
>> E' quello.
>
>No, non e' quello.
>Sbagliero' qualcos'altro.
>
>Ecco il SET cosa mi risponde.
>
>ProgramData=C:\ProgramData
>ProgramFiles=C:\Program Files
>ProgramFiles(x86)=C:\Program Files (x86)
>ProgramW6432=C:\Program Files
>PROMPT=$P$G
>PSModulePath=C:\Program Files\WindowsPowerSh
>PUBLIC=C:\Users\Public
>SESSIONNAME=Console
>SystemDrive=C:
>SystemRoot=C:\Windows
>
>Se sostituisco C:\programdata\ con %PROGRAMDATA% non sortisce alcun effetto.
>
>File = "%PROGRAMDATA%\nome\nomefile.txt"
>Folder = "%PROGRAMDATA%\nome\cartella"
>
>Set Fso = CreateObject("Scripting.FileSystemObject")
>
>If Fso.FileExists(File1) Then Fso.DeleteFile File1, True
>
>Fso.DeleteFile("Folder\*.*"), True
>
>If Fso.FolderExists(Folder) Then Fso.DeleteFolder(Folder), True
>
>Idee per un debug?

A volte il parametro viene espanso durante la chiamata, a volte no.
Per esserne sicuro devi usare il metodo ExpandEnvironmentStrings della Shell.

Per usarlo nelle tue variabili devi fare:

  Set oShell = CreateObject("Wscript.Shell")

PROGRAM_DATA = oShell.ExpandEnvironmentStrings ("%PROGRAMDATA%")

File = PROGRAM_DATA & "\nome\nomefile.txt"

Folder = PROGRAM_DATA & "\nome\cartella"


-- 
ciao
  Stefano

Back to it.comp.lang.visual-basic | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-11 17:44 +0100
  Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-11 21:32 +0100
    Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-11 21:50 +0100
      Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-12 14:31 +0100
        Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-12 14:47 +0100
          Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-12 15:36 +0100
            Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-12 21:37 +0100
              Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 11:10 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 14:41 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 15:37 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 16:08 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 15:27 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 16:20 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 17:00 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 17:19 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 17:23 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 17:49 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 18:02 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 18:20 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 18:24 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 18:31 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 18:58 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 20:41 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-13 21:30 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 23:03 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-14 23:10 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-14 23:21 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-15 13:09 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-15 13:20 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-15 14:57 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-15 13:31 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-03-15 14:56 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-15 19:10 +0100
                Re: Aggiungere carattere in stringa registro SB <stNOOObenevSPAM@tin.it> - 2019-03-13 23:10 +0100
                Re: Aggiungere carattere in stringa registro "Cerebus" <Cerebus@test.it> - 2019-04-28 23:43 +0200

csiph-web