Go Back   Velocity Reviews > Newsgroups > Computer Information
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Computer Information - Logon script help

 
Thread Tools Search this Thread
Old 12-17-2003, 01:24 AM   #1
Default Logon script help


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
  Reply With Quote
Old 12-17-2003, 01:28 AM   #2
Edward Alfert
 
Posts: n/a
Default Re: Logon script help

<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
  Reply With Quote
Old 12-17-2003, 02:07 AM   #3
V W Wall
 
Posts: n/a
Default Re: Logon script help

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.)
  Reply With Quote
Old 12-17-2003, 03:23 AM   #4
Oldus Fartus
 
Posts: n/a
Default Re: Logon script help

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

  Reply With Quote
Old 12-17-2003, 04:47 AM   #5
DeMoN LaG
 
Posts: n/a
Default Re: Logon script help

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
  Reply With Quote
Old 12-17-2003, 08:55 AM   #6
Oldus Fartus
 
Posts: n/a
Default Re: Logon script help

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

  Reply With Quote
Old 12-17-2003, 09:30 AM   #7
Oldus Fartus
 
Posts: n/a
Default Re: Logon script help

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

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump