Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
scripting 'My Documents'
Name: Sebastian42 Date: September 28, 2007 at 18:14:21 Pacific OS: WinMe CPU/Ram: PIII/256Mb Product: generic
Comment:
In a batch file, if I write "copy C:\My Documents\testfile.txt C:\" the response is 'Too many parameters' if I write "copy C:\My Doc~1\testfile.txt C:\" the response is 'Too many parameters' if I write "copy C:\My_Doc~1\testfile.txt C:\" the response is 'File not found' How should 'My Documents' be scripted to 'work' in a batch file ?
Name: Sebastian42 Date: September 29, 2007 at 00:12:47 Pacific
Reply:
Nice-feeling-tonight Razor2.3 I WILL try - but you seem to imply that spaces can just be ignored IN THIS CONTEXT.
Basty
0
Response Number 3
Name: StuartS Date: September 29, 2007 at 03:40:50 Pacific
Reply:
Sebastian
You will notice that in the first example posted by Razor C:\My Documents\testfile.txt is enclosed in double quotes which forces the processor to treat the entire path name as a single entity. Without he quotes the spaces become a delimiter. Hence the to many parameters.
In the second example the first six characters of My Documents, minus spaces are used plus ~1 to give the short file name of eight characters. You can't arbitrarily make up your own short name. You have to use the one generated by the system which follows a well defined set of rules which includes the elimination of spaces.
Name: Sebastian42 Date: September 30, 2007 at 04:00:37 Pacific
Reply:
StuartS Thanks for drawing my attention to that - it had escaped me ! I was a bit puzzled by that cryptic reply.
I AM aware of DOS's (?) habit of truncating long names at the sixth letter then, adding '~1'
Basty
0
Response Number 5
Name: StuartS Date: September 30, 2007 at 04:44:48 Pacific
Reply:
>>I AM aware of DOS's (?) habit ... <<
It's not DOS's habit, its Window's that does it by design. DOS has no knowlege or understanding of long file names. That is why Windows has to truncate them.
Summary: I'm trying to create a simple batch backup script that will scan the directory (C:\Documents and Settins\<user>\My Documents) and copy all of the documents under a certain file size to a pre-define...
Summary: Do you guys see anything wrong with the following code? I am trying to compress all Publisher files on my comp using 7z. (Using the Tugzip Script Editor). All Publisher files are located in My Documen...
Summary: I am having trouble with the user logins! (the error I am getting is when you login!) Please Help ========================================= @ECHO OFF CD C:\Documents and Settings\%username%\My Docume...