Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Running Batch Files in VISTA

Reply
Thread Tools Display Modes

Running Batch Files in VISTA

 
 
Peeky
Guest
Posts: n/a

 
      06-23-2007

::I have a need to run a simple batch file that contains “copy”
statements so that my important files are secured on a different medium.
Within Vista, as far as I am aware, you can only run .bat files as the
administrator. If you double click on a batch file it simply opens the
program that is associated with it, like a text editor. There may be a
way to change the association so that double clicking a batch file
(.bat) will make it run. I tried to find this out but to no avail so I
have written a VBScipt that does what I want.::

::You supply the files you want to copy, along with their target files,
in a configuration file (.ini) which the VBScript reads. An initial
check is performed to ensure that BOTH source (full file name) and
target (drive) exists. The .ini filename is specified as a runtime
parameter so that different ones can be used by the same VBScript.::

::An output file (.txt) is produced detailing which files were copied
and their target destinations. This file is always produced and can be
either appended to or created each time the script is run. The only
interaction between the user and the VBScipt is an error message if
during running a problem arises.::

::The VBScript has been compiled to an .exe file and if anybody is
interested I will gladly let them have it for FREE, along with detailed
instructions on how to run it.::

::I have been using this now for three weeks and it works fine but any
comments would be appreciated.::


--
Peeky
 
Reply With Quote
 
 
 
 
DefecTalisman
Guest
Posts: n/a

 
      06-23-2007
Currently using XCOPY in a batch.
If you would send the compiled *.exe I would love to try it out.


"Peeky" <> wrote in message
news:...
>
> ::I have a need to run a simple batch file that contains "copy"
> statements so that my important files are secured on a different medium.
> Within Vista, as far as I am aware, you can only run .bat files as the
> administrator. If you double click on a batch file it simply opens the
> program that is associated with it, like a text editor. There may be a
> way to change the association so that double clicking a batch file
> (.bat) will make it run. I tried to find this out but to no avail so I
> have written a VBScipt that does what I want.::
>
> ::You supply the files you want to copy, along with their target files,
> in a configuration file (.ini) which the VBScript reads. An initial
> check is performed to ensure that BOTH source (full file name) and
> target (drive) exists. The .ini filename is specified as a runtime
> parameter so that different ones can be used by the same VBScript.::
>
> ::An output file (.txt) is produced detailing which files were copied
> and their target destinations. This file is always produced and can be
> either appended to or created each time the script is run. The only
> interaction between the user and the VBScipt is an error message if
> during running a problem arises.::
>
> ::The VBScript has been compiled to an .exe file and if anybody is
> interested I will gladly let them have it for FREE, along with detailed
> instructions on how to run it.::
>
> ::I have been using this now for three weeks and it works fine but any
> comments would be appreciated.::
>
>
> --
> Peeky


 
Reply With Quote
 
DefecTalisman
Guest
Posts: n/a

 
      06-23-2007
The thing is my batch file is run via a autorun.ini which is directed to
browsercall.exe and then the batch. So when ever I plug my USB backup drive
in it asks me weather I want to back up, if answered yes it automatically
backs up any newer files and folders. I wrote it so it is backward
compatible to any OS that supports the USB drive. Also the batch has links
to almost every system function in vista and xp. Never tried running it out
of admin though. I know some system commands wont work unless in admin
account. But XCOPY and COPY should.



