Computer Support Forum

PIF batch file not executing.

Question: PIF batch file not executing.

I'm running Windows XP Home and I need to run my DOS development system for MS Fortran 5.1 that ran fine on my Windows 98SE system. I copied the Win98 files to locations in the WinXP system that made the file paths the same as the Win98 paths, and copied the old desktop shortcut PIF to my Windows XP desktop. The PIF specifies a .bat file that sets paths and environment variables. Executing the shortcut caused the fortran system to run, but the batch file apparantly did not.

Trying to better define the problem, I wrote a small file c:\Temp\zzz.bat that uses the echo statement to generate a beep, a 1-line message, and ends with the pause statement. I made a new desktop shortcut to a small DOS file manager programlist.com, then modified the PIF: on the Program tab, in the Batch file window, I entered "c:\Temp\zzz.bat" and made no other changes. The shortcut caused list.com to run fine, but no beep, no message, no pause: apparantly zzz.bat was not being executed.

So why does the batch file not execute????

Relevance 100%
Preferred Solution: PIF batch file not executing.

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

Answer: PIF batch file not executing.

Hi, and welcome to TSF.
I'm not very familiar with this, but here goes....
Dos support was fairly native in 98, but not so in XP. In order to run DOS based applications requiring the DOS command set, and subsequently have dos applications called to run, you should try this within a command shell. Try opening a shell first, click the "start" button, select run, and type "command". Then start the application in the shell.

3 more replies
Relevance 84.46%

I'm running Windows XP Home and I need to run my old DOS development system for MS Fortran 5.1 that ran fine on my Windows 98SE system. I copied the Win98 files to locations in the WinXP system that made the file paths the same as the Win98 paths, and copied the old desktop shortcut PIF to my Windows XP desktop. The PIF specifies a .bat file that sets paths and environment variables. Executing the shortcut caused the fortran system to run, but the batch file apparantly did not.

Trying to better define the problem, I wrote a small file c:\Temp\zzz.bat that uses the echo statement to generate a beep, a 1-line message, and ends with the pause statement. I made a new desktop shortcut to a small DOS file manager programlist.com, then modified the PIF: on the Program tab, in the Batch file window, I entered "c:\Temp\zzz.bat" and made no other changes. The shortcut caused list.com to run fine, but no beep, no message, no pause: apparantly zzz.bat was not being executed.

Any ideas on why the batch file does not execute?
 

More replies
Relevance 83.64%

