Announcement

Collapse
No announcement yet.

during logon environment variables available

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • during logon environment variables available

    Hello,

    I'm not sure in which forum to post this question.
    I want to check of the existance of a particular file in the allusers folder
    c:\documents and settings\all users\application data

    I want to do this with logon script:
    when I use the variable %ALLUSERSPROFILE% the script cannot check
    when I write the path fully it is working.
    The script with the variable is working when I run it when logged in Also the variable is working then.

    see here the 2 versions of the line:

    checkPath = objWshShell.ExpandEnvironmentStrings("%ALLUSERSPRO FILE%") & "\Application Data\Network Associates\Common Framework"

    checkPath = "C:\Documents and Settings\All Users\Application Data\Network Associates\Common Framework"

    Does anybody know?

    thx
    Lambik

  • #2
    Re: during logon environment variables available

    It should work i guess, hmmmmm

    try it like this:
    Code:
    Set objWSHShell = CreateObject("Wscript.Shell")
    checkPath = chr(34) & objWshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%" & "\Application Data\Network Associates\Common Framework") & chr(34)
    
    wscript.echo checkPath    '<---- notice that the path is quoted now.
    
    Set objWSHShell = Nothing
    \Rem
    Last edited by Rems; 8th March 2007, 12:42.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment

    Working...
    X