![]() |
|
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
<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 |
|
|
|
#3 |
|
Posts: n/a
|
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.) |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
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 |
|
|
|
#6 |
|
Posts: n/a
|
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 |
|
|
|
#7 |
|
Posts: n/a
|
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 |
|