"Peeky" <> wrote in message
news:...
>
> ::I have a need to run a simple batch file that contains "copy"
> statements so that my important files are secured on a different medium.
> Within Vista, as far as I am aware, you can only run .bat files as the
> administrator. If you double click on a batch file it simply opens the
> program that is associated with it, like a text editor. There may be a
> way to change the association so that double clicking a batch file
> (.bat) will make it run. I tried to find this out but to no avail so I
> have written a VBScipt that does what I want.::
>
> ::You supply the files you want to copy, along with their target files,
> in a configuration file (.ini) which the VBScript reads. An initial
> check is performed to ensure that BOTH source (full file name) and
> target (drive) exists. The .ini filename is specified as a runtime
> parameter so that different ones can be used by the same VBScript.::
>
> ::An output file (.txt) is produced detailing which files were copied
> and their target destinations. This file is always produced and can be
> either appended to or created each time the script is run. The only
> interaction between the user and the VBScipt is an error message if
> during running a problem arises.::
>
> ::The VBScript has been compiled to an .exe file and if anybody is
> interested I will gladly let them have it for FREE, along with detailed
> instructions on how to run it.::
>
> ::I have been using this now for three weeks and it works fine but any
> comments would be appreciated.::
>
>
> --
> Peeky


 
Reply With Quote
 
Peeky
Guest
Posts: n/a

 
      06-23-2007

DefecTalisman,

Thank you for your interest. If you email me on:
will send you a zip file. This will give you enough information o
running my program. Let me know how you get on and by the way how do yo
run .bat files

--
Peeky
 
Reply With Quote
 
DefecTalisman
Guest
Posts: n/a

 
      06-23-2007
Run them in admin. Never tried out of, am off to give it whirl and see what
I can come up with.
I modified my default settings for command console so that it appears full
screen on my comp with a bigger frame buffer.
Did you notice the revival of "CHOICE" in vista? Buggered if I will use it
due to none backward compatibility with XP. Rather stick with my
set CHOICE =
set /p choice=

(NB: underscore not space, underline seems to
make underscore invisible)



"Peeky" <> wrote in message
news:...
>
> DefecTalisman,
>
> Thank you for your interest. If you email me on: I
> will send you a zip file. This will give you enough information on
> running my program. Let me know how you get on and by the way how do you
> run .bat files?
>
>
> --
> Peeky


 
Reply With Quote
 
Beverly Brown
Guest
Posts: n/a

 
      06-23-2007
I don't have any problems running .bat files. I just double-click them or
open a command prompt and run them from there.

Are you sure the extension is right? If you leave the file extensions for
know file types hidden (the default) the file will look like a batch file
but the real name will be foo.bat.txt and you won't be able to see the .txt.
In an explorer window go to organize->folder options->view and uncheck "hide
extensions of known file types".

<soapbox>
I really wish Microsoft didn't do this as a default. It causes a lot of
confusion and even helps spread email viruses because people think they have
a .txt file attachment when it is really a .txt.exe file. They just can't
see it because the real extension is hidden.
</soapbox>

Beverly

"Peeky" <> wrote in message
news:...
>
> ::I have a need to run a simple batch file that contains "copy"
> statements so that my important files are secured on a different medium.
> Within Vista, as far as I am aware, you can only run .bat files as the
> administrator. If you double click on a batch file it simply opens the
> program that is associated with it, like a text editor. There may be a
> way to change the association so that double clicking a batch file
> (.bat) will make it run. I tried to find this out but to no avail so I
> have written a VBScipt that does what I want.::
>
> ::You supply the files you want to copy, along with their target files,
> in a configuration file (.ini) which the VBScript reads. An initial
> check is performed to ensure that BOTH source (full file name) and
> target (drive) exists. The .ini filename is specified as a runtime
> parameter so that different ones can be used by the same VBScript.::
>
> ::An output file (.txt) is produced detailing which files were copied
> and their target destinations. This file is always produced and can be
> either appended to or created each time the script is run. The only
> interaction between the user and the VBScipt is an error message if
> during running a problem arises.::
>
> ::The VBScript has been compiled to an .exe file and if anybody is
> interested I will gladly let them have it for FREE, along with detailed
> instructions on how to run it.::
>
> ::I have been using this now for three weeks and it works fine but any
> comments would be appreciated.::
>
>
> --
> Peeky


 
Reply With Quote
 
DefecTalisman
Guest
Posts: n/a

 
      06-23-2007
To true.


