Logon script help

Discussion in 'Computer Information' started by gregb369, Dec 17, 2003.

  1. gregb369

    gregb369 Guest

    If I want to write a script that will copy a file to this location:

    C:\Documents and Settings\


    Then I write it like this:


    Copy test.txt c:\docume~1\


    If you want to write it to copy to this location:


    C:\Documents and Settings\Administrator.sun\


    How do you truncate that folder?


    There is a local Administrator folder in Documents and Settings, so C:\
    docume~1\Admini~1\ is not the answer.

    Any thoughts? Thanks.
     
    gregb369, Dec 17, 2003
    #1
    1. Advertising

  2. <snip>
    > There is a local Administrator folder in Documents and Settings, so C:\
    > docume~1\Admini~1\ is not the answer.
    >
    > Any thoughts? Thanks.


    C:\docume~1\Admini~2\


    --
    Edward Alfert - http://www.rootmode.com/
    Discount Code (Recurring 25% Off): newsgroup
    Multiple Domain Hosting * Reseller Hosting
    Free IP Addresses * Private Label Nameservers
     
    Edward Alfert, Dec 17, 2003
    #2
    1. Advertising

  3. gregb369

    V W Wall Guest

    gregb369 wrote:
    >
    > If I want to write a script that will copy a file to this location:
    >
    > C:\Documents and Settings\
    >
    > Then I write it like this:
    >
    > Copy test.txt c:\docume~1\
    >
    > If you want to write it to copy to this location:
    >
    > C:\Documents and Settings\Administrator.sun\
    >
    > How do you truncate that folder?
    >
    > There is a local Administrator folder in Documents and Settings, so C:\
    > docume~1\Admini~1\ is not the answer.
    >
    > Any thoughts? Thanks.


    Put a test file in the place where you want to copy the file. Go to DOS
    and do a directory listing which includes that test file. This will show
    the proper truncated name for the folder. Short filenames are assigned
    numbers in the order they are created, \admini~2 may be correct, but this
    test will tell.

    Virg Wall
    --
    A foolish consistency is the
    hobgoblin of little minds,........
    Ralph Waldo Emerson
    (Microsoft programmer's manual.)
     
    V W Wall, Dec 17, 2003
    #3
  4. gregb369

    Oldus Fartus Guest

    gregb369 wrote:

    > If I want to write a script that will copy a file to this location:
    >
    > C:\Documents and Settings\
    >
    >
    > Then I write it like this:
    >
    >
    > Copy test.txt c:\docume~1\
    >
    >

    Assuming XP, then no. If you are running it in CMD command prompt then
    there is no need to truncate the filenames at all.

    > If you want to write it to copy to this location:
    >
    >
    > C:\Documents and Settings\Administrator.sun\
    >
    >
    > How do you truncate that folder?
    >
    >
    > There is a local Administrator folder in Documents and Settings, so C:\
    > docume~1\Admini~1\ is not the answer.
    >
    > Any thoughts? Thanks.
    >
    >

    If you need to truncate then the path would be C:\docume~1\Admini~1.sun\
    You were missing the .sun part of the path.

    If you run it using CMD command prompt, and not COMMAND, and then the
    problem will not arise.

    --
    Cheers
    Oldus Fartus
     
    Oldus Fartus, Dec 17, 2003
    #4
  5. gregb369

    DeMoN LaG Guest

    Oldus Fartus <> wrote in news:broi84$2s04$1
    @otis.netspace.net.au:

    > If you run it using CMD command prompt, and not COMMAND, and then the
    > problem will not arise.


    The only problem that /may/ arise is that sometimes commands don't
    understand spaces. Example:
    From my laptop to get to my desktop's "program files" folder, I can't type:
    \\jim\c$\program files
    I have to type:
    "\\jim\c$\program files\"

    So enclosing the entire arguments to the command in quotes, example:
    copy "c:\path to file\file.txt" "c:\documents and settings\%username%\"
    is usually advisable.

    --
    AIM: FrznFoodClerk
    email: de_on-lag@co_cast.net (_ = m)
    website: under construction
    Need a technician in the south Jersey area?
    email/IM for rates/services
     
    DeMoN LaG, Dec 17, 2003
    #5
  6. gregb369

    Oldus Fartus Guest

    DeMoN LaG wrote:

    > Oldus Fartus <> wrote in news:broi84$2s04$1
    > @otis.netspace.net.au:
    >
    >
    >>If you run it using CMD command prompt, and not COMMAND, and then the
    >>problem will not arise.

    >
    >
    > The only problem that /may/ arise is that sometimes commands don't
    > understand spaces. Example:
    > From my laptop to get to my desktop's "program files" folder, I can't type:
    > \\jim\c$\program files
    > I have to type:
    > "\\jim\c$\program files\"
    >
    > So enclosing the entire arguments to the command in quotes, example:
    > copy "c:\path to file\file.txt" "c:\documents and settings\%username%\"
    > is usually advisable.
    >


    Yes, I have noticed that - but only when accessing network paths, and
    not on paths on a single computer. I didn't mention it because it did
    not seem relevant, but it certainly does to hurt to make the OP aware of
    it.

    Of course there may come a time when he needs to use his script on a
    network, so it is probably a good habit to get into anyway.

    --
    Cheers
    Oldus Fartus
     
    Oldus Fartus, Dec 17, 2003
    #6
  7. gregb369

    Oldus Fartus Guest

    Oldus Fartus wrote:

    > DeMoN LaG wrote:
    >
    >> Oldus Fartus <> wrote in news:broi84$2s04$1
    >> @otis.netspace.net.au:
    >>
    >>
    >>> If you run it using CMD command prompt, and not COMMAND, and then the
    >>> problem will not arise.

    >>
    >>
    >>
    >> The only problem that /may/ arise is that sometimes commands don't
    >> understand spaces. Example:
    >> From my laptop to get to my desktop's "program files" folder, I can't
    >> type:
    >> \\jim\c$\program files
    >> I have to type:
    >> "\\jim\c$\program files\"
    >>
    >> So enclosing the entire arguments to the command in quotes, example:
    >> copy "c:\path to file\file.txt" "c:\documents and settings\%username%\"
    >> is usually advisable.
    >>

    >
    > Yes, I have noticed that - but only when accessing network paths, and
    > not on paths on a single computer. I didn't mention it because it did
    > not seem relevant, but it certainly does to hurt to make the OP aware of
    > it.
    >

    Sorry, that should have read "certainly does NOT hurt.......

    > Of course there may come a time when he needs to use his script on a
    > network, so it is probably a good habit to get into anyway.
    >



    --
    Cheers
    Oldus Fartus
     
    Oldus Fartus, Dec 17, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CJH
    Replies:
    0
    Views:
    1,991
  2. Graham
    Replies:
    0
    Views:
    753
    Graham
    Jan 24, 2004
  3. Crowbot

    Scriptlogic as a logon script utility

    Crowbot, Jul 22, 2004, in forum: Computer Security
    Replies:
    0
    Views:
    1,339
    Crowbot
    Jul 22, 2004
  4. Jeroen Wijnands

    Re: Events: Logon vs Account Logon

    Jeroen Wijnands, Mar 6, 2006, in forum: MCSA
    Replies:
    0
    Views:
    762
    Jeroen Wijnands
    Mar 6, 2006
  5. Matt G

    VBS Logon script

    Matt G, May 14, 2008, in forum: MCSA
    Replies:
    2
    Views:
    687
    Matt G
    May 16, 2008
Loading...

Share This Page