Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Computer Information > Logon script help

Reply
Thread Tools

Logon script help

 
 
gregb369
Guest
Posts: n/a
 
      12-17-2003
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.





 
Reply With Quote
 
 
 
 
Edward Alfert
Guest
Posts: n/a
 
      12-17-2003
<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
 
 
 
 
V W Wall
Guest
Posts: n/a
 
      12-17-2003
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
 
Oldus Fartus
Guest
Posts: n/a
 
      12-17-2003
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
 
DeMoN LaG
Guest
Posts: n/a
 
      12-17-2003
Oldus Fartus <(E-Mail Removed)> 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
 
Oldus Fartus
Guest
Posts: n/a
 
      12-17-2003
DeMoN LaG wrote:

> Oldus Fartus <(E-Mail Removed)> 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
 
Oldus Fartus
Guest
Posts: n/a
 
      12-17-2003
Oldus Fartus wrote:

> DeMoN LaG wrote:
>
>> Oldus Fartus <(E-Mail Removed)> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Events: Logon vs Account Logon Jeroen Wijnands MCSA 0 03-06-2006 03:45 PM
Question Help: Logon vs Account Logon, Local Logon vs Authentication CJH Microsoft Certification 0 01-04-2006 04:03 PM
What is best practice: Combining anonymous logon with windows logon? Kjell Kristiansson ASP .Net Security 0 11-30-2005 12:53 PM
LOGON without asp-script John ASP .Net 2 08-17-2005 06:18 AM
Problem: XP Home Logon Names Vanish - Cant Logon Graham Computer Support 0 01-24-2004 11:34 AM



Advertisments