Search Results

Search found 69392 results on 2776 pages for 'batch file'.

Page 13/2776 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Check if files in a directory are still being written using Windows Batch Script

    - by FMFF
    Hello. Here's my batch file to parse a directory, and zip files of certain type REM Begin ------------------------ tasklist /FI "IMAGENAME eq 7za.exe" /FO CSV > search.log FOR /F %%A IN (search.log) DO IF %%~zA EQU 0 GOTO end for /f "delims=" %%A in ('dir C:\Temp\*.ps /b') do ( "C:\Program Files\7-Zip\cmdline\7za.exe" a -tzip -mx9 "C:\temp\Zip\%%A.zip" "C:\temp\%%A" Move "C:\temp\%%A" "C:\Temp\Archive" ) :end del search.log REM pause exit REM End --------------------------- This code works just fine for 90% of my needs. It will be deployed as a scheduled task. However, the *.ps files are rather large (minimum of 1GB) in real time cases. So the code is supposed to check if the incoming file is completely written and is not locked by the application that is writing it. I saw another example elsewhere, that suggested the following approach :TestFile ren c:\file.txt c:\file.txt if errorlevel 0 goto docopy sleep 5 goto TestFile :docopy However this example is good for a fixed file. How can I use that many labels and GoTo's inside a for loop without causing an infinite loop? Or is this code safe to be used in the For Loop? Thank you for any help.

    Read the article

  • Read file contents into variable in batch file

    - by Faisal
    I want to read the contents of an external file in a variable inside a batch file. The contents of file contains multiple lines. I found a couple of ways but it either reads the first line or last line or its too complex. I want all content in one variable. Any easier way?

    Read the article

  • feeding input to a java process from a batch file

    - by YGL
    If I have a simple java program that processes lines of text from standard input, then I can run it with the following script: @Echo off java Test < file.txt pause exit The script redirects lines of input from a separate file. Is there a way that I can avoid having to use an extra file? Or is this the easiest way? Thanks.

    Read the article

  • Batch file command PAUSE does not work

    - by Samaursa
    I am creating a simple batch file to assist in a few things, and I have some instructions that it prints out as well that I want the user to see before exit. Currently, the window closes very quickly. So I added PAUSE at the end of the file, but it does not want to work. I looked at other questions on SO and have checked to make sure the line endings are CRLF and that I have CRLF at the end of the file. Any suggestions?

    Read the article

  • How to filter txt file by string with using batch

    - by Antediluvian
    Hello guys I know this kind of problem will be very easy for you but I am total beginner in batch mode. The question is how bat file code should look like to generate a new txt file from specific one . for example . I have report txt Displaying status for license file: 7788@Server01 License Server: server01 License In Use Free ------- ------ ---- Design* 1 6 (user1@host1) 127 server01 7788 4402 Assembly* 0 4 Pro 0 15 AdvSE 2 3 (user2@host2) AdvSE server01 7788 2706 (user3@host3) AdvSE server01 7788 1503 SingleSite_License 1 3 (user4@host4) SingleSite_License server01 7788 2003 Intra_CLIENT_License 1 4 (user2@host2) Intra_CLIENT_License server01 7788 2003 CAD 1 32 ^(user2@host2) CAD server01 7788 501 * = License Extensions - Available only on startup. ^ = Borrowed License. Press any key to continue . . . What I want to have in new file from this one are only lines : SingleSite_License 3 Intra_CLIENT_License 9 but both SingleSite_License and Intra_Client_License should be taken from 1st found string -other are not necessary. report txt can be different and licenses can be showed in different order . if it not possible - other solution can be just only Free value will be written in new txt file - f.e 3 and 9 . so the last string in line which contains specific words thank you for any tips

    Read the article

  • I want to compile a batch file into an exe using c++, i can get through parsing the batch file and w

    - by Nareshkumar Rao
    Ok, here's the thing, I am creating an application in DevC++ that will read in a batch file. then, one by one parsing it using: system(getline(myfile,line)); After setting everything up, I save the newly created file as "main.cpp". The problem is, I want to compile it into an exe, from my program, for the end user. So basically, I'm asking whether I can compile a C++ file from a C++ Exe..

    Read the article

  • parsing urls from windows batch file

    - by modest
    I have a text file (myurls.txt) whose contents are a list of URLs as follow: Slides_1: http://linux.koolsolutions.com/svn/ProjectA/tags/REL-1.0 Exercise_1: http://linux.koolsolutions.com/svn/ProjectA/tags/REL-1.0 Slides_2: http://linux.koolsolutions.com/svn/oldproject/ProjectB/tags/REL-2.0 Exercise_2: http://linux.koolsolutions.com/svn/ProjectB/tags/REL-1.0 Exercise_3: http://linux.koolsolutions.com/svn/BlueBook/ProjectA/tags/REL-1.0 Now I want to parse this text file in a for loop such that after each iteration (for e.g. take the first url from the above file) I have the following information into different variables: %i% = REL-1.0 %j% = http://linux.koolsolutions.com/svn/ProjectA %k% = http://linux.koolsolutions.com/svn/ProjectA/tags/REL-1.0 After some experiment I have the following code but it only works (kind of) if the URLs have same number of slashes: @echo off set FILE=myurls.txt FOR /F "tokens=2-9 delims=/ " %%i in (%FILE%) do ( @REM <do something with variables i, j and k.> ) I am fine with other solutions like for e.g. using Windows Script Host/VBS script as long as it can run with a default Windows XP/7 installation. In other words, I know I can use awk, grep, sed, python, etc. for Windows and get the job done but I don't want the users to have to install anything besides a standard windows installation.

    Read the article

  • Windows XP batch file concat

    - by dls
    I'm trying to accomplish the following ridiculous task: I have a text file containing a set of fully qualified filesnames. I want to iterate through the file and append each line to a common variable, that can be passed to a command line tool. For example, the file might be: C:\dir\test.txt C:\WINDOWS\test2.txt C:\text3.txt and I'd like to assign them to some variable 'a' such that: a = "C:\dir\test.txt C:\WINDOWS\test2.txt C:\text2.txt" A secondary question is - what is a good batch file reference? I'm finding some stuff in the Windows material, and a lot of home-grown websites, but nothing particularly complete. Thanks!

    Read the article

  • Best Practice: Apache File Upload

    - by matnagel
    I am looking for a soultion for trusted users to upload pdf files via html forms (with maybe php involved). This is quite a standard ubuntu linux server with apache 2.x and php 5. I am wonderiung what are the benefits of the apache file upload module. There were no updates for some time, is it actively maintained? What are the advantages over traditional php upload with apache 2 without this module? http://commons.apache.org/fileupload I remember traditional php file upload is difficult with some pitfalls, will the apache file upload module improve the situation? The solution I am looking for will be part of an existing website and be integrated into the admin web frontend. Things I am not considering are webdav, ssh, ftp, ftps, ftp over ssh. Should work with a browser and without installing special client software, so I am asking about a browser based upload without special client side requirements. I can request a modern browser like firefox = 3.5 or modern webkit broser like chrome or safari from the users.

    Read the article

  • Windows file association for README, INSTALL, LICENSE and the like [closed]

    - by Lumi
    Possible Duplicate: How to set the default program for opening files without an extension in Windows? Many files originating in the UNIX world come without file extension. Popular examples include README, INSTALL, LICENSE. We know for a fact that these are text files. It is therefore a bit disappointing not to be able to just double-click them open in Explorer and see them in Notepad (actually, Notepad2 because of the UNIX line endings which silly Microsoft Notepad doesn't render correctly). Does anyone know of a way to create a file association for, say, README files without extension? This could then be replicated to cover the most frequently occurring file types, and then double-clicking them open would work. Update (Sort of in response to all your comments.) Thanks, folks, your comments and answers have helped me. @Indrek, yes, I was under the assumption that you could somehow create an association for just README or Makefile, and couldn't do so for files without extension. Turns out the contrary is true, and yes, that is a workaround that neatly solves the issue. Ultimately, I just want to be able to double-click to open a README or Makefile, that's all. @Sampo, the SendMe trick is also useful, although usability is not as great as a straight double-click. (I'm really lazy sometimes.) Turns out the following trick using ftype and ftype from an Administrator prompt does the double-click enabling job: assoc .=no_ext ftype no_ext=%SystemRoot%\system32\NOTEPAD.EXE %1 :: You can see it created some entries in the registry: reg query hkcr\no_ext /s reg query hkcr\. /s

    Read the article

  • Windows network: deny file access to another user if file is currently open

    - by Steve
    Some users on my network are having difficulties saving files, because the file is open elsewhere. Let's say Lemuel wants to edit a file, but Bernice in the next office over is working on it. Lemuel opens, edits, and tries to save, but then gets a "no write access" error. Bernice chortles with glee (since earlier that week Lemuel stole her sandwich). Unfortunately, various softwares will not warn the user that they have opened a read-only file. Is there a way (in Windows) to limit file access to ONE user only, i.e. 777 for the first user to open the file, and 000 for all users after that? (Sorry for the Linux terminology but it gets my point across).

    Read the article

  • File Sync Solution for Batch Processing (ETL)

    - by KenFar
    I'm looking for a slightly different kind of sync utility - not one designed to keep two directories identical, but rather one intended to keep files flowing from one host to another. The context is a data warehouse that currently has a custom-developed solution that moves 10,000 files a day, some of which are 1+ gbytes gzipped files, between linux servers via ssh. Files are produced by the extract process, then moved to the transform server where a transform daemon is waiting to pick them up. The same process happens between transform & load. Once the files are moved they are typically archived on the source for a week, and the downstream process likewise moves them to temp then archive as it consumes them. So, my requirements & desires: It is never used to refresh updated files - only used to deliver new files. Because it's delivering files to downstream processes - it needs to rename the file once done so that a partial file doesn't get picked up. In order to simplify recovery, it should keep a copy of the source files - but rename them or move them to another directory. If the transfer fails (network down, file system full, permissions, file locked, etc), then it should retry periodically - and never fail in a non-recoverable way, or a way that sends the file twice or never sends the file. Should be able to copy files to 2+ destinations. Should have a consolidated log so that it's easy to find problems Should have an optional checksum feature Any recommendations? Can Unison do this well?

    Read the article

  • Batch file to java test

    - by out_sider
    I have a very simple question and I've even searched here but it's for a much simpler case than what I found examples of. I have a java program which has a simple System.in on the main function....I simply want to make a bat file which will run the java program and then enter the input stream automatically. What I basicly want is this made by a batch file so I can make a test bench: java Proj module array1{} And I wanted to run more modules as they are my tests. Thanks in advance

    Read the article

  • Modern Batch Processing in Linux

    - by Castro
    What tools, languages, and infrastructure do you use for do batch processing in Linux? I am looking for something that facilitate the tasks of: Process files Log Validation Job Controlling (start,strop,reestart a process) Mysql Connection Thanks for any help!

    Read the article

  • Windows batch files: .bat vs .cmd?

    - by Chris Noe
    As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anyhting older than NT, does it really matter which way I name my batch files, or is there some gotcha awaiting me by using the wrong suffix?

    Read the article

  • pdf2swf using MAC OS Batch command or Apple script

    - by Garth Humphreys
    How do I write a batch process on the Mac for pdf2swf, I want to convert all pdfs in a folder into swf. But pdf2swf doesn't have a option to convert a folder of pdfs to swfs, you have to do it one at a time. I'm not sure how if I should use a Apple script or a Shell script, either one I'm not sure how to get or assign a file name variable. pdf2swf file_name_variable.pdf -o file_name_variable.swf -T 9 -f Thanks

    Read the article

  • Batch commands execution order

    - by Dave18
    I'm looking to run a second batch command from .bat but after the first command has been done. REN "myfile.txt" "my_file.txt" start "title" "path" Here, I want the rename command to be executed before the process I wanted to start that has been terminated or executed. why it doesn't work in sequence order?

    Read the article

  • Using a batch file to create folder and copy files into it to multiple PC's

    - by Greg
    Hi, I have a folder with numerous files that I need to copy to multiple PC's on a network. I thought if the folder didn't exist it would automatically create it. Here's what I have... copy "C:\Documents and Settings\follag\Desktop\Music" "\PC NAME\c$\Documents and Settings\All Users\Desktop\Music" When I look at the destinatin PC, it is not creating the folder and copying the files. I'm new to this whole batch files and would appreciate any help. Thanks, Greg

    Read the article

  • String replacement in batch file

    - by Faisal
    We can replace strings in a batch file using the following command set str="jump over the chair" set str=%str:chair=table% These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it. set word=table set str="jump over the chair" ?? Any ideas?

    Read the article

  • Batch equivilant of Bash backticks

    - by MiffTheFox
    When working with Bash, I can put the output of one command into another command like so: my_command `echo Test` would be the same thing as my_command Test (Obviously, this is just a non-practical example.) I'm just wondering if you can do the same thing in Batch.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >