I have been using the RUN xcopy in an application using variables with no
problem until I installed it in a Vista Operating system.
from = "C:\PFILES\*.*"
to = "C:\BACKUP"
RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in VISTA

This will run in VISTA
RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"

If I try and use the variables like in XP it will not run. There is no error
but the command window comes up and then shuts down.
I need the variables as they are field inputs that the user enters.
Any suggestion would be appreciated.
TonySper

Re: RUN xcopy COMMAND IN VISTA by Cy

Cy
Sun Sep 23 16:50:21 PDT 2007

generate the entire run line as a text string (minus the run) and then use
macro substitution to run the string, example provided below:

runstring = [XCOPY "]+trim(from)+[" "]+trim(to)+["]
run &runstring

This should work in any OS as far as I know. Effectively this has the
affect of actually doing:

RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"

But allows for the from and to portion to be different.

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>I have been using the RUN xcopy in an application using variables with no
>problem until I installed it in a Vista Operating system.
> from = "C:\PFILES\*.*"
> to = "C:\BACKUP"
> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in VISTA
>
> This will run in VISTA
> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>
> If I try and use the variables like in XP it will not run. There is no
> error but the command window comes up and then shuts down.
> I need the variables as they are field inputs that the user enters.
> Any suggestion would be appreciated.
> TonySper
>
>

Re: RUN xcopy COMMAND IN VISTA by Fred

Fred
Sun Sep 23 16:56:06 PDT 2007

Does "RUN XCOPY (from) (to)" work? But you really should use better
variable names as "from" and "to" are reserved words.

--
Fred
Microsoft Visual FoxPro MVP


"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>I have been using the RUN xcopy in an application using variables with no
>problem until I installed it in a Vista Operating system.
> from = "C:\PFILES\*.*"
> to = "C:\BACKUP"
> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in VISTA
>
> This will run in VISTA
> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>
> If I try and use the variables like in XP it will not run. There is no
> error but the command window comes up and then shuts down.
> I need the variables as they are field inputs that the user enters.
> Any suggestion would be appreciated.
> TonySper
>
>



Re: RUN xcopy COMMAND IN VISTA by TonySper

TonySper
Sun Sep 23 18:08:26 PDT 2007

Fred,
No I just used them as examples to show direction. Sorry I should have used
better examples.
Tony

"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:O%23ZrA0j$HHA.1204@TK2MSFTNGP03.phx.gbl...
> Does "RUN XCOPY (from) (to)" work? But you really should use better
> variable names as "from" and "to" are reserved words.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>>I have been using the RUN xcopy in an application using variables with no
>>problem until I installed it in a Vista Operating system.
>> from = "C:\PFILES\*.*"
>> to = "C:\BACKUP"
>> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in
>> VISTA
>>
>> This will run in VISTA
>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>
>> If I try and use the variables like in XP it will not run. There is no
>> error but the command window comes up and then shuts down.
>> I need the variables as they are field inputs that the user enters.
>> Any suggestion would be appreciated.
>> TonySper
>>
>>
>
>



Re: RUN xcopy COMMAND IN VISTA by TonySper

TonySper
Sun Sep 23 18:15:48 PDT 2007

Cy,
You de man. Works great. I still do not know why it works with XP and 98 and
95 but not Vista. What did they do with Vista to inhibit this??
Tony

"Cy Welch" <cywelch@hotmail.com> wrote in message
news:6984E204-000F-495E-A699-A73905305793@microsoft.com...
> generate the entire run line as a text string (minus the run) and then use
> macro substitution to run the string, example provided below:
>
> runstring = [XCOPY "]+trim(from)+[" "]+trim(to)+["]
> run &runstring
>
> This should work in any OS as far as I know. Effectively this has the
> affect of actually doing:
>
> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>
> But allows for the from and to portion to be different.
>
> --
> Cy Welch
> Senior Programmer/Analyst
> MetSYS Inc.
> http://www.metsysinc.com
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>>I have been using the RUN xcopy in an application using variables with no
>>problem until I installed it in a Vista Operating system.
>> from = "C:\PFILES\*.*"
>> to = "C:\BACKUP"
>> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in
>> VISTA
>>
>> This will run in VISTA
>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>
>> If I try and use the variables like in XP it will not run. There is no
>> error but the command window comes up and then shuts down.
>> I need the variables as they are field inputs that the user enters.
>> Any suggestion would be appreciated.
>> TonySper
>>
>>



