xCopy and Vista Profiles

B

Broonie

Hi There,

I'm having some problems with xCopy files to profiles on Vista
machines. I realise robocopy is the copy util to use with vista but
I'm copying via a logon script with a mixed vista and XP environment.
That is also why i'm using "documents and settings" rather than
"users" in the path.

The following command copies the file over properly without any
prompts.

xcopy "\\servername\share\filename" "C:\users\%username%\appdata
\roaming\directory\"

However, the following command gives me an invalid path message

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\"

If I add the file name as below, the file copies but it also asks me
if the destination is a file or directory

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\filename"

Can anyone explain this strange behaviour?
 
G

Gene E. Bloch

Hi There,

I'm having some problems with xCopy files to profiles on Vista
machines. I realise robocopy is the copy util to use with vista but
I'm copying via a logon script with a mixed vista and XP environment.
That is also why i'm using "documents and settings" rather than
"users" in the path.

The following command copies the file over properly without any
prompts.

xcopy "\\servername\share\filename" "C:\users\%username%\appdata
\roaming\directory\"

However, the following command gives me an invalid path message

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\"

If I add the file name as below, the file copies but it also asks me
if the destination is a file or directory

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\filename"

Can anyone explain this strange behaviour?

I can't, but I wonder, can you figure out from the environment which system
the script is running in?

Then you could use an "if" to select one of two xcopy commands.

I think of something like
if exist "C:\Users" then
.... (code for Vista)
else
.... (code for XP)
endif

I haven't used batch files in years, especially in the XP-Vista world, so
even if the idea is workable, my syntax above can be incorrect :)

Looking at the environment for something that might be unique to Vista, I
see the variable %PUBLIC%. That might be a possible thing to test on:

if %public% EQ "%public%" then you're in XP...

HTH,
Gino
 
B

Broonie

I can't, but I wonder, can you figure out from the environment which system
the script is running in?

Then you could use an "if" to select one of two xcopy commands.

I think of something like
if exist "C:\Users" then
... (code for Vista)
else
... (code for XP)
endif

I haven't used batch files in years, especially in the XP-Vista world, so
even if the idea is workable, my syntax above can be incorrect :)

Looking at the environment for something that might be unique to Vista, I
see the variable %PUBLIC%. That might be a possible thing to test on:

if %public% EQ "%public%" then you're in XP...

HTH,
Gino

Yeah, I could do that but surely the standard syntax should work as
"documents and settings" is linked to "users" by the junction in vista?
 
K

Kerry Brown

Broonie said:
Hi There,

I'm having some problems with xCopy files to profiles on Vista
machines. I realise robocopy is the copy util to use with vista but
I'm copying via a logon script with a mixed vista and XP environment.
That is also why i'm using "documents and settings" rather than
"users" in the path.

The following command copies the file over properly without any
prompts.

xcopy "\\servername\share\filename" "C:\users\%username%\appdata
\roaming\directory\"

However, the following command gives me an invalid path message

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\"

If I add the file name as below, the file copies but it also asks me
if the destination is a file or directory

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\filename"

Can anyone explain this strange behaviour?

Try this:

xcopy "\\servername\share\filename" "%APPDATA%\directory"
 
S

Synapse Syndrome [KGB]

Broonie said:
Hi There,

I'm having some problems with xCopy files to profiles on Vista
machines. I realise robocopy is the copy util to use with vista but
I'm copying via a logon script with a mixed vista and XP environment.
That is also why i'm using "documents and settings" rather than
"users" in the path.

The following command copies the file over properly without any
prompts.

xcopy "\\servername\share\filename" "C:\users\%username%\appdata
\roaming\directory\"

However, the following command gives me an invalid path message

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\"

If I add the file name as below, the file copies but it also asks me
if the destination is a file or directory

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\filename"

Can anyone explain this strange behaviour?


You should be using better environmental variables.

Instead of...

xcopy "\\servername\share\filename" "C:\users\%username%\appdata\foo\bar\"

or


xcopy "\\servername\share\filename" "C:\Documents and
Settings\%username%\Application Data\foo bar\"

....you could just use...

xcopy "\\servername\share\filename" %appdata%\foo\bar\


There is also %userprofile%

Try...

echo %userprofile%

and

echo %appdata%

....to familiarise yourself with the variables.

ss.
 
S

Synapse Syndrome [KGB]

Broonie said:
Hi There,

I'm having some problems with xCopy files to profiles on Vista
machines. I realise robocopy is the copy util to use with vista but
I'm copying via a logon script with a mixed vista and XP environment.
That is also why i'm using "documents and settings" rather than
"users" in the path.

The following command copies the file over properly without any
prompts.

xcopy "\\servername\share\filename" "C:\users\%username%\appdata
\roaming\directory\"

However, the following command gives me an invalid path message

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\"

If I add the file name as below, the file copies but it also asks me
if the destination is a file or directory

xcopy "\\servername\share\filename" "C:\Documents and Settings\
%username%\Application Data\directory\filename"

Can anyone explain this strange behaviour?

