help with bat file to copy NVDA sound files


Robert Cole
 

Dear List,

Every time NVDA updates, It rplaces my custom start and exit sounds.

I can paste this command in the terminal as administrator, but I want to do it as a bat file to make it faster than opening the text file copying the command,

and opening the terminal and pasting it.

I tried creating a bat file with the following line::

cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"

I ran it as adminastrator, but I can not get it to work.

Any suggestions?

Thanks,


Rob


 

On Fri, Oct 28, 2022 at 01:53 PM, Robert Cole wrote:
cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"
-
Presuming multiple WAV files exist in the source folder, command prompt often doesn't like wildcards on full paths when those paths contain any embedded spaces.

In your batch file, I'd try:
cd "C:\Program Files (x86)\NVDA\waves\sounds\"
cp *.wav "C:\Program Files (x86)\NVDA\waves\"
 
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogersr


Robert Cole
 

Hi,

It didn't work.

I guess I'll do it the long way.

Thanks


On 10/28/2022 3:12 PM, Brian Vogel wrote:

On Fri, Oct 28, 2022 at 01:53 PM, Robert Cole wrote:
cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"
-
Presuming multiple WAV files exist in the source folder, command prompt often doesn't like wildcards on full paths when those paths contain any embedded spaces.

In your batch file, I'd try:
cd "C:\Program Files (x86)\NVDA\waves\sounds\" cp *.wav "C:\Program Files (x86)\NVDA\waves\"
 
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogersr


 

What error messages are you getting?

If there are WAV files in the source folder that you've used CD to land in, then cp or copy to another folder has to work unless there is some really weird corruption under Windows.  

All of this presumes you have adequate permissions to write to the destination folder/directory.
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogers


Robert Cole
 

If I press enter on the bat file, nothing happends.

If I choose run as adminastrator,

The UAC opens and I select yes to allow it.

But nothing seems to happen.

But if I press windows+X then choose Terminal Admin,

then paste cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"

it works.



On 10/28/2022 7:53 PM, Brian Vogel wrote:

What error messages are you getting?

If there are WAV files in the source folder that you've used CD to land in, then cp or copy to another folder has to work unless there is some really weird corruption under Windows.  

All of this presumes you have adequate permissions to write to the destination folder/directory.
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogers


Gene
 

how about placing a folder with the wave files you want to use in NVDA.  Then, when the update removes the active files, go into the folder, select all, copy to the clipboard, then paste where you want the files.  Tell Windows to replace the files when asked. 

I don't recall what you are doing now but that may be the easiest and fastest way since the batch file doesn't work.

Gene
On 10/28/2022 6:47 PM, Robert Cole via groups.io wrote:

Hi,

It didn't work.

I guess I'll do it the long way.

Thanks


On 10/28/2022 3:12 PM, Brian Vogel wrote:
On Fri, Oct 28, 2022 at 01:53 PM, Robert Cole wrote:
cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"
-
Presuming multiple WAV files exist in the source folder, command prompt often doesn't like wildcards on full paths when those paths contain any embedded spaces.

In your batch file, I'd try:
cd "C:\Program Files (x86)\NVDA\waves\sounds\" cp *.wav "C:\Program Files (x86)\NVDA\waves\"
 
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogersr



Gene
 

Perhaps your method is as fast as the one I discussed.  At any rate, you now have another method to consider.

Gene

On 10/28/2022 7:06 PM, Robert Cole via groups.io wrote:

If I press enter on the bat file, nothing happends.

If I choose run as adminastrator,

The UAC opens and I select yes to allow it.

But nothing seems to happen.

But if I press windows+X then choose Terminal Admin,

then paste cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"

it works.



On 10/28/2022 7:53 PM, Brian Vogel wrote:
What error messages are you getting?

If there are WAV files in the source folder that you've used CD to land in, then cp or copy to another folder has to work unless there is some really weird corruption under Windows.  

All of this presumes you have adequate permissions to write to the destination folder/directory.
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogers



Robert Cole
 

Yes Gene, thats the way I was doing it. I just wanted a automated way of doing it.


On 10/28/2022 8:29 PM, Gene wrote:

how about placing a folder with the wave files you want to use in NVDA.  Then, when the update removes the active files, go into the folder, select all, copy to the clipboard, then paste where you want the files.  Tell Windows to replace the files when asked. 

I don't recall what you are doing now but that may be the easiest and fastest way since the batch file doesn't work.

Gene
On 10/28/2022 6:47 PM, Robert Cole via groups.io wrote:

Hi,

It didn't work.

I guess I'll do it the long way.

Thanks


On 10/28/2022 3:12 PM, Brian Vogel wrote:
On Fri, Oct 28, 2022 at 01:53 PM, Robert Cole wrote:
cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"
-
Presuming multiple WAV files exist in the source folder, command prompt often doesn't like wildcards on full paths when those paths contain any embedded spaces.

In your batch file, I'd try:
cd "C:\Program Files (x86)\NVDA\waves\sounds\" cp *.wav "C:\Program Files (x86)\NVDA\waves\"
 
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogersr



Robert Cole
 

Brian I got it to work.

I had to change cp to copy, and add two and signs see below:

cd "C:\Program Files (x86)\NVDA\waves\sounds\" && copy *.wav "C:\Program Files (x86)\NVDA\waves\"

My original command also works, see below:

cd "C:\Program Files (x86)\NVDA\waves\sounds\" && copy *.wav "C:\Program Files (x86)\NVDA\waves\"


Running these bat files as adminastrator works great.

Thanks,

Rob

 


On 10/28/2022 3:12 PM, Brian Vogel wrote:

On Fri, Oct 28, 2022 at 01:53 PM, Robert Cole wrote:
cp "C:\Program Files (x86)\NVDA\waves\sounds\*.wav" "C:\Program Files (x86)\NVDA\waves\"
-
Presuming multiple WAV files exist in the source folder, command prompt often doesn't like wildcards on full paths when those paths contain any embedded spaces.

In your batch file, I'd try:
cd "C:\Program Files (x86)\NVDA\waves\sounds\" cp *.wav "C:\Program Files (x86)\NVDA\waves\"
 
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogersr


 

Rob,

I had always presumed you were running these BAT files under a user account with administrative privilege, as working in system folders like "C:\Program Files (x86)" requires that level of permission.

Glad to hear you have this automated for future use.
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged.  One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.

    ~ John Rogers


Brian's Mail list account
 

Obviously you would not want any mouse clicking tom Dick or Harry to do something rash!

Brian

--
bglists@...
Sent via blueyonder.(Virgin media)
Please address personal E-mail to:-
briang1@..., putting 'Brian Gaff'
in the display name field.

----- Original Message -----
From: "Brian Vogel" <britechguy@...>
To: <chat@nvda.groups.io>
Sent: Saturday, October 29, 2022 3:21 AM
Subject: Re: [chat] help with bat file to copy NVDA sound files


Rob,

I had always presumed you were running these BAT files under a user account with administrative privilege, as working in system folders like "C:\Program Files (x86)" requires that level of permission.

Glad to hear you have this automated for future use.
--

Brian - Windows 10, 64-Bit, Version 22H2, Build 19045

*There are two novels that can change a bookish fourteen-year-old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs.*

~ John Rogers