Re: RUN xcopy COMMAND IN VISTA by Anders

Anders
Mon Sep 24 02:19:26 PDT 2007

Does this work
RUN XCOPY "&FROM" "&TO"
?
-Anders

"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>I have been using the RUN xcopy in an application using variables with no
>problem until I installed it in a Vista Operating system.
> from = "C:\PFILES\*.*"
> to = "C:\BACKUP"
> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in VISTA
>
> This will run in VISTA
> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>
> If I try and use the variables like in XP it will not run. There is no
> error but the command window comes up and then shuts down.
> I need the variables as they are field inputs that the user enters.
> Any suggestion would be appreciated.
> TonySper
>
>



Re: RUN xcopy COMMAND IN VISTA by TonySper

TonySper
Mon Sep 24 10:03:31 PDT 2007

Anders,
Yes it does work. It appears it does not like the folder in quotes before
you use the macro as I had the from and to variables in quotes before I used
the macro and it did not work. No wonder I have lost most of my hair. Still
the question is why does it work in XP and 98 and 95 and not in Vista.
Tony

"Anders Altberg" <anders.altberg> wrote in message
news:%23nk8D8o$HHA.5164@TK2MSFTNGP05.phx.gbl...
> Does this work
> RUN XCOPY "&FROM" "&TO"
> ?
> -Anders
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>>I have been using the RUN xcopy in an application using variables with no
>>problem until I installed it in a Vista Operating system.
>> from = "C:\PFILES\*.*"
>> to = "C:\BACKUP"
>> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in
>> VISTA
>>
>> This will run in VISTA
>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>
>> If I try and use the variables like in XP it will not run. There is no
>> error but the command window comes up and then shuts down.
>> I need the variables as they are field inputs that the user enters.
>> Any suggestion would be appreciated.
>> TonySper
>>
>>
>
>



Re: RUN xcopy COMMAND IN VISTA by Cy

Cy
Mon Sep 24 20:54:54 PDT 2007

Vista changes some of the rules having to do with the need for quotes from
what I have seen. Since putting quotes seems to ALWAYS work, setting up the
line like that seems to work better.

Did you use the trim() also? I have seen that seem to make a difference in
Vista as well.

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:#PXluhk$HHA.4200@TK2MSFTNGP04.phx.gbl...
> Cy,
> You de man. Works great. I still do not know why it works with XP and 98
> and 95 but not Vista. What did they do with Vista to inhibit this??
> Tony
>
> "Cy Welch" <cywelch@hotmail.com> wrote in message
> news:6984E204-000F-495E-A699-A73905305793@microsoft.com...
>> generate the entire run line as a text string (minus the run) and then
>> use macro substitution to run the string, example provided below:
>>
>> runstring = [XCOPY "]+trim(from)+[" "]+trim(to)+["]
>> run &runstring
>>
>> This should work in any OS as far as I know. Effectively this has the
>> affect of actually doing:
>>
>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>
>> But allows for the from and to portion to be different.
>>
>> --
>> Cy Welch
>> Senior Programmer/Analyst
>> MetSYS Inc.
>> http://www.metsysinc.com
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>>>I have been using the RUN xcopy in an application using variables with no
>>>problem until I installed it in a Vista Operating system.
>>> from = "C:\PFILES\*.*"
>>> to = "C:\BACKUP"
>>> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in
>>> VISTA
>>>
>>> This will run in VISTA
>>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>>
>>> If I try and use the variables like in XP it will not run. There is no
>>> error but the command window comes up and then shuts down.
>>> I need the variables as they are field inputs that the user enters.
>>> Any suggestion would be appreciated.
>>> TonySper
>>>
>>>
>
>

Re: RUN xcopy COMMAND IN VISTA by Cy

Cy
Mon Sep 24 21:03:11 PDT 2007

Tony,

