hidden hit counter
Welcome to WindowsForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

profiles dir

 
   Win 2000/NT/98/ME (Home) -> File System RSS
Next:  Set UNIX Attributes by Command line  
Author Message
Bertoldino

External


Since: Dec 13, 2007
Posts: 17



(Msg. 1) Posted: Thu Jan 17, 2008 6:03 am
Post subject: profiles dir
Archived from groups: microsoft>public>win2000>file_system (more info?)

hi all Smile
and sorry for my wobbly english... Wink

i have one problem and two ways i'd like to solve it... but I'm not able to
do what i thought, lol Smile

in a .cmd file i need to change/set the volume to the one in wich i set the
"documents and settings" directory.
notice that i used unattended.sif to set it in different volumes , not "C"
....

i know i can retrieve %userprofile% variable

but if e.g. I have "r:\docs_and_sets\james"

and i need to retrieve the "r:\docs_and_sets" value (wothout the %username%)
, what variable i have to look for?

or

how can i know that the right volume is "R:" ?

i don't know how to do the string operations or how to retrieve the
variables with the correct value Smile

OSes: win2000, XP, (Vista)

thanx! Smile

 >> Stay informed about: profiles dir 
Back to top
Login to vote
"Pegasus

External


Since: Dec 22, 2007
Posts: 81



(Msg. 2) Posted: Thu Jan 17, 2008 11:53 am
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bertoldino" wrote in message

> hi all Smile
> and sorry for my wobbly english... Wink
>
> i have one problem and two ways i'd like to solve it... but I'm not able
> to
> do what i thought, lol Smile
>
> in a .cmd file i need to change/set the volume to the one in wich i set
> the
> "documents and settings" directory.
> notice that i used unattended.sif to set it in different volumes , not "C"
> ...
>
> i know i can retrieve %userprofile% variable
>
> but if e.g. I have "r:\docs_and_sets\james"
>
> and i need to retrieve the "r:\docs_and_sets" value (wothout the
> %username%)
> , what variable i have to look for?
>
> or
>
> how can i know that the right volume is "R:" ?
>
> i don't know how to do the string operations or how to retrieve the
> variables with the correct value Smile
>
> OSes: win2000, XP, (Vista)
>
> thanx! Smile
>
>

You can extract the drive letter like so:
@echo off
echo Drive Letter = %UserProfile:~0,2%

and the folder name like so:
@echo off
call echo Profile folder = %UserProfile:%Username%=%

(provided that %UserName% is set as expected)

 >> Stay informed about: profiles dir 
Back to top
Login to vote
Bertoldino

External


Since: Dec 13, 2007
Posts: 17



(Msg. 3) Posted: Thu Jan 17, 2008 12:13 pm
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pegasus (MVP) wrote:

> You can extract the drive letter like so:
> @echo off
> echo Drive Letter = %UserProfile:~0,2%


perfect! this works!

> and the folder name like so:
> @echo off
> call echo Profile folder = %UserProfile:%Username%=%
>
> (provided that %UserName% is set as expected)

this doesn't seem to work Sad

but THANKS for the first info!!
 >> Stay informed about: profiles dir 
Back to top
Login to vote
"Pegasus

External


Since: Dec 22, 2007
Posts: 81



(Msg. 4) Posted: Thu Jan 17, 2008 1:12 pm
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bertoldino" wrote in message

> Pegasus (MVP) wrote:
>
>> You can extract the drive letter like so:
>> @echo off
>> echo Drive Letter = %UserProfile:~0,2%
>
>
> perfect! this works!
>
>> and the folder name like so:
>> @echo off
>> call echo Profile folder = %UserProfile:%Username%=%
>>
>> (provided that %UserName% is set as expected)
>
> this doesn't seem to work Sad
>
> but THANKS for the first info!!

As I said - it depends on the value of %Username%. There
are other solutions but they are more involved. If the drive
letter solution is sufficient then you should use it.
 >> Stay informed about: profiles dir 
Back to top
Login to vote
Bertoldino

External


Since: Dec 13, 2007
Posts: 17



(Msg. 5) Posted: Thu Jan 17, 2008 3:50 pm
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pegasus (MVP) wrote:

>>> and the folder name like so:
>>> @echo off
>>> call echo Profile folder = %UserProfile:%Username%=%
>>>
>>> (provided that %UserName% is set as expected)
>>
>> this doesn't seem to work Sad
>>
>> but THANKS for the first info!!
>
> As I said - it depends on the value of %Username%. There
> are other solutions but they are more involved. If the drive
> letter solution is sufficient then you should use it.

can you explain me how the formula have to work in your intentions and in
which way we have to expect %username% is set?

is %userprofile:%username% a string subtraction?
 >> Stay informed about: profiles dir 
Back to top
Login to vote
"Pegasus

External


Since: Dec 22, 2007
Posts: 81



(Msg. 6) Posted: Thu Jan 17, 2008 5:38 pm
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bertoldino" wrote in message

> Pegasus (MVP) wrote:
>
>>>> and the folder name like so:
>>>> @echo off
>>>> call echo Profile folder = %UserProfile:%Username%=%
>>>>
>>>> (provided that %UserName% is set as expected)
>>>
>>> this doesn't seem to work Sad
>>>
>>> but THANKS for the first info!!
>>
>> As I said - it depends on the value of %Username%. There
>> are other solutions but they are more involved. If the drive
>> letter solution is sufficient then you should use it.
>
> can you explain me how the formula have to work in your intentions and in
> which way we have to expect %username% is set?
>
> is %userprofile:%username% a string subtraction?
>
>

No, it is a string substitution. Consider these commands:

set name=Bertoldino
echo %name:o=a% (yields "Bertoldina")
echo %name:ino=% (yields "Bertold")

My second batch file attempted to remove the user name from
the "%UserProfile%" variable. This will only work if the user
name is contained %UserProfile%, which is not necessarily
true.

A further degree of complexity arises when the substitution
string is in itself a variable. With a bit of black magic (that
is undocumented and unexplainable) the problem can be
resolved with the "call" statement.
 >> Stay informed about: profiles dir 
Back to top
Login to vote
Bertoldino

External


Since: Dec 13, 2007
Posts: 17



(Msg. 7) Posted: Fri Jan 18, 2008 6:25 am
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pegasus (MVP) wrote:

> My second batch file attempted to remove the user name from
> the "%UserProfile%" variable. This will only work if the user
> name is contained %UserProfile%, which is not necessarily
> true.
>
> A further degree of complexity arises when the substitution
> string is in itself a variable. With a bit of black magic (that
> is undocumented and unexplainable) the problem can be
> resolved with the "call" statement.

yeah!
that's the magic!
1) it works
2) i understand!

thanks, great!

....your blog/website? Smile
 >> Stay informed about: profiles dir 
Back to top
Login to vote
"Pegasus

External


Since: Dec 22, 2007
Posts: 81



(Msg. 8) Posted: Fri Jan 18, 2008 6:25 am
Post subject: Re: profiles dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bertoldino" wrote in message

> Pegasus (MVP) wrote:
>
>> My second batch file attempted to remove the user name from
>> the "%UserProfile%" variable. This will only work if the user
>> name is contained %UserProfile%, which is not necessarily
>> true.
>>
>> A further degree of complexity arises when the substitution
>> string is in itself a variable. With a bit of black magic (that
>> is undocumented and unexplainable) the problem can be
>> resolved with the "call" statement.
>
> yeah!
> that's the magic!
> 1) it works
> 2) i understand!
>
> thanks, great!
>
> ...your blog/website? Smile

Thanks for the feedback. Sorry, no web site.
 >> Stay informed about: profiles dir 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Windows 2000 Server - Roaming Profiles - Hi we are running Windows 2000 server using roaming profiles. Our hard disk is running low on space. Is there anything to be gained by moving "my documents" (i.e right click on icon and select move on the workstation) to another partition o...

Unattended Install and moving Profiles to different drive - Guys, Can someone point me to an easily understandable guide for doing an unattended windows setup or have the patience to help me here.... My aim is, after being a presented a server, with 4 disks, I would like to create 2 mirrors out of this, and..

offline folder syncronization - does offline folder synchronization create a log file?? Where is it located. I need this file to troubleshoot offline folder sync, as i have a couple of Laptop users that sometimes after a sync, the user logs back onto their Laptop and there are no..

Deleting files doesn't increase free disk space - I have a two-machine network such that I make disk images of Machine 1 and then copy them for archiving to Machine 2. The disk I copy them to on Machine 2 is an NTFS volume on Windows 2000. When I want to copy the most recent Machine 1 disk image, I....

200GB Harddisks only recognised 128GB? - I wonder what is the problem and if there is any solution. The Motherboard is Intel D865GLC and the BIOS reported the Harddisk as 200GB The 4 harddisks model are Seagate ST3200822A. All of them reported 128GB in Computer Management.
   Win 2000/NT/98/ME (Home) -> File System All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows XP
  Win 2000/NT/98/ME
 Windows Vista!


[ Contact us | Terms of Service/Privacy Policy ]