I am more experienced in Linux/Unix than DOS, but what I want to do is to execute a code that expects to get additional input from the screen.  In Unix, I would write:executable_name << EOFinput1input2...EOFbut DOS chokes on this (not too surprising.  How do I do this with DOS?

More replies
Relevance 67.65%

hi  how to execute batch program in windows , after all the services ( automatic) are executed ..thanksaravindan.k

Answer:batch program after executing all the servcies

Is there any reason you can't create a shortcut in the Startup folder or use the task scheduler?

1 more replies
Relevance 67.65%

I am looking to execute a batch file that I have created, but I do need it to execute in a special way:Once a user clicks on Shutdown to turn off their computer, a windows message will pop up saying "Have you Clocked Out?"  If the user selects "YES" then windows will continue to shutdown.  If the user clicks "NO", windows will open the a program/webpage so that users can clock out before shutting down windows. Does anyone know how to do this?

More replies
Relevance 66.83%

I want to partition my hd into 2, i already have win xp on one side but everytime i try to create a new partition it gives me the same error message.

need help
 

Answer:partition PQ : error 2003 while executing batch

mario333 said:

I want to partition my hd into 2, i already have win xp on one side but everytime i try to create a new partition it gives me the same error message.

need help Click to expand...

its risky to partition your hard drive with the OS already on it. You could mess it up if you continue to try to do this. with in mind, you may have to get a partitioning software like partition magic to do this.

http://windows.about.com/cs/diskpartitionsw/

the above link has some hits for that...doc
 

3 more replies
Relevance 61.5%

Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the code that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll see what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.

Answer:Batch File that grabs file names from folder to insert into batch file

A DOS "for /f" loop should do the trick, although changing the filename extension for the output to do everything in one line escapes me at the moment.

Perhaps you could do a dir .\folder\*.mp4/s/b > mp4s.txt, then make a copy of that and edit each line to rename the file to the destination name, and save it as mp3s.txt. Then you just feed both the source (mp4s.txt) and destination (mp3s.txt) filesnames into the for /f loop which handles the ffmpeg conversion.

Quite a crude solution and you'd have to handpatch the destination filenames, but i can't think of how to get a source mp4 filename and then just change the extension.

3 more replies
Relevance 60.68%

Hi,
I have a question  that how to copy file from remote desktop user drive to my local machine using  xcopy or any other protocol.

This is my server path "\\Trail01" and here is the file location "c:\Users\ashique.sheikh\Desktop\Day2.R"
How can i give this is in my batch file. I have used this
net use "\\Trail01" "[email protected]" "/USER:ashique.sheikh"
XCOPY /Y \\Trail01\c:\users\ashique.sheikh\Desktop\Day2.R  "D:\VMI"
But its not working. It is give path error.
How can i download this or is there any other way to do it?

More replies
Relevance 56.17%

i'm learning javascript, and i want to make a script that will execute on logon and greet me, but i don't know how to make a file execute at startup, or wether i can put a .js file on the startup list.

can .js files be executed on startup in windows xp?
if so, how?
 

Answer:executing a .js file on startup?

nvm

i actually figured out how to make a .js file execute on startup by putting it in the startup file under 'all programs' (duh). i didnt want to make an html page tho because i dont want a window opening, just the pop-up greeting. now i'm having problems with my coding. it's wanting me to define the object, and i dont know how. i was using the document object and idk if thats even the right one. i'll make a new post under the programs section. thatnks!
 

1 more replies
Relevance 56.17%

I bought my husband a laptop to start learning how to surf the net and it was downloaded with Vista Home Ed. I am trying to download MS Office 2003 and an error comes up stating "The requested operation requires elevation." Now, I have downloaded MS Streets and Trips and it worked without a problem. Can anyone help me get MS Office loaded on this laptop. I don't know how to continue. Thanks so much!
 

More replies
Relevance 56.17%

I have downloaded cardecovery.rar from pirate site.Inside there was 2 files - cardrecovery_setup.exe and cardecovery.exe.When i attempted to install setup file nothing happened and now im afraid that im injured with malicious software.Could u help me find if its so?
System configuration:
Tech Support Guy System Info Utility version 1.0.0.1
OS Version: Microsoft Windows 7 Ultimate , Service Pack 1, 64 bit
Processor: Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz, Intel64 Family 6 Model 37 Stepping 5
Processor Count: 4
RAM: 3893 Mb
Graphics Card: Intel(R) HD Graphics, 1722 Mb
Hard Drives: C: Total - 89899 MB, Free - 61769 MB; D: Total - 213186 MB, Free - 185455 MB;
Motherboard: Hewlett-Packard, 1425, 54.57, PX11M011ZZQAAT
Antivirus: Microsoft Security Essentials, Updated and Enabled

1. hijack report
Logfile of Trend Micro HijackThis v2.0.4
Scan saved at 12:58:27, on 01.10.2011
Platform: Windows 7 SP1 (WinNT 6.00.3505)
MSIE: Internet Explorer v9.00 (9.00.8112.16421)
Boot mode: Normal
Running processes:
C:\Program Files (x86)\TeamViewer\Version6\TeamViewer.exe
C:\Program Files (x86)\Intel\Intel(R) Rapid Storage Technology\IAStorIcon.exe
C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\acrotray.exe
C:\Program Files (x86)\Skype\Phone\Skype.exe
D:\Software\MALICIOUS\HijackThis.exe
R1 - HKCU\Software\Microsoft\Internet Explorer\Main,Search Page = http://go.microsoft.com/fwlink/?LinkId=54896
R0 - HKCU\Software\Microsoft\Internet Explorer\Main,Start Page = about:blank
R1 - HKLM\Software\M... Read more

Answer:Nothing happened after executing .exe file?

When you download and install pirated files, you can expect your computer to get infected.

Read the forum rules. This forum doesn't assist with pirated and illegal downloads.

---------------------------------------------------------
 

2 more replies
Relevance 56.17%

If someone can Please help, I just need the Data in the XML tag extracted to Batch File Variable....the rest i figured out and works great for the backup...just need the extracted tags...
thank you

i have a parent directory that contains a sub directory and a XML file that i need a batch to read 2 specific tags then create a Set command in the batch with those 2 lines to create a backup folder with the tags as the names and such. looks like this:

Parent Directory = XML
XML Folder contains > WJFKB02229001.D Folder & Config.xml File

I need to read the contents of the xml "Config.xml" extract the PhaseID Tag data "WJFKB02229001"
Also need to extract the BoxID "D", I don't need anything else on these seperate lines.

keep trying the following For /F command but no luck
Code:
[COLOR=red]for /f "tokens=1 delims=[" %%G in ("PHASEID" %path%\%myfile%) DO ([/COLOR]
[COLOR=red]set PhaseID=%%G[/COLOR]
[COLOR=red])[/COLOR]
[COLOR=red]echo Phase: %PhaseID%[/COLOR]
pause

and i've searched so many sites and forums with no real help on this one....the data is contained in the xml, weird enough i guess that it's enclosed in brackets "[", which all the forums i read and try it either replies with a blank variable being passed or says it can't find the file at all....

PLEASE HELP, lol

Code:

:StartSet
Set PhaseID="[COLOR=red][B][I]Extracted PhaseID from xml[/I][/B][/COLOR]"
Set BoxID="... Read more

Answer:Solved: Batch File Extract TAGID to Batch Variable? weird

16 more replies
Relevance 55.76%

I am looking for a way to startup multiple applications with batch scripting. After the batch file has been executed it has to be closed automatically.

for example:


Code:
"C:\Program Files\Wos_Portable\wos.exe"
"C:\Program Files\Internet Explorer\iexplore.exe http://127.0.0.1/"
The code will run WOS and Internet Explorer, but the batch file won't shutdown until I have closed wos and iexplore.

Any idea's how to fix this?

Answer:Batch scripting: Startup applications and close batch file

*Huhm*

7 more replies
Relevance 55.76%

How can i make my batch file open new batch files in new windows? I have tried everything but it just overrides the one i have open currently.Please help!

Answer:How can i make my batch file open new batch files in new windows?

Show us what you have.

4 more replies
Relevance 55.76%

msiexec continues to execute with each startup looking for some file (does not inform  what file), and displays annoying popups and at times overlays current window.  In addition, when I attempt to install software, it tells me that windows installer is already running and it must finish prior to the requested install.
 
I modified the configuration to no execute windows installer on startup but then if I attempt to do a software installation, it tells me the service is not running.
 
I re-registered wsiexec.exe and also removed it and downloaded a new copy and installed it.
 
Still same problem
 
Any ideas??

Answer:msiexec won't stop executing and looks for some file

Please download MiniToolBox  , save it to your desktop and run it.
 Checkmark the following checkboxes:  List last 10 Event Viewer log  List Installed Programs  List Users, Partitions and Memory size.
 Click Go and paste the content into your next post.
 Also...please Publish a Snapshot using Speccy - http://www.bleepingcomputer.com/forums/topic323892.html/page__p__1797792#entry1797792 , taking care to post the link of the snapshot in your next post.
 
Louis

5 more replies
Relevance 55.76%

I have a bat file closing a program - Digital Clock close.bat - containing:


Code:
taskkill /F /IM digital_clock.exe

How could I avoid this window to be opened when executing the bat file:

Answer:Executing the bat file without showing the cmd window?

In the first line of your batch file, try @echo off like this


Code:
@echo off
taskkill /F /IM digital_clock.exe

2 more replies
Relevance 55.76%

Ok now here is the situation. I brought a computer monitoring program that is password protected. I tried to access it today and it said my password was incorrect. So i logged into the member section of the website i brought the software from and it advised me to download a zip file that had an .reg file in it. Ok i did all it told me to do and it doesn't seem to to do anying thing all it says it that the blah blah blah was sent to the registry. am i doing something wrong in regard to executing a reg file
 

Answer:executing the registry edit file

6 more replies
Relevance 55.76%

I'm using windows vista home premium. I cannot run .exe files from my CD drive. when i trying to run .exe file. i'm getting this error
"Windows cannot access the specified device,path or file.you may not have the appropriate permissions to access the item."
I logged in as administrator. but i can execute .exe files from other folders.I'm having this problem for past 2 months. pls give me solution for this problem.
 

Answer:problem in executing .exe file from cd Drive

Hi

What security applications do you have installed as I remember an issue like this on a PC with a 3rd party firewall installed and a rule causing this, weird as it seems you'd wonder why the firewall would cause this. As you have had this issue for 2 mounths what was it you installed if anything around that time?

Have you scanned for malware?

If you right click one of those .exe's and choose properties and is Unblock on the general tab? if so try that.

If you uninstall your 3rd party software firewall and then reboot and try is this happing still?
 

1 more replies
Relevance 55.35%

Hi Gurus,Need ur help to automate a process.I am working on a process where i call .xml file using a .bat file. The bat file i use is my application utility file.Now when i run this xml file using my batch file i get a folder in an export format.Here my requirement is that whenever the folder is generated it should have appended in it the System Date along with the system name.I just did some search on the net and found that i can call batch comands in the xml file ...So needed the syntax to call batch rename command "ren" in my .xml file  which would rename the folder with system date included in it.I was using something like this in my .xml code ...but that dosent works ...something is wrong in the syntax :<?xml version="1.0" encoding="UTF-8"?>    <command name="Ren" sequence="1">        <option name="C:\Documents and Settings\*****\Desktop\Folder1" arg="" />        <option name="C:\Documents and Settings\*****\Desktop\Folder1_%date:~-4%%date:~4,2%%date:~7,2%" arg="" />    </command>Please SuggestThanks in Advance.

More replies
Relevance 54.53%

Hi!
 
i've carelessly executed .vbs file and today I noticed that secure internet connection doesn't work in firefox and dropbox. Also, steam exhibited some difficulties in logging in (but that could be just steam). Chrome is working normally.
 
Other symptoms are that windows firewall and windows defender are turned off when I start the computer. I can turn the firewall on, but defender is blocked by group rule (I managed to override this by deleting the registry key). I ran windows defender but it didn't find anything. There was also an error while trying to install optional windows update.
 
Here is some info that seems related to my case: http://www.malware-traffic-analysis.net/2016/07/25/index4.html
 
Just like in this example, malware was in .vbs file and I have SYS>mycomputername<.exe showing in task manager. If I shut down this process I'm unable to access internet anymore (something about proxy not being set up properly).
 
This exe runs from this folder: c:\Users\username\AppData\Local\Temp\Java
 
Contents of it are:
<mycomputername>.aes
<mycomputername>.zip
<mycomputername>X.xml
Ionic.Zip.Reduced.dll
makecert.exe
SYS<mycomputername>.exe
warePlguin.txt
 
I ran FRST and here is FRST.txt:
 
Scan result of Farbar Recovery Scan Tool (FRST) (x64) Version: 12-09-2016
Ran by AlenC (administrator) on ENIAC (13-09-2016 13:09:17)
Running from C:\Users\AlenC\Downloads
Loaded Profiles: AlenC (Availa... Read more

More replies
Relevance 54.53%

I have a Lenovo Yoga 3 ultrabook. I have made a bootable Windows 8.1 USB flash drive. I would like to know what is the difference between an installation from the 'setup.exe' file in the USB drive's folder, & a regular clean boot from the flash drive? Thanks for any suggestions.

Answer:Difference between clean USB boot & executing setup.exe file?

Booting the computer with USB or DVD install media will perform a so called clean install. You have to then reinstall all your software, Windows will be as if it was first time ever you have started that PC, new and fresh. If the computer already contained an older Windows installation, its files will be moved to folder Windows.old, you can then copy your personal files and folders from there to your new user folders.

Windows 10 - Clean Install - Windows 10 Forums
Starting the setup from existing installation by launching the setup.exe from USB or DVD install media performs an in-place upgrade installation. All your installed software will be kept, as well as your personal files, and Windows will be upgraded.

Windows 10 - Upgrade Installation - Windows 10 Forums
When the version of Windows on USB / DVD is the same you have already installed and installation is started by launching setup.exe from USB / DVD, it's called a repair installation which is used to fix various Windows issues; all your data and software will remain intact but Windows system files will be overwritten.

Repair Install Windows 10 with an In-place Upgrade - Windows 10 Forums
Kari

6 more replies
Relevance 54.53%

I have a Lenovo Yoga 3 ultrabook. I have made a bootable Windows 8.1 USB flash drive. I would like to know what is the difference between an installation from the 'setup.exe' file in the USB drive's folder, & a regular clean boot from the flash drive? Thanks for any suggestions.

Answer:Difference between clean USB boot & executing setup.exe file?

Booting the computer with USB or DVD install media will perform a so called clean install. You have to then reinstall all your software, Windows will be as if it was first time ever you have started that PC, new and fresh. If the computer already contained an older Windows installation, its files will be moved to folder Windows.old, you can then copy your personal files and folders from there to your new user folders.

Windows 10 - Clean Install - Windows 10 Forums
Starting the setup from existing installation by launching the setup.exe from USB or DVD install media performs an in-place upgrade installation. All your installed software will be kept, as well as your personal files, and Windows will be upgraded.

Windows 10 - Upgrade Installation - Windows 10 Forums
When the version of Windows on USB / DVD is the same you have already installed and installation is started by launching setup.exe from USB / DVD, it's called a repair installation which is used to fix various Windows issues; all your data and software will remain intact but Windows system files will be overwritten.

Repair Install Windows 10 with an In-place Upgrade - Windows 10 Forums
Kari

3 more replies
Relevance 54.53%

I have a situation where when I open Excel by double-clicking on a file, a new instance of Excel is opened. I am currently running Excel 2007. When I do this, my PMW does not open with that file.

My work-around is to open Excel from the start menu (where the PMW does open) and then drag/drop file onto the program. It also works to open file using the open file menu in Excel, but this takes a bit longer when accessing files on the network. Any thoughts?

Thanks
 

Answer:Excel 2007 PMW issue when executing file directly

7 more replies
Relevance 54.12%

Hiya,

I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups.

Two questions:
1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd rather keep a standard 'workflow' for other users who use the machine.

2. I'm 'ok' with batch files, but i've never tried to mirror to a different folder each time (automagically). What i'd like to do is have it backup a folder and call it "blah.1" then "blah.2" each time it is run, and then repeat once it gets to "blah.9" so it doesn't keep growing forever. I don't know how to do this.

I realise no.2 is not really for this forum, but someone might know and i might as well ask

Thanks.

Answer:How to run a batch file at logoff & some batch scripting help please

I found an answer to the logoff/shutdown:
How to schedule a task to run when shutting down windows - Stack Overflow

And the batch file folders:
robocopy - Insert current date in to destination folder structure - Stack Overflow

1 more replies
Relevance 52.89%

I have a U300 PSU3DA which I changed from Vista to XP.
This is because my main use of the computer will be for navigation (boat) and I was told most navigation programs will run better with XP. I have hardly nothing on my laptop so far, and already the system seems to be slow and freezing too often.

My question now is about the program C-Maps which I've just installed and which won't open. It keeps saying "Eorror: cannot open attribute file".

What does that mean? I have desinstall and reinstall the program, and it keeps coming up with this message.
I had a look around the device manager and the only thing that seems wrong is the PCI memory controller.
I did a bit of a search on this and it seems that this driver is not necessary for XP? Is that so?

Could it be a cause of the C-Maps program not working?

Thanks in advance.

Answer:Satellite U300 PSU3DA: error: cannot open attribute file executing C-Maps

> I did a bit of a search on this and it seems that this driver is not necessary for XP? Is that so?
Where did you read this info?
I don?t know if the driver is necessary but you get all drivers on the Toshiba website.

For your problem with C-Maps, I think the best is you contact the C-Maps support. Here it is a forum for Toshiba laptops.

1 more replies
Relevance 50.84%

I'm currently using an applet to run a jar file named Loader.jar to run another jar file named ERO.jar, which is obfuscated. The loader loads fine, but it does not pop out the GUI as it's supposed to. Here's the HTML part of the loading:
Code:

<HTML>
<HEAD>
<TITLE>Client</TITLE>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
<BODY>
<CENTER>
<APPLET NAME = "Client" WIDTH = "500" HEIGHT = "85" ARCHIVE = "Loader.jar" CODE = "loader.class">
<PARAM NAME = "java_arguments" value = "-Xmx1024M">
</APPLET>
</CENTER>
</BODY>
</HTML>

When I normally run the ERO jar file, by using a batch file or double clicking it, it pops up a GUI I made to log in to a server. Although, when I run the HTML file to load the Loader.jar file, it runs as it should for the most part, but it won't pop up the GUI as it should. Here's a pic of it at the moment:

http://img97.imageshack.us/img97/9121/applet.png

It just stops there, but it won't pop up the GUI. The GUI looks like this:

http://img243.imageshack.us/img243/2332/loginei.png

When just by running a jar file normally, it works. But when running a jar file to run another one, it won't.

loader class (main class):
http://pastebin.com/3tMnKtt5

Bot class:
http://pastebin.com/Wycu6hFK

ProgressChecker class:
http... Read more

Answer:Executing a jar file from another jar file.

16 more replies
Relevance 50.43%

Hi All,I need some urgent help..I have one file files.lst, it will contain filenames,dialy the number of filenames  will be change.let us assume that this file.lst has following file namesa.dat \b.datc.datI need a batch file , it has to read this file names from filename.lst and has to check a.dat file is there or not in c:\informatica\srcfilesfolderlike that it has to check all the file names mentioned  in file.lstcould you please help me to write a batch fileThanks Mahesh Goli

Answer:need batch file for reading file names and chekcing the file name

You seem to have given three input file names Files.lst, File.lst and Filename.lst so uncertain that this is what you want:Code: [Select]@echo off
cls

setlocal

set path=c:\informatica\srcfiles\

for /f "delims=" %%# in (files.lst) do (
    if not exist %path%\%%# (echo ----- %%# does NOT exist in %path% -----
    ) else (
    echo +++++ %%# DOES exist in %path% +++++
)
  )       