One thing I have found is that most of the stuff that I have to do to work
in Vista seems to work fine in earlier versions, and many of the changes in
Vista were to make things more predictable and reliable. Since sometimes
you needed quotes before and sometimes not, using them all the time just
seems to work better. I have found that most of the stuff that I use that
already followed MS best practices before Vista seems to work quite well in
Vista.

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"TonySper" <tsperduti@nospambellsouth.net> wrote in message
news:elO#Tzs$HHA.5328@TK2MSFTNGP05.phx.gbl...
> Anders,
> Yes it does work. It appears it does not like the folder in quotes before
> you use the macro as I had the from and to variables in quotes before I
> used the macro and it did not work. No wonder I have lost most of my hair.
> Still the question is why does it work in XP and 98 and 95 and not in
> Vista.
> Tony
>
> "Anders Altberg" <anders.altberg> wrote in message
> news:%23nk8D8o$HHA.5164@TK2MSFTNGP05.phx.gbl...
>> Does this work
>> RUN XCOPY "&FROM" "&TO"
>> ?
>> -Anders
>>
>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>> news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>>>I have been using the RUN xcopy in an application using variables with no
>>>problem until I installed it in a Vista Operating system.
>>> from = "C:\PFILES\*.*"
>>> to = "C:\BACKUP"
>>> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in
>>> VISTA
>>>
>>> This will run in VISTA
>>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>>
>>> If I try and use the variables like in XP it will not run. There is no
>>> error but the command window comes up and then shuts down.
>>> I need the variables as they are field inputs that the user enters.
>>> Any suggestion would be appreciated.
>>> TonySper
>>>
>>>
>>
>>
>
>

Re: RUN xcopy COMMAND IN VISTA by TonySper

TonySper
Tue Sep 25 08:06:06 PDT 2007

Cy,
Yes I did use the trim as you suggested. Also note that Anders suggested RUN
XCOPY "&FROM" "&TO" and that also worked. Now if I can figure out how to
open up a word application so that it does not stay on the taskbar when I
open it in Vista I may be able to get some work done.
Thanks
Tony


"Cy Welch" <cywelch@hotmail.com> wrote in message
news:29119805-4C19-4F7F-B774-0883ECF5582C@microsoft.com...
> Vista changes some of the rules having to do with the need for quotes from
> what I have seen. Since putting quotes seems to ALWAYS work, setting up
> the line like that seems to work better.
>
> Did you use the trim() also? I have seen that seem to make a difference
> in Vista as well.
>
> --
> Cy Welch
> Senior Programmer/Analyst
> MetSYS Inc.
> http://www.metsysinc.com
>
> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
> news:#PXluhk$HHA.4200@TK2MSFTNGP04.phx.gbl...
>> Cy,
>> You de man. Works great. I still do not know why it works with XP and 98
>> and 95 but not Vista. What did they do with Vista to inhibit this??
>> Tony
>>
>> "Cy Welch" <cywelch@hotmail.com> wrote in message
>> news:6984E204-000F-495E-A699-A73905305793@microsoft.com...
>>> generate the entire run line as a text string (minus the run) and then
>>> use macro substitution to run the string, example provided below:
>>>
>>> runstring = [XCOPY "]+trim(from)+[" "]+trim(to)+["]
>>> run &runstring
>>>
>>> This should work in any OS as far as I know. Effectively this has the
>>> affect of actually doing:
>>>
>>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>>
>>> But allows for the from and to portion to be different.
>>>
>>> --
>>> Cy Welch
>>> Senior Programmer/Analyst
>>> MetSYS Inc.
>>> http://www.metsysinc.com
>>>
>>> "TonySper" <tsperduti@nospambellsouth.net> wrote in message
>>> news:uktKGij$HHA.5652@TK2MSFTNGP05.phx.gbl...
>>>>I have been using the RUN xcopy in an application using variables with
>>>>no problem until I installed it in a Vista Operating system.
>>>> from = "C:\PFILES\*.*"
>>>> to = "C:\BACKUP"
>>>> RUN XCOPY &FROM &TO &&This works OK in XP or 98 but not in
>>>> VISTA
>>>>
>>>> This will run in VISTA
>>>> RUN XCOPY "C:\PFILES\*.*" "C:\BACKUP"
>>>>
>>>> If I try and use the variables like in XP it will not run. There is no
>>>> error but the command window comes up and then shuts down.
>>>> I need the variables as they are field inputs that the user enters.
>>>> Any suggestion would be appreciated.
>>>> TonySper
>>>>
>>>>
>>
>>