BTW, you can always add Robocopy to XP, from the Windows Server 2003
Rescource Kit. There is also an updated version, that you can use with XP,
that gets installed along with the Robocopy GUI. This is the preferred
version, for me, as it can correctly keep original folder timestamps.

http://technet.microsoft.com/en-us/magazine/2006.11.utilityspotlight.aspx

ss.
 
B

Broonie

You should be using better environmental variables.

Instead of...

xcopy "\\servername\share\filename" "C:\users\%username%\appdata\foo\bar\"

or

xcopy "\\servername\share\filename" "C:\Documents and
Settings\%username%\Application Data\foo bar\"

...you could just use...

xcopy "\\servername\share\filename" %appdata%\foo\bar\

There is also %userprofile%

Try...

echo %userprofile%

and

echo %appdata%

...to familiarise yourself with the variables.

ss.
I've tried using %appdata% (and %userprofile%) in the destination but
we have "My Documents"/"Documents" mapped to network shares so when
xCopy does a copy using these environment variables it thinks the
destination is NetworkDriveLetter:\C:\Users\username\AppData\Roaming
which is obviously incorrect.
 
S

Synapse Syndrome [KGB]

Broonie said:
I've tried using %appdata% (and %userprofile%) in the destination but
we have "My Documents"/"Documents" mapped to network shares so when
xCopy does a copy using these environment variables it thinks the
destination is NetworkDriveLetter:\C:\Users\username\AppData\Roaming
which is obviously incorrect.

Ah, sorry I did not check what I posted, as what you are doing is a bit
weird. You have to use those sort of environmental variables on the local
source, as they are local variables. Only %username% would be useful in a
remote location.

It's more usual to have scripts running on the central *server*, pulling
data off the workstations. so the UNC paths should be on the destination
side.

If you really have to do it that way around, the only thing I can think of
is to execute the command on the remote location using Sysinternal's PSEXEC,
but it is a bit crazy.

eg.

<after having installed psexec.exe into the local C:\windows\system32
directories, or adding to a folder in your PATH>...

psexec \\servername xcopy "\\servername\share\filename" %appdata%\foo\bar\

ss.
 
S

Synapse Syndrome [KGB]

Synapse Syndrome said:
Ah, sorry I did not check what I posted, as what you are doing is a bit
weird. You have to use those sort of environmental variables on the
local source, as they are local variables. Only %username% would be
useful in a remote location.

It's more usual to have scripts running on the central *server*, pulling
data off the workstations. so the UNC paths should be on the destination
side.

If you really have to do it that way around, the only thing I can think
of is to execute the command on the remote location using Sysinternal's
PSEXEC, but it is a bit crazy.

eg.

<after having installed psexec.exe into the local C:\windows\system32
directories, or adding to a folder in your PATH>...

psexec \\servername xcopy "\\servername\share\filename" %appdata%\foo\bar\

I just thought of a couple of other ways as well, but they are also weird
kludges, for the backwards source/locations you are doing...

You could also make a mapped network drive, and use that drive letter
instead, or you could do the same with the PUSHD command.

ss.
 
B

Broonie

Ah, sorry I did not check what I posted, as what you are doing is a bit
weird.  You have to use those sort of environmental variables on the local
source, as they are local variables.  Only %username% would be useful in a
remote location.

It's more usual to have scripts running on the central *server*, pulling
data off the workstations. so the UNC paths should be on the destination
side.

If you really have to do it that way around, the only thing I can think of
is to execute the command on the remote location using Sysinternal's PSEXEC,
but it is a bit crazy.

eg.

<after having installed psexec.exe into the local C:\windows\system32
directories, or adding to a folder in your PATH>...

psexec \\servername xcopy "\\servername\share\filename" %appdata%\foo\bar\

ss.

It's just a logon script I am running. There's nothing really that
strange in that is there? It basically says that if you find a
particular file on a local system then do a xCopy of another couple of
files from the server to the local machine that is logging on. I'm
pretty sure this method is used quite widely so that is why i'm
confused xCopy can't handle the changes in directory stucture within
Vista.

It's also very strange that xCopy see %appdata% as NetworkDriveLetter:
\C:\user\username\appadata\roaming as opposed to just C:\user\username
\appadata\roaming as it's only My Documents/Documents that we have
mapped to a network drive and not the entire profile. In fact when I
do SET at the command line to see all my environment variables %appdata
% actually says C:\Users\username\AppData\Roaming as should be the
case.
 
G

Gene E. Bloch

Yeah, I could do that but surely the standard syntax should work as
"documents and settings" is linked to "users" by the junction in vista?

Oh yeah. Looks like I forgot that...I'm still pretty much a newbie in
Vista.

I can't find any very convenient environment variable for the test I
suggested. No %version%, for instance. Bummer.
 
H

haunt

Want to get rid of Windows Vista? Discovered that none of the software (and even some hardware) you've been using for years is compatible? You're not alone.

Windows Vista has been out for a year and a half now, and public opinion is still fiercly divided. Those who purchased ultra-fast new computer systems may love it, but the rest of the public, especially those who upgraded an older PC from Windows XP to Windows Vista probably wish they never had.

It's possible to go back to Windows XP, though it may not be easy. Especially not if you purchased a new system with Windows Vista but now find yourself pining for the easy charms (and fast loading times) of Windows XP.

Why would anyone want to go back to Windows XP? Well, because it still works just fine.

After all, you know that Windows XP runs fast, and you know it likes the software applications you've already paid good money for. Windows Vista has a lot of new features, and may prove to be the better OS in the long run, but for right now, many, many users will be better served within the familiar confines of Windows XP.

First the unfortunate truth: There is no 'undo' button for getting rid of Windows Vista. Sadly, there is no easy way to go back to Windows XP as such. you'll either have to remove the entire operating system and start fresh with Windows XP, or do nothing at all.

Making Preparations

Before PCSTATS gets into the nitty-gritty of preparing your computer for a Vista Exorcism, let's go over how to save your essential files, emails and contact information. Vista is going to be completely wiped off your computer forever, so you will need to preserve those precious bits of yourself that are already stored in the ill-fated OS.

If you've used Windows Mail in Vista and can't afford to be without your valuable email messages and contact info, here's how to back it up. Once backed up you can return it to Outlook Express or Windows Mail installed on Windows XP, for that matter.

Backing up E-Mail

Windows Vista stores all emails in the .eml file format at the location 'C:\Users\Username\AppData\Local\Microsoft\WindowsMail\ Local Folders' where 'Username' is the user name that you use in Windows Vista. You will have to enable the viewing of hidden files and folders to navigate to this location. To enable hidden file viewing, open any directory, then go to 'organize/folder and search settings' and click the 'view' tab. Enable the 'view hidden files and folders' option.


As you can see, the directories here mimic the various mail boxes in Windows Mail. Each contains multiple .eml files which correspond to individual email messages. Their names are not particularly revealing, so if you want to be picky about the messages you save, export the whole lot and delete the ones you don't want later. To export these messages to Windows XP, we simply need to copy the data onto removable media such as a USB drive or burn it to a CD. If you have a second hard disk or partition, you can also move the data to a folder there for safekeeping.
 
M

Mike Hall - MVP

Want to get rid of Windows Vista? Discovered that none of the software (and even some hardware) you've been using for years is compatible? You're not alone.

Windows Vista has been out for a year and a half now, and public opinion is still fiercly divided. Those who purchased ultra-fast new computer systems may love it, but the rest of the public, especially those who upgraded an older PC from Windows XP to Windows Vista probably wish they never had.

It's possible to go back to Windows XP, though it may not be easy. Especially not if you purchased a new system with Windows Vista but now find yourself pining for the easy charms (and fast loading times) of Windows XP.

Why would anyone want to go back to Windows XP? Well, because it still works just fine.

After all, you know that Windows XP runs fast, and you know it likes the software applications you've already paid good money for. Windows Vista has a lot of new features, and may prove to be the better OS in the long run, but for right now, many, many users will be better served within the familiar confines of Windows XP.

First the unfortunate truth: There is no 'undo' button for getting rid of Windows Vista. Sadly, there is no easy way to go back to Windows XP as such. you'll either have to remove the entire operating system and start fresh with Windows XP, or do nothing at all.

Making Preparations

Before PCSTATS gets into the nitty-gritty of preparing your computer for a Vista Exorcism, let's go over how to save your essential files, emails and contact information. Vista is going to be completely wiped off your computer forever, so you will need to preserve those precious bits of yourself that are already stored in the ill-fated OS.

If you've used Windows Mail in Vista and can't afford to be without your valuable email messages and contact info, here's how to back it up. Once backed up you can return it to Outlook Express or Windows Mail installed on Windows XP, for that matter.

Backing up E-Mail

Windows Vista stores all emails in the .eml file format at the location 'C:\Users\Username\AppData\Local\Microsoft\WindowsMail\ Local Folders' where 'Username' is the user name that you use in Windows Vista. You will have to enable the viewing of hidden files and folders to navigate to this location. To enable hidden file viewing, open any directory, then go to 'organize/folder and search settings' and click the 'view' tab. Enable the 'view hidden files and folders' option.


As you can see, the directories here mimic the various mail boxes in Windows Mail. Each contains multiple .eml files which correspond to individual email messages. Their names are not particularly revealing, so if you want to be picky about the messages you save, export the whole lot and delete the ones you don't want later. To export these messages to Windows XP, we simply need to copy the data onto removable media such as a USB drive or burn it to a CD. If you have a second hard disk or partition, you can also move the data to a folder there for safekeeping.


None of the software? Even XP couldn't run all old software..

Hardware compatibility was down to the hardware manufacturers.. most rose to the occasion but pensioned off really old hardware.. same happened to people who upgraded to XP..

An ultra fast PC is always a good thing, but Vista does not require an ultra fast PC anymore than XP did back in 2001.

There has to be more regarding the import of EML files into XP. Where is the rest of it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top