endlocal

1 more replies
Relevance 50.43%

Hi all,

Any idea how to write Batch File .bat to copy file from File Sharing & FTP Hosting to local directory.

Current the File Sharing & FTP Hosting is SMARTFILE.

I don't want to use WINSCP as the connector.

Thanks

Answer:Batch File .bat to copy file from File Sharing & FTP Hosting

Hi Chacha,

Give this batch file a try. All text in red, you should adjust before running.


Code:
@echo off
(
echo.Username
echo.Password
echo.lcd C:\Some\local\directory
echo.cd /Some/server/path
echo.binary
echo.get Some_file_to_download.txt
echo.bye
) > "%TEMP%\_%~n0.ftp"
ftp -s:"%TEMP%\_%~n0.ftp" "12.34.56.78"
del "%TEMP%\_%~n0.ftp"

1 more replies
Relevance 50.43%

Hi all,
I need help to create windows batch file for following requirements.
1. Remove .txt and .log file format in sub folders.
2. Zip individual file inside any sub folders and give file name through command prompt. 
3. Create sub folder zip file include file zip

More replies
Relevance 49.61%

Hello All.

I am trying to create a batch file that calls other batch files (device simulators).

The problem I am having is the batch file will not continue until the the call terminates, is there a way to continue it after the call (the batch only terminates after the user exits the simulator).

Thanks avamore
 

Answer:batch file: batch within batch

Welcome to TSG!

Use Start. The first set of quotes is for a title. It's needed in case the file name/command needs to be quoted, as in the 2nd example.

Start "" batch.cmd

This will open in a 2nd window. If the batch file you call doesn't use the Exit command that window may remain.
In that case use this instead:
Start "" "cmd /c batch.cmd"
 

1 more replies
Relevance 49.2%

Hi,I have a very simple batch file script to copy files in the current folder to another folder, but it also copies the actual .bat file. How can I exclude the .bat file from also being copied?here is what I have so far:copy /-Y *.xml F:\\TestExitI tried this:except *.bat copy /-Y *.xml F:\\TestExitwith and without brackets but it does not work.Any help would be appreciated.Jaime

Answer:Batch file to copy files but not copy the batch file?

The simple way is to have the batch file itself in another directory.Let's say your stuff in in D:STUFF and the bat file name MYBAT.BAT is in D:\BATthen  go into D:STUFF directory  and give the commandd:\bat\mybatWhich will only operate on files in the current directory and sub directories.

5 more replies
Relevance 48.79%

Hi,I would like to have a batch code to automatically find the latest excel file created by a server inside this location D:\report\,  and automatically opens it from other PCs connected in the same LAN.  The filenames inside the D:\report starts with the date eg: 20090417*The reason I need this help is because I do not want the user from the other PCs to use windows explorer and navigate to all other locations in the server harddrive.  They might do some damage if unintentionally deleted any of other files.  I am not allowed to change any file attribute in the server to make things hidden & etc.  Thanks in advance for your help.

Answer:Batch file to find latest excel file created and open it in windows xp

do you share d:\report\ folder in the server?if yes then, the code is something like this:Code: [Select]@echo off
for /f "tokens=*" %%a in ('dir/b/o-d/tc \\servername\sharename\*.xls 2^>nul') do (
start "" %%a
goto:eof
)untested

1 more replies
Relevance 48.79%

I've been searching the web on how to accomplish this but am coming up empty handed so I am hoping someone here can help...

I want my batch file to read a random line from a text file into an environment variable - can this be done?

I am using Windows 2000.
 

Answer:Batch File -- Read Random Line from External File into an Environment Variable

6 more replies
Relevance 48.79%

Dear All,

I need to create a batch file which can read the size of file(e.g. 1kb, 2kb...etc) from specific folder and detect 0kb file and convert it to text file (showing 0kb file size) with alarm.

I am not really sure how to write command for this batch file. Please help :-(
 

Answer:How to create a batch file to read size of file on specific folder path

10 more replies
Relevance 48.79%

How to create a batch file that will move files based on the file type?

My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...

Answer:How to create a batch file that will move files based on the file type

Download XXCopy
XXCOPY, A Versatile File Management Utility --- Boldly Extended Xcopy
This is a vastly improved and extended version of DOS XCopy
Sorry, can't remember the syntax, but its quite simple if you read the manuel carefully :-)
Put the command line in a .bat file and it will run

4 more replies
Relevance 48.79%

I am trying to write a batch program the list the current directory files that end in *.dwg
into a file on my C drive.
I have used the following code:
dir *.dwg /b >C:FileListing.txt
start notepad C:FileListing.txt

This code only gives file names in the current directory.
I need to have a list of path and file names in the file FileListing.txt
Is there a way to do that without including subdirectories??

Thank you,
 

Answer:Solved: Batch file to list file names in current Folder.

9 more replies
Relevance 48.79%

I'm working on a batch file that will download a file I maintain, look for a string of text, and if it doesn't find the string, rename a file or folder, or change the file or folder's attributes to read-only.

I think I can handle the last part, and I already have the ftp part done, but I am having a hard time finding any good resource for the text string lookup/IF statement.

Any help is greatly appreciated. I'm new here, please excuse my ignorance if I am posting in the wrong area or violating any rules.

Thanks,
Jash
 

Answer:Batch file to compare text and rename file or driectory on fail

6 more replies
Relevance 48.79%

I created this batch file to log certain users logins. It creates a text file to log in, but doesn't populate any of the data to it. Could someone please take a look at it and see what I did wrong. I'm new to writing batch files.

Thanks in advance. Here is the code.

@echo off
set target=JDoe
if %username% == target echo %username% %date% %time% %computername% >> c:\logfile.txt
 

Answer:Solved: Batch file creates text file but does not populate data to it

target is a variable. You have to surrournd it with %% like any other variable.
Code:

C:\>set target=Squashman

C:\>if %username% == %target% echo %username% %date% %time% %computername% >> c:
\logfile.txt

C:\>type logfile.txt
Squashman Fri 05/23/2008 10:34:14.74 BUMBLE-BEE

C:\>

 

3 more replies
Relevance 48.79%

I am wondering if anyone can provide the equivalent to this linux script. When run against a text file with one entry per line being the name of a directory, it deletes the named directories.

On linux, I run this against the text list.
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
rm -R $line
done < "$1"

I am not sure how to make it do the same for Windows. I can do this, but I'm hoping there's a way to delete based on what's in the text file. Also, wouldn't want it to prompt for deletion of each, but to just delete.

@echo on
cd \
cd %USERPROFILE%
dir /D /N 0
pause
for /D %%f in (XX*) do rmdir %%f /s
pause
%comspec% /k
pause


Thank you

Answer:Batch file or command to delete directories named in a text file

It's easiest to clean out the files before removing the directory.
echo Y|del *.* will clean out the files in a directory as long as there are no hidden or system files, you need to remove the attributes of files with the attrib command before the bat will delete the directory.
the echo Y| simply answers yes to any confirmation messages

1 more replies
Relevance 48.79%

I would like to know if there is a way to open a file in a program. Basically I want something like this (this is totally wrong):

open "C:Users\*My name*\My Documents\run.swf" in "C:\Program Files (x86)\Mozilla Firefox\firefox.exe

Thanks
 

Answer:Create a batch file to open a certain file in a certain file

The more standard way to do that is to use the start cmd. You call the program first and the file name second.

start "" "c:\windows\notepad.exe" "c:\somepath\logfile.txt"
 

2 more replies
Relevance 48.79%

hi all,
i have created a batch file that will run 171234 lines of code to rename 171234 files.
...............................................................
chcp 1252
Ren "75%.pdf" "146574 - Puttsawamy N - acceptance terms received - 75 loading - 29.09.09.pdf"
timeout 100
Ren "£100.pdf" "14234224234246574 - Puttsawamy N - acceptance terms received - 75 loading - 29.09.09.pdf"
timeout 100
..................................................................
this batch file worked on the majority of files but those with "£" characters and "%" did not due to the fact that on the output screen the characters are either not displayed or are different on the screen.
the file names containing a "£" were eventually fixed by changing chcp from default to 1252 but i cant resolve the "%" files.
(if they are input manually the problem is solved but they do not work in the batch file)
any help with this would be greatly appreciated.

Answer:CMD - Batch file to Rename files - % in file name causing issue.

I expect it's simple if you know your way around Code Pages and Character Sets
Have you looked at 3rd Party utilities?
I'm afraid I can't recommend a particular one
click here
click here
click here

1 more replies
Relevance 48.79%

Hi there forum,

how do you change the Visual effects using a batch file or registry file.

Thanks,

Edward.

More replies
Relevance 48.79%

I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the program (LEDStudio10) and open the file that I want to play. I have already tried multiple attempts and I was hoping someone out there in sevenforums world would be able to point me in the right direction.

Answer:batch file open file for program in the startup folder

Task Scheduler. Create a new/basic task. You can invoke your batch script there. This can occur after boot completes, after user logon, etc. You can set it to run daily weekly hourly, etc. You can even have it delay X (preseleted time amounts) minutes/hours after boot/logon if you want.

Task Scheduler - Create New Task

1 more replies
Relevance 48.79%

Hi there forum,

how do you change the Visual effects using a batch file or registry file.

Thanks,

Edward.

Answer:How to change visual effects using batch file or registry file?

Hello Edward, and welcome to Ten Forums.

The links in the blue note box under OPTION FOUR in the tutorial below may be able to help with this.

Visual Effects Settings - Change in Windows 10

more replies
Relevance 48.79%

Hi Guys,

I want to make one batch file which daily copies yesterday's files from one folder & paste it to another folder.

I.e.
C:/111 folder has following files.
1.zip had yesterday's date
2.zip had yesterday's date
3.zip had last sunday's date

now, when i will run batch file today, it only copies 1.zip & 2.zip & move to another folder C:/222

So C:/222 contains following
1.zip had yesterday's date
2.zip had yesterday's date


Please note , i have to run this batch file daily which should not require any changes.

More replies
Relevance 48.79%

I've come into contact with Mandriva Linux. I know of a concept called standard permissions, that it provides. It's pretty convienient. I don't exactly know how it really works under the hood or anything, and I don't need to know exactly how it works right now either, even though it's probably available.

What I want to do, in effect, is create a feature pretty close to equivelant of this feature, only for Windows XP. I want to set standard permissions using a batch file. Whenever this batch file is run as administrator it can enforce the permissions. What are these permissions it enforces? Well, what I want is for these permissions to be gotten from a text file. The syntax in no way resembles the syntax of the Linux file I'm describing.

Basically the syntax is this:
PATH <TAB> MODE <TAB> USER1,USER2,... <TAB> PERM
PATH <TAB> MODE <TAB> USER1,USER2,... <TAB> PERM
...
The path is the path to a file or folder in exact syntax. The mode is one of the switches that can be given for XCACLS in the Windows Resource Kit thingy. This can be replace, edit, etc. The users are the user or group to add/replace/remove/etc, and there is a comma allowed so more than one user or group is allowed to be specified. The permissions are the permissions that you can specify in the utillity.

So the first thing the script needs to do, is call some program that safely detects whether or not the filesystem is NTFS or not. If the sys... Read more

Answer:Get ACL permissions from a text file enforced by a batch file in Windows XP

16 more replies
Relevance 48.79%

Hi . I'm making a "PC TuneUp" project , but something is wrong . When the batch file tries to check for updates , it closes . Fortunately , i know that it closes because it doesn't find the file . But i tried everything - nothing worked . Please help !
Code:

@echo off
for /F "tokens=1" %%G in ('tasklist /V /NH /FO TABLE /FI "WINDOWTITLE eq TehDansorz"') do IF %%G==cmd.exe exit /b
if exist newest%winver%pctuneup.ver del newest%winver%pctuneup.ver
if exist %winver%pctuneup.ver del %winver%pctuneup.ver
set winver=Win7+WinVista
set ver=1.6a
set title=title TehDansorz's PC TuneUp for Win7/WinVista Version %ver%
title Requesting admin permissions ...

:: BatchGotAdmin
::-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Administrator privileges are required for this app to work .
echo Please click OK in the following screen .
PING 1.1.1.1 -n 1 -w 600 >NUL
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"

"%temp%\getadmin.vbs"
exit /B

:gotAdmin
title Got a... Read more

Answer:Solved: Batch file closes when downloading version file

7 more replies
Relevance 48.79%

Hi there forum,

how do you change the Visual effects using a batch file or registry file.

Thanks,

Edward.

Answer:How to change visual effects using batch file or registry file?

Hello Edward, and welcome to Ten Forums.

The links in the blue note box under OPTION FOUR in the tutorial below may be able to help with this.

https://www.tenforums.com/tutorials/6...a.html#option4

2 more replies
Relevance 48.79%

Hi,

I have a file in a folder on a network drive whose path is : "\\sql\imp\ssis"

I need a windows batch file that looks into the above folder for a file with a name like : "abcd_03052012_84373.txt" .

The above file name has a date embedded in it in "ddmmyyyy" format. I want that to be extracted and put into a variable or a file somewhere so that I can read that later and store into a sql table.

Please help.
 

Answer:Solved: Extract Date from File Name - Using Windows Batch File

6 more replies
Relevance 48.79%

More as an alternative to twiddling my thumbs than anything else, I tried to produce a batch file that would count up the number and size of files in a folder, as well as the number and size of files with each extension. Hence it would say how many word documents I have and how much space they're taking up, etc.

I've managed to get a vaguely working model, but the output formatting is terrible (I just wanted it to say X bytes in Y "Z" Files, none of that ugly dotted variable names) and I have failed to get it to equate .htm and .html, .jpg and .jpeg, etc.
Code:
@ECHO OFF
REM THIS BATCH FILE ITTERATES THROUGH ALL THE SUBFOLDERS AND FILES IN A FOLDER (IDEALLY A DRIVE)
REM IT TOTALS THE NUMBER OF FILES CONTAINED IN THAT FOLDER, AND THE SIZE OF THOSE FILES.
REM IT ALSO TOTALS THE NUMBER AND SIZE OF FILES WITH EACH EXTENSION IT ENCOUNTERS.
REM ALL INFORMATION IS THEN PRINTED TO THE SCREEN AND FTYPEDST.TXT

IF EXIST FTypeDst.txt ERASE FTypeDst.txt
ECHO. >FTypeDst.txt
ATTRIB +A FTypeDst.txt

ECHO SCANNING FILE TREE FOR FILE EXTENSION DISTRIBUTION
ECHO Please Wait Paitently. . .

(SET /A ALLNUMBER = 0) & (SET /A ALLSIZE = 0)

REM cycle through the current directory and subs, Increment Allnumber, Allsize, define and increment Number of * files, size of * files.
FOR /R %%F in (*) DO (
SET /A ALLNUMBER += 1
SET /A ALLSIZE += %%~ZF
IF NOT DEFINED Number.of.%%~XF.files (SET /A Number.of.%%~XF.files = 0)
IF NOT DEFINED Size.of.%%~XF.files (SET /A Size.of.%%~X... Read more

Answer:Solved: File Type Distribution analysis: Batch File.

Posted via Mobile Device
You would be better off using third party software that already does this. Plenty of them out there.
I personally would check the extension of each file using the cmd extensions of a for loop. then do an if statement for each file type you want to keep track of. then use a call statement to branch to a function that adds up the file sizes and number of files.
 

3 more replies
Relevance 48.79%

Hi all,

Please help!! I'm having a problem to copy some files from a folder.
My folder have lots of files and is there any way for me to write a batch file to copy only files according to "date modified"? For example last week files or yesterday files.

Please help!! Urgent!!!
Thank you.
 

Answer:Urgent!! Copy file by date modified using Batch File.

Take a look at XXCOPY: http://www.xxcopy.com/index.htm
 

2 more replies
Relevance 48.79%

I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'.
I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands, but nothing of the variables, signs-involving commands (&%!?), etc.

Also, I want to learn a whole lot more about programming/java/batch file, so it'd be awesome if any code could be explained. Thank you, in advance

Answer:I need a batch file to open a random file within a certain folder/path

There's a free Windows scripting language called Autoit3 that would do this task easily using these functons:

Random
_FileListToArray

AutoIt - AutoItScript
It has a Basic like syntax and is easy to learn.

Another popular scripting for Windows is AutoHotkey
AutoHotkey: macro and automation Windows scripting language

The syntax can be confusing but it has object support and is more powerful.

Of course there are tons of others for Windows:
Rexx
Python
Perl
Ruby

Here's a list. The details for each tell which OS are supported:
Free Programming Languages - Freebyte's Guide to

5 more replies
Relevance 48.79%

If anyone can help it will be greatly appreciated,I am taking A + Essentials and my instructor isn't explaining it,

Answer:How to switch file type name to contents using a batch file for notepad

If you are as it appears you are paying for a Course for a Comptia A+ certification and the teacher isn't doing the job why haven't you gone to the school and asked them to switch you to a course with a different instructor? Or Demand a refund?

When I got my A+ back in 2000 it wasn't that hard to pass. I believe it was two tests and I was over 95% on both with no training course. I was experienced in computers and doing things and They did have a sample test as I recall it.

And of course that old standby Google
http://www.google.com/search?sclient=psy-ab&hl=en&site=&source=hp&q=A+%2B+Essentials&btnK=Google+Search

I'm afraid I can't help you further as the tests have changed a lot over the years.

1 more replies
Relevance 48.79%

 got a problem in copying a file from one path to another path with a 'variable folder name' in the pathThe following code works fine if the folder name doesnot have a space in it.(hear Folder1 is the variable folder name)CODE:    @echo off&setlocal enabledelayedexpansion    SET inpu="Folder1"    ::SET /p fil=enter file name:     for /f "delims=" %%x in ('dir "C:\Users\kumark3\Desktop\"%inpu% /ad /b') do (    set /a userslen+=1    set "usersarray!userslen!=C:\Users\kumark3\Desktop\%inpu%\%%x"    )    for /l %%x in (1,1,%userslen%) do (    xcopy "!usersarray%%x!\geth\gr.txt" "C:\Users\kumark3\Desktop\Folder2" /c /h /r /y /i    )But if the folder name has a space, the code is not working for eg if the 2nd line in the code is likeSET inpu="Folder 1"Please give me a solution for this problem

Answer:batch file - copy file from one path to another with a variable folder name

Please Tell ME Are you Trying To Auto Increment The Folder On Copy?And dont add @echo off&setlocal enabledelayedexpansion USE @echo off ONLY!!

1 more replies
Relevance 47.97%

Hi,

Can anyone tell me how to get part of a bacth file to read a line from a text file and then set it to a variable.

For example the file contains computername =computer1

how do i get the batch to read that and set computer1 to a variable that can be used within the batch file.

If possible what i would also like to be able to do is once set that to variable, compare it against the correct computer number and if incorrect go back into the batch file and set the line to the correct computer name

Any help is appreciated.

Thanks
 

Answer:Batch File Read Line Of Text File

7 more replies
Relevance 47.97%

If I have: set /p filename=What is your filename?: ... How do I take the user input and 1) output to namelist.txt (already existing text file)and 2) output to output.txt (dynamically created text file)? Thanks! --oops.. put this in the wrong forum. sorry. guess there's no way to delete now..

Answer:How to write batch file input to text file?

This is the wrong forum to post Programmig questions...you have posted this in Programming forum too...it`s file there....this one should be removed !Google is your friendwww.google.com-----------------------Keyboard not present,press F1 to continue...

2 more replies
Relevance 47.97%

I need help creating a batch file which will pipe out the system variables to a text file daily.

set | more >> c:\system_variables.txt

I also want to put in a time stamp in the file before the details are added to the text file.

Ideally when the batch file runs it will input the time/date and then the system variables without overwriting the details of the previous day.

date/time
system details
date/time
system details

Any help appreciated


 

Answer:Batch File time stamp and appending to the end of a file

It would probably be easier to write a C++ program to do that and set it to run each day. (if you have access to a compiler...)
 

2 more replies
Relevance 47.97%

Okay, so basically, I have a whole list of links in a plain text Notepad file, each link on a seperate line. All I am wanting to do is to add a bit of text before each link, specifically: 127.0.0.1 and a couple of spaces.

So this...
Code:

[SIZE=3]somelink.com[/SIZE]
becomes this...
Code:

[SIZE=3]127.0.0.1 somelink.com[/SIZE]
By now you've probably already guessed what I'm trying to do here and what it's for.

So I am wanting some batch file code, executable in a .bat file, which basically reads a Notepad text file, and then add "127.0.0.1 " at the beginning of each line with text on it. I am guessing this is probably a very simple piece of code for someone with some knowledge of MS DOS and batch file code, but that most certainly isn't me, and the only batch files I have ever written have been with help like now.

Thanks for any and all help in advance with this, much appreciated.
 

Answer:Batch File To Read And Modify Text File

9 more replies
Relevance 47.97%

op sys=NT40
Need this in batch

Need to remove a space or spaces that are at the end of every string
^=spaces

abc123^^^
abc124^
sdf145^^^^^^
ghr254^^

thanks
Robert
 

Answer:Batch File to remove a space at the end of a charcter in a txt file

you can use notepad's find and replace feature. Or any text editor really.
 

2 more replies
Relevance 47.97%

Hi, I was wondering if it is possible to make a batch file that will open a file with a specific program?

Say I want to open "targetA.txt", with the program "noteviewer.exe"
Is it possible with batch file? or not?

If it is, could you please show me how?
 

Answer:making a batch file open a file with particular program?

10 more replies
Relevance 47.97%

I am wondering how to write a script that would delete all files of a certain extension from a folder.
 

Answer:Solved: Batch file to delete all .xxx files from a file

6 more replies
Relevance 47.97%

Backround: I am a college student majoring in Information Technology with a focus in programming. I also work for my school's IT department as an IT associate. I have 4 years of experience dealing with hardware and software and have studied Net+ and A+ certification books.

Problem: At my school my boss, the IT Director, wants to schedule a batch file to run weekly that will delete items from the desktop and folders of the "Student" account on all of the student computers. He asked us associates to go around to every student computer with this batch file on a thumb drive and schedule the task. Seems simple enough right? The problem is we are talking upwards of 300 computers throughout the campus. I proposed a solution to him where we would use a script that would essentially consult a text document with the names of all of the student computers in it, then run the file.

I am 99% this can be done, I just have a very small amount of programming experience. If anyone has an answer or knows of an easier way to accomplish this I appreciate it. Thanks in advance.

EDIT: All student workstations are running Windows XP SP2
 

Answer:VB Script to Run a Batch File and Utilize a Text File

16 more replies
Relevance 47.97%

So I recently had a case of hard drive failure in which basically nothing of value was recovered in the original directory structure, however the drive was full of .chk files from a chkdsk run. I ran a quick script to change all of the extensions to .jpg, and most of the files were in fact intact.

Many of the files, however, are either corrupt, or are simply not JPEG files, and so will not open with the .jpg extension. Is there any batch renaming application that can analyze files by their header data, and append the appropriate extension automatically for the most commonly used filetypes?

Answer:Batch file extension processing by file header?

Usually file recovery software does that (before the files are recovered as chk files). I don't know of any app that will do what you said though. But if you don't have too many files, use a hex editor to open them and rename accordingly. I use winhex (just for viewing though), but any other will do. Here's a few strings that may help:
JFIF .jpg
RIFF AVI LIST .avi
PNG .png
MZ .dll or .exe (at least 32-bit - dunno how they are for 64-bit or 16-bit executables)
moov somewhere in the file .mov (may not be at the beginning)
GIF89a .gif
ftyp .mp4
**\rtf1 .rtf
000001BA21000100 (in hex) .mpg (MPEG-1 at least - don't have MPEG-2 samples to test ATM)
3026B2758E66CF11 (in hex) .wmv or .asf

5 more replies
Relevance 47.97%

Any suggestions here would be appreciated but I think this is so bizzare or deep into Windows that I'm not expecting any. I am developing a scheduled task that will run every morning unattended. The script starts Excel and specifies a workbook to open. The 'workbook_open' event runs and when finished, starts another batch file (via Shell(batFile, 1) and shuts down Excel. The 'batFile' starts Access and specifies the database to open. The database runs an AutoExec function and then shuts Access down. This sequence runs fours times for four separate databases. Here's the problem:

When the scheduled task runs under my account, everything works fine. However, when we change the scheduled task to run under the System Administrators account (we have to do this for reasons not important here), the Excel/Access sequence for one, and only one, of the databases does not run. I have isolated the problem to the 'Start' commands for both Excel and Access. What appears to be happenng is that for the Excel 'Start', Excel starts but the 'specified' workbook is not opened, hence Excel just sits there as an open process not doing anything. When I changed the name of the 'specified' workbook, the Excel 'Start' works okay, opening up the renamed workbook. The same thing happens with the Access 'Start' command. Access starts but the 'specified' database does not open, hence Access just sits there ... Read more

Answer:DOS Batch 'Start' app file command cannot find file

I've found a workaround to this problem by renaming the parent folder to which the database's location folder trees. But I sure would like to know what caused this problem.
 

1 more replies
Relevance 47.97%

Hi,
I am trying to write a batch file that replaces a word in a text file with another word given as a batch parameter. I know of the FOR /F command to loop thru the lines. I know also about doing a simple string replacement. But I can't seem to piece it together. Can somebody help me?
 

Answer:Batch file to replace words in a text file

16 more replies
Relevance 47.97%

On my XP backup batch file, I am doing a comparison of the total files in the source and target directories to confirm they are the same (and consequently everything backed up ok). What I am trying to do is display the final file total line, excluding all of the other file total lines of the individual folders. Additionally, I want to exclude system files from the total, as I am not backing them up.

I am using "dir /s /a-s d:\*.* | find "File(s)"

This give me the total lines of all folders in addition to the final total files and bytes which is the only line I want.

I have used attrib with find /c /v "", which works, however I cannot find a switch with attrib that will exclude system files.

Any ideas?

Answer:Batch File find final file total

Try this look for /exclude (scroll down)

2 more replies
Relevance 47.97%

Hello I used the info given in this site to rename a file using a batch file under Win 7. Batch file is as follows:echo Press to rename the old File.exeecho Renaming old File.exe if it exists...IF EXIST File.exe (   for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename ?File.exe" File-%%e-%%f-%%g.exe)Wit 7 complains that %%d was unexpected at this time.Where is the problem? Thank you.

Answer:Batch file to rename a file with date stamp in Win 7

Perhaps you could tell us what your think this part is going to do.Code: [Select] for /f "tokens=1-5 delims=/ " %%d in ("%date%") And then maybe we can tell why it won't do that.

8 more replies
Relevance 47.97%

Hey I've written lots of batch files before, but it's been a while and I don't think I've ever tried to add external data.

I've got a list of folder names and I'd like to make a batch file that I can run every once in a while to copy a master file in each folder to a new file. I know this is long, but I know exactly what I want so I thought I'd be as specific as possible. I'd love to get an example script but I really do want to learn more--if I could get pointed in the direction of where to learn this stuff, that would be awesome.

So for instance the folders are:
folder1
folder2
folder3

And in each folder there is a master file that includes the folder name and the word master (for instance):
c:\folder1\folder1-master
c:\folder2\folder2-master
c:\folder3\folder3-master

And I want to copy the files to a new file:
copy c:\folder1\folder1-master folder1-copy
copy c:\folder2\folder2-master folder2-copy
copy c:\folder3\folder3-master folder3-copy

Now I don't want to do every folder every time I run the batch file, but I already have a list of the files that I have to make copies of. So I was hoping to have a text file with:
folder1 folder2 folder4 etc

Then the batch file would grab that info and run a loop till it ran out of info. So if the first data was folder1 it would put folder one in %data% or something and then:
copy c:\%data%\%data%-master c:\%data%\%data%-copy
Then the loop would go back and put the second data in %data%... Read more

Answer:more complex batch file data from external file

7 more replies
Relevance 47.97%

I have a text file located at \\thedrive\a folder\another folder\log.txt. This file contains several lines of this kind of data "jdoe upgraded 09-20-2011 13:42:49.62".
I have a batch file located "d:\folderName" that needs to read the "log.txt" file and obtain the local computer user username if it is in the file. If it is not in the file then a file is to be copied to the d drive from \\thedrive\a folder\another folder\ to "d:\folderName" and then run the file. This is what I currently have
@Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set _InputFile="\\thedrive\a folder\another folder\log.txt"
For /F "tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)
but the log file is not read. If I move the "log.txt" off the network it works just fine. I cannot move the "log.txt" file as other processes use it nor can I copy it.
 

Answer:Batch file to read from a network text file

Because you have Quotes around your file name you need to use the USEBACKQ option.

Please use CODE tags when posting code.

Code:
@Echo Off
SetLocal EnableDelayedExpansion
::This line is just in case n has been defined before the batch file is run
Set n=
Set _InputFile="\\thedrive\a folder\another folder\log.txt"
For /F "usebackq tokens=*" %%I IN (%_InputFile%) DO (
Set /a n+=1
Set _var!n!=%%I
)

 

1 more replies
Relevance 47.97%

I need to write a batch file or vb script that will take the following share names (which are stored in a .csv Excel file) and then run the following command:

NET USE \\[entry from 1.csv file]

The object is to have this command establish a NET USE connection to each share name from the 1.csv file.
These are the first five entries from the 1.csv file:
\\s0002234\c$
\\s002631\c$
\\gb2130\c$
\\s00460\c$
\\gb2143\c$
\\gb3205\c$

Can you please write a command script that will do this for me? My OS is Windows XP Service Pack 2.
Contact me with any further questions.
Dennis
[email protected]
 

More replies
Relevance 47.97%

I need a batch file that will delete position 805 in every row of a text file.  Any help would be appreciated!

Answer:In need of a batch file to remove position in text file

Could you please be a bit more clear? Do you mean you want to read a text file, line by line, and delete the 805th character of each line? That is, the new line will be characters 1 to 804, and then characters 806 to the end?

4 more replies
Relevance 47.97%

I wrote this batch file which does what I want it to do so far.


Code:
@echo off

"C:\Users\xxxxxx\Documents\HideTaskbar\HideTaskbar.exe"
"C:\Program Files (x86)\VideoLANold\VLC\vlc.exe"
"C:\Users\xxxxxx\Documents\HideTaskbar\ShowTaskbar.exe"

exit
VLC is a video program so I want to associate video files to this bat file. This would mean that when i clicked on a video file in Windows Explorer, the bat file would execute and VLC would open the file I double clicked. At the moment the only thing that happens in this setup is that the bat file executes like normal but no video is played.

Is this possible, and if so how can I accomplish it?

Answer:How can I write a batch file that opens a file in a program?

Have you tried associating the video files to open with VLC by default ?
Maybe you don't need a BAT file ?

Default Programs - Associate a File Type or Protocol

9 more replies
Relevance 47.97%

Dears,How can I create a Batch File which will identify number 0 in the text file and immediately trigger a pop out message to alert people. Please help.

Answer:Create Batch File to read text file

Tell us more about the text file. How was it crated? Does it have some kind of fixed formant like a data record?

3 more replies
Relevance 47.97%

Alright, so what I'm trying to do is list all the shortcuts & folders in the start menu and list all the shortcuts & folders on the desktop and put this into a text file. The reason is to get a full list of programs our teachers use before we re-image their machine and not all of their programs are listed in add/remove programs and not all programs make a folder in Program Files, that is why I'm trying to do it in this roundabout way. What I have so far is this:

@echo off
mkdir "p:\Program List"
DIR "c:\documents and settings\all users\start menu\*" /S/B/OD > "p:\Program List\%computername% Start Menu.txt"
DIR "c:\documents and settings\all users\desktop\*" /S/B/OD > "p:\Program List\%computername% Desktop.txt"

This works perfectly but the only problem is the file has these:
c:\documents and settings\all users\start menu\
c:\documents and settings\all users\desktop\

before each entry in the text file. Is there an easy way to remove these lines so the text files are easier to read? I've checked other sources and can't figure out how to get this to work...

Answer:[SOLVED] Delete text from .txt file in a batch file

Open the files in Notepad, click Edit, then replace, and enter the string C:\Documents and Settings\All Users\ and replace it with nothing (no entry).

:)

10 more replies
Relevance 47.97%

Have a situation where a local copy of a file is kept on several PCs. There is a master copy on a server which is changed and updated occasionaly. When the master copy is updated it has to be copied over to the local PCs.What I would like is a batch file (or something that does the same thing) which would check the last modified date on the master file and if newer than the local file download and replace the local copy before loading.Any ideas on how to do this?

Answer:Batch File-overwrite existing file newer available

No ideas?

5 more replies
Relevance 47.97%

Hi,

I want to write a batch file to add the numbers. The inputs are in the text file. I need to add all the numbers in the text file that are in consequent lines. Please help me in doing that by giving an example.

Regards,
Menaka B
 

Answer:Batch file that takes input from text file

7 more replies
Relevance 47.97%

Anyone know how to take the contents of a text file, numbers only, calculate and then store them as a value? I'll be constantly adding to this text file and they need to be calculate. Like the balance of a bank but a little different.
 
Please and thanks!

Answer:Batch File, Calculating the Contents of a Text File

I think that would actually be very hard to do as the numbers in your text file are not integers but text and doing calculations would not be possible. Is there any reason you can't use a spreadsheet to do this?

10 more replies
Relevance 47.97%

Is it possible to create a list of file descriptions (Properties => Details => Description) via batch file.  I'm using Windows 7 Professional.  See link below for clearer picture:http://i10.photobucket.com/albums/a133/vivamarxista/CollectingFileDetailDescriptions_2.jpg

Answer:Create List of File Descriptions via Batch File?

I do not believe it is possible to offer a generic solution; is there a particular kind of file that you are interested in?

3 more replies
Relevance 47.97%

Hello, I am trying to use a batch file to read a path in an ini file and start an application. I am able to get dos to read the path until the myapplication1.00.exe. Below is what I have.Batch File:@echo off for /f %%a in (myapplication.ini) do set Mypath=%%a start %Mypath%myapplication.ini File:"\\link\share\PSO Train\My Training Folder\myapplication1.00.exe" This is a shared directory and I trying to make the .bat capable to work if a shortcut is created.Thanks,

Answer:batch file error in .ini file path, not starting .exe

If no tokens or delims are specified by default in an options string,  FOR /F splits each data line into tokens, the default delimiters are spaces and tabs so in your example %%a is going to expand to "\\link\share\PSOThis is not what you want. If you put echo %Mypath% you will see what I mean. Try with a "delims=" options string in the FOR commandtype FOR /? at the prompt to see the documentation

1 more replies
Relevance 47.97%

Hi,
I am new to batch files and have read up a little on xcopy and robocopy. 
We currently have a folder which new builds are copied and compressed to .zip files and stuck in a  folder. Dozens of zip files are created every day
What I want to do is the following:

I want to copy the newest zip file from folder 1 to folder 2 and extract it. 

What is the simplest way to find and copy the newest zip file considering multiple zip files are created each day?

Answer:using a batch file i would like to copy the newest file to a new location.

Try this:
@echo off
for /F "delims=" %%a in ('dir  /b /od "d:\My Files\*.zip"') do set Youngest=%%a
xcopy /y "d:\My Files\%Youngest%" "Folder2\"

3 more replies
Relevance 47.97%

How can I add to this batch command to include the date:

xcopy C:\all\* Z:\Allbak\* /E /Y /C

I'd like the resulting file to be named "Z:\Allbak171129" (yr mo day).

The plan is to set up a task schedule to run the batch file every week. I want to keep several previous backups just in case.

More replies
Relevance 47.15%

I need a command line for bat files . I want an Exe file open a target file . For Example I write >>> Open "target.img" With "XnView.exe" . then I save this code as a bat & when I run it the target file will open with My exe file . I don't mean association , I want write a code for One file Only to be open with a software .

Answer:Open File With Exe File Command for batch

It should be in the form:<path1> XnView.exe <path2> target.imgIt is important that there is a space between .exe & <path2>The rest is a matter of syntax but this will cause XnView to run target.img (assuming the two are compatible).some other bloke...

2 more replies
Relevance 47.15%

Help me make a batch file that copies a file from one computer to another computer in a network...

PC1 = Source
PC2 = Destination

I want to copy a file from PC1's Drive E: to PC2's Drive E:

Answer:How to copy a file from 1 pc to another pc in network using batch file

Yes I want to copy files from PC1 to PC2 over the network...

PC1's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals
to
PC2's Drive E:\Online Games\Battle of Immortals\Battle of the Immortals

9 more replies
Relevance 47.15%

HI can anybody please post me a batch file which will let me automate saving a file to directory on a server or point me in the right direction on how to create one it need's to run at a set time every day .Please help
 

Answer:Need A batch File to automate saving of file

16 more replies
Relevance 47.15%

Hi all, I need to change the name of a file that I am FTP'ing each day automatically. I'm not very good with batch files but here is my code.

@echo off
G:
cd "G:\nmc\Business Operations\Development\Earned Revenue Report"
> script.ftp echo stpan
>>script.ftp echo krtssss
>>script.ftp echo cd /home/users/ftprpts
>>script.ftp echo bin
rem how do i change the day of mon (04) in filename each day ???
>>script.ftp echo get erevrpt_04.csv
>>script.ftp echo bye
ftp -v -s:script.ftp -i krst.xyz.org
erase script.ftp
@echo on
 

Answer:Solved: Batch file - place day in file name

9 more replies
Relevance 47.15%

I am making a batch file that searches a text file of a list of data like this:Name: JohnAge: 34Weight: 67Height: 34Gender: MaleName: SarahAge: 28Weight: 15Height: 23Gender: FemaleWhen the user enters the name "John" it displays John's name, age, weight, height, and gender. My problem is that when you enter a name that doesn't exist, it displays some random lines. I have no idea why. I came up with a solution by putting "NO SUCH NAME EXISTS!" in those lines, but it did not seem like a very elegant way to solve the problem, and it doesn't always work.Here is my code:@echo offclsecho.echo.echo Whose information do you want to see?set /p name=Enter your choice here: %find /n "Name: %name%" store.txt | findstr /v STORE >temp.txtfor /f "tokens=1 delims=[]" %%a in (temp.txt) do echo %%a >temp2.txtset /p number= <temp2.txtfind /v /n "" store.txt >temp3.txtset /a number= %number%+0find "[%number%]" temp3.txt | findstr /v TEMP3 >temp4.txtset /a number= %number%+1find "[%number%]" temp3.txt | findstr /v TEMP3 >>temp4.txtset /a number= %number%+1find "[%number%]" temp3.txt | findstr /v TEMP3 >>temp4.txtset /a number= %number%+1find "[%number%]" temp3.txt | findstr /v TEMP3 >>temp4.txtset /a number= %number%+1find "[%number%]" temp3.txt | findstr /v TEMP3 >>temp4.txtfor /f "tokens=2*" %%a in (temp4.txt) do echo %%a %%bcls > temp.txtcls > temp2.txtcls > temp3.txtcls > temp4.txt

Answer:Batch File Search Text File

Sorry, this is in the wrong category. Is there a way to move it?

2 more replies
Relevance 47.15%

Can someone help me out with this? I don't know what I'm doing wrong. I put:Quotemplay32 /play /close c:\Users\Connor\Desktop\abc.wavinto notepad and name it file.batbut it's not working.

Answer:Playing an Audio File with Batch File

May I suggest something. When ever you have a problem with batch files, it helps to simplify things and make them more direct. You should have received some type of error message if the Windows media player was not available, or could not find the file.Just now I made a new audio file that I called "test.wav" and after adjusting the volume level and effects, I placed it in an empty directory on the C: drive. I had named the directory WAV so  now the new audio file I just created is in that directory.So now this is what I do at the command prompt.C:\WAV>mplay32 /play /close TEST.WAVWorks fine for me. Can you duplicate this on your system?

7 more replies
Relevance 47.15%

Hi guys,

is it possible to do a file compare command in a batch file and have it check a whole directory and sub directories rather than just one folder and me having to type out EVERY directory I want checked?

Thanks,

marc :beard:

Answer:Batch-file - File compare question

Check out this tool called Total Commander..it will do what you are looking for. Unless it specfically has to be in a batch format for perhaps a network logon or something of that sort?

http://www.ghisler.com/

8 more replies
Relevance 47.15%

I'm using this batch file to take the newest file and copy it to another location. FOR /F %%I IN ('DIR *.* /B /O:-D') DO COPY %%I <<NewDir>> & EXIT My exact syntax is this:FOR /F %%I IN ('DIR H:\*.* /B /O:-D') DO COPY %%I F:\ But I'm getting an error saying the system cannot find the specified file. I had it working once about an hour ago, edited my live bat file to add this command and it stopped working. I don't know what I did as I accidentally closed the unsaved editor. Currently there are 3 files in H, I want the newest to go to F. Any help appreciated.

Answer:Batch file copy newest file

FOR /F "delins=" %%I IN ('DIR H:\*.* /B /O:-D') DO COPY "%%~fI" "F:\"

7 more replies
Relevance 47.15%

I've got a task that I need to repeat 100 times in a CAD program.

I've written a small script in the CAD program that takes a model and does a bunch of things to it, saves it, and closes it. (That part is taken care of, but I want to automate it)
That script is written in a text file. But it's specific to that model.

What I want to do is write a Batch file that will:
1. Look into a folder and put the list of files in a variable or list.txt
2. Replace "filename" in my script with the first file in the variable/list.txt
3. Run my script
4. Select the next "filename" in the variable/list.txt
5. Repeat 2-4 until there are no more files left

Thank you very much for your time

I've never written a batch before, so please bear with me.
What I've got so far, and commented to finish what I want to do but don't know how:
[CODE]
@ECHO OFF
REM Prompts user for the directory
set /p pathName=Enter the File Path of the folder:

REM Get file names and store in a text file
dir /s /b "pathName*.*">"list.txt"

REM Count number of files in list="numfile", set number of loops
REM SET i=1, For i to "numfile" DO

REM Take 1st file from list and store in variable "filename"

REM Put "filename" in script

REM Run script
C:\fileLocation\script

REM Close script
Close C:\fileLocation\script

REM Goto "filename" i+1

REM Repeat Put/Run/Close/Goto until done

Answer:Batch file that replaces a filename in a txt file

Hi and Welcome to SevenForums,

Not sure what you want to do with the filenames so i have put an example together here that may help.

I can see you are counting the files and then trying to repeat until all files have been done, i think this task would be better using a FOR LOOP, this may help understand it a little - For /f - Loop through text | Windows CMD | SS64.com

Here is the code i have put put together quickly, towards the bottom is where you see the FOR Loop, essentially what it is doing is looping through the stated file (list.txt) and setting them to the variable %%a then i am telling it to echo %%a, you need to change that bit... rather than echo %%a you need to make it do what you want, depending on what that is the script may need more work.

Disclaimer - Always test the code on dummy data before using on live data

Code:
@ECHO OFF
REM Prompts user for the directory
set /p pathName=Enter the File Path of the folder:

REM 1. Change to the location set above
REM 2. List all files in that directory and store in a text file on desktop
cd %pathName%
dir /s /b *.* > c:\users\%username%\desktop\list.txt
REM Runs 'for loop' to run script against each file in list.txt

REM Currently it just echos the names of the files to the screen and pauses
REM so you can see them on screen, you need to replace the "ECHO %%A" with your command
for /f %%a in (c:\users\%username%\desktop\list.txt) do (echo %%a)

Pause

8 more replies
Relevance 47.15%

I have a couple hundred mixed images of different file types. 80% of them do not have file extensions in the name. Mostly Tiff, EPS (in CMYK), PS, AI, and Jpg. I need to add in file extensions for the correct image type. So all the Tiff files without .tif at the end need .tif added. Same for EPS, AI etc. Some images DO have the extension already and I do not want those changed or an extra extension tagged onto them.

Any suggestions for software to read the file type from the image then add the correct extension if it is missing? I could do it manually but hundreds of manual renames are not my idea of a fun time. I have Vista, XP, 2K, A few Linux distro's etc available, so I can run most modern software.
 

Answer:batch add file extensions to file names.

Do you have "Hide Extensions for Known File Types" enabled in Windows Folder Properties by chance? Or do you just want to have the file extension in the file name?

"The Rename" will do what you want.
 

4 more replies