Search Results

Search found 3546 results on 142 pages for 'dos batch'.

Page 17/142 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • 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

  • batch execute from mysql

    - by user3737088
    I need an interface for my web interface to bat files automatically temporarily to build and run. The contents of the file should come from a table in a MySQL database. It is so no matter what is in the table, the interface should run it. The web interface is based on the PHP version 5.5.6. Try and experiment After 3 months, I'm at the end and I have no ideas more. Has anyone an idea? Windows 2008 R2 IIS7 web server Full access EDIT: The batch files run through not only short. They sometimes run 1 week and longer.

    Read the article

  • Flow control in a batch file

    - by dboarman-FissureStudios
    Reference Iterating arrays in a batch file I have the following: for /f "tokens=1" %%Q in ('query termserver') do ( if not ERRORLEVEL ( echo Checking %%Q for /f "tokens=1" %%U in ('query user %UserID% /server:%%Q') do (echo %%Q) ) ) When running query termserver from the command line, the first two lines are: Known ------------------------- ...followed by the list of terminal servers. However, I do not want to include these as part of the query user command. Also, there are about 4 servers I do not wish to include. When I supply UserID with this code, the program is promptly exiting. I know it has something to do with the if statement. Is this not possible to nest flow control inside the for-loop? I had tried setting a variable to exactly the names of the servers I wanted to check, but the iteration would end on the first server: set TermServers=Server1.Server2.Server3.Server7.Server8.Server10 for /f "tokens=2 delims=.=" %%Q in ('set TermServers') do ( echo Checking %%Q for /f "tokens=1" %%U in ('query user %UserID% /server:%%Q') do (echo %%Q) ) I would prefer this second example over the first if nothing else for cleanliness. Any help regarding either of these issues would be greatly appreciated.

    Read the article

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

    - 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

  • 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

  • Batch script crashing

    - by TamirGali
    My Batch script keeps crashing with the note: "set was unexpected at this time" which I could only see via video recording and checking frame by frame. here is the script: @echo off color 6f set min=0 set max=25 goto REDIR :REDIR set var=0 goto TOP :TOP cls set /a var=%var%+1 set /a rand%var%=%random% %% (max - min + 1)+ min if %rand2%==%rand1% set var=0&goto TOP if %rand3%==%rand2% set var=1&goto TOP if %rand4%==%rand3% set var=2&goto TOP if %rand5%==%rand4% set var=3&oto TOP if %rand6%==%rand5% set var=4&goto TOP if %rand7%==%rand6% set var=5&goto TOP if %rand8%==%rand7% set var=6&goto TOP if %rand9%==%rand8% set var=7&goto TOP if %rand10%==%rand9% set var=8&goto TOP if %rand11%==%rand10% set var=9&goto TOP if %rand12%==%rand11% set var=10&goto TOP if %rand13%==%rand12% set var=11&goto TOP if %rand14%==%rand13% set var=12&goto TOP if %rand15%==%rand14% set var=13&goto TOP if %rand16%==%rand15% set var=14&goto TOP if %rand17%==%rand16% set var=15&goto TOP if %rand18%==%rand17% set var=16&goto TOP if %rand19%==%rand18% set var=17&goto TOP if %rand20%==%rand19% set var=18&goto TOP if %rand21%==%rand20% set var=19&goto TOP if %rand22%==%rand21% set var=20&goto TOP if %rand23%==%rand22% set var=21&goto TOP if %rand24%==%rand23% set var=22&goto TOP if %rand25%==%rand24% set var=23&goto TOP if %rand26%==%rand25% set var=24&goto TOP if %var%==26 goto SHOW goto TOP :SHOW cls echo A=%rand1% echo B=%rand2% echo C=%rand3% echo D=%rand4% echo E=%rand5% echo F=%rand6% echo G=%rand7% echo H=%rand8% echo I=%rand9% echo J=%rand10% echo K=%rand11% echo L=%rand12% echo M=%rand13% echo N=%rand14% echo O=%rand15% echo P=%rand16% echo Q=%rand17% echo R=%rand18% echo S=%rand19% echo T=%rand20% echo U=%rand21% echo V=%rand22% echo W=%rand23% echo X=%rand24% echo Y=%rand25% echo Z=%rand26% pause goto REDIR

    Read the article

  • Google App-Engine Java Batch Update

    - by Manjoor
    I need to upload a .csv file and save the records in bigtable. My application successfully parse 200 the records in the csv files and save to table. Here is my code to save the data. for (int i=0;i<lines.length -1;i++) //lines hold total records in csv file { String line = lines[i]; //The record have 3 columns integer,integer,Text if(line.length() > 15) { int n = line.indexOf(","); if (n>0) { int ID = lInteger.parseInt(ine.substring(0,n)); int n1 = line.indexOf(",", n + 2); if(n1 > n) { int Col1 = Integer.parseInt(line.substring(n + 1, n1)); String Col2 = line.substring(n1 + 1); myTable uu = new myTable(); uu.setId(ID); uu.setCol1(MobNo); Text t = new Text(Col2); uu.setCol2(t); PersistenceManager pm = PMF.get().getPersistenceManager(); pm.makePersistent(uu); pm.close(); } } } } But when no of records grow it gives timeout error. The csv file may have upto 800 records. Is it possible to do that in App-Engine? (something like batch update)

    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

  • Batch Inserts And Prepared Query Error

    - by ircmaxell
    Ok, so I need to populate a MS Access database table with results from a MySQL query. That's not hard at all. I've got the program written to where it copies a template .mdb file to a temp name and opens it via odbc. No problem so far. I've noticed that Access does not support batch inserting (VALUES (foo, bar), (second, query), (third query)). So that means I need to execute one query per row (there are potentially hundreds of thousands of rows). Initial performance tests show a rate of around 900 inserts/sec into Access. With our largest data sets, that could mean execution times of minutes (Which isn't the end of the world, but obviously the faster the better). So, I tried testing a prepared statement. But I keep getting an error (Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect , SQL state 07001 in SQLExecute in D:\....php on line 30). Here's the code I'm using (Line 30 is odbc_execute): $sql = 'INSERT INTO table ([field0], [field1], [field2], [field3], [field4], [field5]) VALUES (?, ?, ?, ?, ?, ?)'; $stmt = odbc_prepare($conn, $sql); for ($i = 200001; $i < 300001; $i++) { $a = array($i, "Field1 $", "Field2 $i", "Field3 $i", "Field4 $i", $i); odbc_execute($stmt, $a); } So my question is two fold. First, is there any idea on why I'm getting that error (I've checked, and the number in the array matches the field list which matches the number of parameter ? markers)? And second, should I even bother with this or just use the straight INSERT statements? Like I said, time isn't critical, but if it's possible, I'd like to get that time as low as possible (Then again, I may be limited by disk throughput, since 900 operations/sec is high already)... Thanks

    Read the article

  • Handling nmake errorlevel/return codes

    - by tlianza
    Hi all, I have an nmake-based project which in turn calls the asp compiler, which can throw an error, which nmake seems to recognize: NMAKE : fatal error U1077: 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe' : return code '0x1' However, when I call nmake from within a batch file, the environment variable %ERRORLEVEL% remains set at zero: nmake /NOLOGO echo BUILD RETURNING: %ERRORLEVEL% If I control-c the nmake task, I do end up getting a non-zero ERRORLEVEL (it's set to 2) so my assumption is that I'm able to catch errors okay, but nmake isn't bubbling up the non-zero exit code from it's task. Or, at least, I'm mis-trapping it. Any help would be appreciated.

    Read the article

  • Moving a large number of files in one directory to multiple directories

    - by Axsuul
    I am looking to create a Windows batch script to move about 2,000 files and splitting them up so that there are 10 files per folder. I have attempted creating a batch script but the syntax really boggles my mind. Here is what I have so far @echo off :: Config parameters set /a groupsize = 10 :: initial counter, everytime counter is 1, we create new folder set /a n = 1 :: folder counter set /a nf = 1 for %%f in (*.txt) do ( :: if counter is 1, create new folder if %n% == 1 ( md folder%nf% set /a n += 1 ) :: move file into folder mv -Y %%f folder%nf%\%%f :: reset counter if larger than group size if %n% == %groupsize% ( set /a n = 1 ) else ( set /a n += 1 ) ) pause Basically what this script does is loop through each .txt file in the directory. It creates a new directory in the beginning and moves 10 files into that directory, then creates a new folder again and moves another 10 files into that directory, and so on. However, I'm having problems where the n variable is not being incremented in the loop? I'm sure there's other errors too since the CMD window closes on me even with pause. Any help or guidance is appreciated, thanks for your time!

    Read the article

  • Watch a Machine Get Upgraded from MS-DOS to Windows 7 [Video]

    - by ETC
    What happens if you try to upgrade a machine from MS-DOS to Windows 7? One curious geek ran the experiment using VMWare and recorded the whole, surprisingly fluid, ride for our enjoyment. Andrew Tait was curious, what would happen if you followed the entire upgrade arc for Windows from the 1980s to the present all on one machine? Thanks to VMWare he was able to find out, following the upgrade path all the way from MS-DOS to Windows 7. Check out the video below to see what happens: Chain of Fools: Upgrading Through Every Version of Windows [YouTube via WinRumors] Latest Features How-To Geek ETC Learn To Adjust Contrast Like a Pro in Photoshop, GIMP, and Paint.NET Have You Ever Wondered How Your Operating System Got Its Name? Should You Delete Windows 7 Service Pack Backup Files to Save Space? What Can Super Mario Teach Us About Graphics Technology? Windows 7 Service Pack 1 is Released: But Should You Install It? How To Make Hundreds of Complex Photo Edits in Seconds With Photoshop Actions Access and Manage Your Ubuntu One Account in Chrome and Iron Mouse Over YouTube Previews YouTube Videos in Chrome Watch a Machine Get Upgraded from MS-DOS to Windows 7 [Video] Bring the Whole Ubuntu Gang Home to Your Desktop with this Mascots Wallpaper Hack Apart a Highlighter to Create UV-Reactive Flowers [Science] Add a “Textmate Style” Lightweight Text Editor with Dropbox Syncing to Chrome and Iron

    Read the article

  • exit /B 0 does not work...

    - by murxx
    Hi, I have the following problem: I have created a batch script which calls itself in there (for being able to write a log in parallel). In the script I start another process (like start startServer.bat) which starts up a java process and keeps opened up all the time. In my original script I wait 30 seconds, check if the process is running and do an: exit /B 0 Unfortunately that does not work, the window shows that the exit /B 0 is being evaluated, but the window still keeps open. When I close the window with the other process (meaning the "child" processes started up in my .bat) my script continues its run. So: scriptA.bat - in there I call: start startServer.bat - wait 30 seconds - check is server is started - exit /B 0 Process hangs up! What's very odd, if I wrap another script around, like: scriptB.bat - call scriptA.bat ----- in there I call: start startServer.bat ----- wait 30 seconds ----- check is server is started ----- exit /B 0 - scriptA.bat continues without any hangup! I also tried the same with exit 0 (without /B) also, same result! In the first case it hangs up, in the second case my window closes as expected... Has anyone of you ever had such a problem before and knows what's wrong here? Process hangs up!

    Read the article

  • Calling nested batch files in Windows 2008 R2 task scheduler

    - by Nisha
    I am trying to schedule a batch file in Windows 2008 R2 Server. My batch file internally calls two other batch files. I am trying to schedule this on hourly basis. The schedular calls my batch file correctly but it does not run the other batch files which I am calling internally! Any idea why this is not working? When I run my batch file manually outside the scheduler... it works! Its only with the scheduler that it cannot run the other batch files. I have already tried the UCA option.

    Read the article

  • Prevent command "del /s" from entering a folder

    - by jzuniga
    I need to recursively remove unnecessary files from a svn repository and i have the following batch file to do this: @echo on del /s ~*.* del /s *.~* del /s Thumbs.db However, this is also deleting the entries under the .svn/ subfolders. Is there any way to prevent this commands from being executed under the .svn/ folders so that it doesn't mess things up? Thanks in advance! EDIT: A solution using Bash (cygwin) would also work for me since i just need to do this once.

    Read the article

  • Entity Framework Batch Update and Future Queries

    - by pwelter34
    Entity Framework Extended Library A library the extends the functionality of Entity Framework. Features Batch Update and Delete Future Queries Audit Log Project Package and Source NuGet Package PM> Install-Package EntityFramework.Extended NuGet: http://nuget.org/List/Packages/EntityFramework.Extended Source: http://github.com/loresoft/EntityFramework.Extended Batch Update and Delete A current limitations of the Entity Framework is that in order to update or delete an entity you have to first retrieve it into memory. Now in most scenarios this is just fine. There are however some senerios where performance would suffer. Also, for single deletes, the object must be retrieved before it can be deleted requiring two calls to the database. Batch update and delete eliminates the need to retrieve and load an entity before modifying it. Deleting //delete all users where FirstName matches context.Users.Delete(u => u.FirstName == "firstname"); Update //update all tasks with status of 1 to status of 2 context.Tasks.Update( t => t.StatusId == 1, t => new Task {StatusId = 2}); //example of using an IQueryable as the filter for the update var users = context.Users .Where(u => u.FirstName == "firstname"); context.Users.Update( users, u => new User {FirstName = "newfirstname"}); Future Queries Build up a list of queries for the data that you need and the first time any of the results are accessed, all the data will retrieved in one round trip to the database server. Reducing the number of trips to the database is a great. Using this feature is as simple as appending .Future() to the end of your queries. To use the Future Queries, make sure to import the EntityFramework.Extensions namespace. Future queries are created with the following extension methods... Future() FutureFirstOrDefault() FutureCount() Sample // build up queries var q1 = db.Users .Where(t => t.EmailAddress == "[email protected]") .Future(); var q2 = db.Tasks .Where(t => t.Summary == "Test") .Future(); // this triggers the loading of all the future queries var users = q1.ToList(); In the example above, there are 2 queries built up, as soon as one of the queries is enumerated, it triggers the batch load of both queries. // base query var q = db.Tasks.Where(t => t.Priority == 2); // get total count var q1 = q.FutureCount(); // get page var q2 = q.Skip(pageIndex).Take(pageSize).Future(); // triggers execute as a batch int total = q1.Value; var tasks = q2.ToList(); In this example, we have a common senerio where you want to page a list of tasks. In order for the GUI to setup the paging control, you need a total count. With Future, we can batch together the queries to get all the data in one database call. Future queries work by creating the appropriate IFutureQuery object that keeps the IQuerable. The IFutureQuery object is then stored in IFutureContext.FutureQueries list. Then, when one of the IFutureQuery objects is enumerated, it calls back to IFutureContext.ExecuteFutureQueries() via the LoadAction delegate. ExecuteFutureQueries builds a batch query from all the stored IFutureQuery objects. Finally, all the IFutureQuery objects are updated with the results from the query. Audit Log The Audit Log feature will capture the changes to entities anytime they are submitted to the database. The Audit Log captures only the entities that are changed and only the properties on those entities that were changed. The before and after values are recorded. AuditLogger.LastAudit is where this information is held and there is a ToXml() method that makes it easy to turn the AuditLog into xml for easy storage. The AuditLog can be customized via attributes on the entities or via a Fluent Configuration API. Fluent Configuration // config audit when your application is starting up... var auditConfiguration = AuditConfiguration.Default; auditConfiguration.IncludeRelationships = true; auditConfiguration.LoadRelationships = true; auditConfiguration.DefaultAuditable = true; // customize the audit for Task entity auditConfiguration.IsAuditable<Task>() .NotAudited(t => t.TaskExtended) .FormatWith(t => t.Status, v => FormatStatus(v)); // set the display member when status is a foreign key auditConfiguration.IsAuditable<Status>() .DisplayMember(t => t.Name); Create an Audit Log var db = new TrackerContext(); var audit = db.BeginAudit(); // make some updates ... db.SaveChanges(); var log = audit.LastLog;

    Read the article

  • How to get the Date in a batch file in a predictable format?

    - by AngryHacker
    In a batch file I need to extract a month, day, year from the date command. So I used the following, which essentially parses the Date command to extract its sub strings into a variable: set Day=%Date:~3,2% set Mth=%Date:~0,2% set Yr=%Date:~6,4% This is all great, but if I deploy this batch file to a machine with a different regional/country settings, it fails because month, day and year are in different locations. How can I extract month, day and year regardless of the date format?

    Read the article

  • batch source code downloading perl

    - by Jake
    Hello, I know of the "wget" function in shell, but I'm running perl from the command line on a windows machine and I was looking for a method of sequentially downloading the web source code from a site. For example: for www.abcd.com has the extension of it's subsites as 1,2,3 etc such that www.abcd.com/1 or www.abcd.com/2 is the syntax. I would like the source to be labeled as 1.source, 2.source etc for a defined set of pages 1-100 say. Thanks for the help, Jake

    Read the article

  • Windows Batch Scripting Issue - Quoting Variables containing spaces

    - by Rick
    So here's my issue: I want to use %cd% so a user can execute a script anywhere they want to place it, but if %cd% contains spaces, then it will fail (regardless of quotes). If I hardcode the path, it will function with quotes, but if it is a variable, it will fail. Fails: (if %cd% contains spaces) "%cd%\Testing.bat" Works: "C:\Program Files\Testing.bat" Any ideas?

    Read the article

  • Batch File - REN command's ErrorLevel returns 0 even on failure

    - by FMFF
    This is related to my earlier question. ren "C:\Temp\%%A" "C:\Temp\%%A" if errorlevel 0 ( "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" ) In the above, the IF evaluates to true always, even if REN command fails. The idea is to check if a file is not locked by any other application, if not then Archive it and move it elsewhere. How best to do this? Thank you.

    Read the article

  • batch update SharePoint data

    - by Faiz
    Hi, I need to import user profile information to a sharepoint list. Also, the user profile information will be periodically updated to the list , therefore i think i should use a timer job to update the information. Importing for the first time works without any issues. But can you suggest what can be the best way to update information. The update should take care of updating existing records in profile , mark as orphaned for the records that are deleted from user profile and add new records in user profile to the list. Thanks

    Read the article

  • Batch : list all the subfiles with their absolute path

    - by subtenante
    I want to generate a classpath automatically with al the *.jar files contained under my lib folder. I can't find a way to list all these files with their absolute path, so that I can build my classpath variable. It seems the dir command do not allow to get the absolute path, even when you go recursively with a /s. Basically what I had in mind was something like : set classpath = ./conf for %%i in (`dir /s /withaboslutepath *.jar`) do set classpath = %classpath%;"%%x" Is there a way to achieve this ?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >