Computing.Net > Forums > Windows Vista > Having troubles with a batch script.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Having troubles with a batch script.

Reply to Message Icon

Name: batchnoob
Date: July 25, 2009 at 08:25:58 Pacific
OS: Windows Vista
Product: Toshiba Satellite a200-st2041 notebook
Subcategory: Software Problems
Comment:

I'm trying to make a batch file that checks if there is a .exe in a folder and if there is, renames it and copys it to the location of the batch file, then i want it to remove the .exe from its original location and run the copy, after that i want the batch file to start over.

I added pause so i could check each step when running it, i will remove these upon completion.

I have this so far:
:begin
if exist \\COLIN-PC\Shared Doc's\*.exe goto exist
goto begin
:exist
pause
ren \\COLIN-PC\Shared Doc's\*.exe battoexecute.exe
pause
copy \\COLIN-PC\Shared Doc's\battoexecute.exe battoexecute.exe
pause
del \\COLIN-PC\Shared Doc's\battoexecute.exe
pause
start battoexecute.exe
pause
goto begin
Thanks
P.S. Sorry if I posted in wrong section, I'm new to computing.net :-)

"An open mind leaves a chance for someone to drop a worthwhile thought into it."



Sponsored Link
Ads by Google

Response Number 1
Name: BurrWalnut
Date: July 25, 2009 at 11:44:52 Pacific
Reply:

I’m a bit out of date with the syntax of the commands but it appears to me that:

1. If a .exe file doesn’t exist, it loops back to begin, when you should be exiting.
2. The rename will not work properly if more than one .exe exists.
3. At the end, after running the program, you loop back to begin again in a never ending loop.


0

Response Number 2
Name: batchnoob
Date: July 25, 2009 at 12:18:41 Pacific
Reply:

The problem is that when I put a .exe in the specified file it doesn't notice.

There would only be one .exe in there at a time so rename wouldn't be an issue by the way.

"An open mind leaves a chance for someone to drop a worthwhile thought into it."


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Vista Forum Home


Sponsored links

Ads by Google


Results for: Having troubles with a batch script.

Trouble with a laser keyboard www.computing.net/answers/windows-vista/trouble-with-a-laser-keyboard/1637.html

MSI Troubles www.computing.net/answers/windows-vista/msi-troubles/2591.html

SoundMax Driver compatibility www.computing.net/answers/windows-vista/soundmax-driver-compatibility/2094.html