"Beverly Brown" <> wrote in message
news:ABCF9A4E-50BA-4650-A251-...
>I don't have any problems running .bat files. I just double-click them or
>open a command prompt and run them from there.
>
> Are you sure the extension is right? If you leave the file extensions for
> know file types hidden (the default) the file will look like a batch file
> but the real name will be foo.bat.txt and you won't be able to see the
> .txt. In an explorer window go to organize->folder options->view and
> uncheck "hide extensions of known file types".
>
> <soapbox>
> I really wish Microsoft didn't do this as a default. It causes a lot of
> confusion and even helps spread email viruses because people think they
> have a .txt file attachment when it is really a .txt.exe file. They just
> can't see it because the real extension is hidden.
> </soapbox>
>
> Beverly
>
> "Peeky" <> wrote in message
> news:...
>>
>> ::I have a need to run a simple batch file that contains "copy"
>> statements so that my important files are secured on a different medium.
>> Within Vista, as far as I am aware, you can only run .bat files as the
>> administrator. If you double click on a batch file it simply opens the
>> program that is associated with it, like a text editor. There may be a
>> way to change the association so that double clicking a batch file
>> (.bat) will make it run. I tried to find this out but to no avail so I
>> have written a VBScipt that does what I want.::
>>
>> ::You supply the files you want to copy, along with their target files,
>> in a configuration file (.ini) which the VBScript reads. An initial
>> check is performed to ensure that BOTH source (full file name) and
>> target (drive) exists. The .ini filename is specified as a runtime
>> parameter so that different ones can be used by the same VBScript.::
>>
>> ::An output file (.txt) is produced detailing which files were copied
>> and their target destinations. This file is always produced and can be
>> either appended to or created each time the script is run. The only
>> interaction between the user and the VBScipt is an error message if
>> during running a problem arises.::
>>
>> ::The VBScript has been compiled to an .exe file and if anybody is
>> interested I will gladly let them have it for FREE, along with detailed
>> instructions on how to run it.::
>>
>> ::I have been using this now for three weeks and it works fine but any
>> comments would be appreciated.::
>>
>>
>> --
>> Peeky

>


 
Reply With Quote
 
Peeky
Guest
Posts: n/a

 
      06-23-2007

Beverly Brown,

What if you want to schedule the .bat file

--
Peeky
 
Reply With Quote
 
cquirke (MVP Windows shell/user)
Guest
Posts: n/a

 
      06-24-2007
On Sat, 23 Jun 2007 12:43:58 +0200, "DefecTalisman"
<> wrote:

>The thing is my batch file is run via a autorun.ini


Autorun.ini or Autorun.inf?

Personally, I prefer not to have automatic processing of Autorun.inf,
as many malware use this to infect USB sticks, etc.

Instead, I'd prolly use a QuickLaunch shortcut (easy access, no matter
how cluttered the desktop) to run the utility, so it can operate on
any out-the-box USB drive etc. I can then set that shortcut to run as
admin, if need be, and I'm not affecting other PCs [*1].

If knowing which drive letter to copy to is a problem, then you can
"seed" your USB stick with a marker file that the batch file can seek.
Build a variable with detected letters, then...
- if none, prompt
- if one, use that
- if > one, list and prompt

[*1] If you visited me with a USB stick that autoran something when
plugged into my PC, I'd prolly chase you away with another stick :-)



>--------------- ----- ---- --- -- - - -

Tech Support: The guys who follow the
'Parade of New Products' with a shovel.
>--------------- ----- ---- --- -- - - -

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Vista, can .wps files be converted to .rtf files as a batch i.e.instead of one at a time? Mike Arnold Windows Vista General Discussion 4 03-20-2008 12:43 PM
Running batch files as administrator change working directory corradolab@ngi.it Windows Vista General Discussion 1 01-07-2008 02:41 PM
UAC and batch files Wildcat Windows Vista General Discussion 3 12-12-2007 09:36 PM
running batch files... maya Windows Vista General Discussion 12 08-23-2007 01:26 AM
Vista block batch files from being unzipped Francois PIETTE Windows Vista Administration 12 06-26-2007 05:10 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59