Search Results

Search found 2563 results on 103 pages for 'batch'.

Page 4/103 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Windows batch-file that continues after launching each program

    - by Sandy
    I'm trying to create a very simple Windows-XP batch file: Program1.exe Sleep 3 Program2.exe Sleep 5 Program3.exe Sleep 11 Of course, I don't want to have to exit each program, before the next 1 starts. The default for batch-files seems to be "stop until the previous program exists". How do I get this script to run as expected? Edit: The 3 executables listed above are more like "notepad" type programs. They open and run and don't just "open,run,close".

    Read the article

  • Batch file installing executable only gives SYSTEM permissions

    - by Alex
    So, I have a couple of batch files that install some executables and they work, but when the executables setup shortcuts on the desktop only SYSTEM has access to them. Is there a way I can prevent that or make it so it adds Domain Users access or something like that. I realize that the batch files are ran under the SYSTEM context, but I'd like to find a way to clean up after them. Thanks in advance!

    Read the article

  • How do I escape ampersands in batch files?

    - by Peter Mortensen
    How do I escape ampersands in a batch file (or from the Windows command line) in order to use the start command to open web pages with ampersands in the URL? Double quotes will not work with start; this starts a new command line window instead. Update 1: Wael Dalloul's solution works. In addition, if there are URL encoded characters (e.g. space is encoded as %20) in the URL and it is in a batch file then '%' must be encoded as '%%'. This is not the case in the example. Example, from the command line (CMD.EXE): start http://www.google.com/search?client=opera&rls=en&q=escape+ampersand&sourceid=opera&ie=utf-8&oe=utf-8 will result in http://www.google.com/search?client=opera being opened in the default browser and these errors in the command line window: 'rls' is not recognized as an internal or external command, operable program or batch file. 'q' is not recognized as an internal or external command, operable program or batch file. 'sourceid' is not recognized as an internal or external command, operable program or batch file. 'ie' is not recognized as an internal or external command, operable program or batch file. 'oe' is not recognized as an internal or external command, operable program or batch file. Platform: Windows XP 64 bit SP2.

    Read the article

  • Reconfiguring, then deleting obsolete pagefile.sys from C: in one go using a batch script

    - by DanielSmedegaardBuus
    I'm trying to set up an automated script for a Windows XP installer. It's a batch script that runs on first boot after installation, and among the things I'm trying to accomplish, is removing the pagefile from C: entirely, and putting a 16-768 MB pagefile on D: instead. Here're my batch file instructions: echo === Creating new page file on D: ... cscript %windir%\system32\pagefileconfig.vbs /create /i 16 /m 768 /vo d: >nul echo. echo === Removing old page file from C: ... cscript %windir%\system32\pagefileconfig.vbs /delete /vo C: attrib -s -h c:\pagefile.sys del c:\pagefile.sys My problem is that while these are sane commands, the removal of the pagefile on C: requires me to reboot before those commands succeed.b Or, in other words — I have to first create the D: pagefile, then reboot and delete the c:\pagefile.sys file, or I'm stuck with a c:\pagefile.sys file which isn't even recognized by Windows itself (it'll just say that there's a page file on D:, and that C: has no pagefile at all). Obviously because already some pages are written to the C:\pagefile.sys file. So how would I go about accomplishing this in one go? Or, in two gos, if this is "batch scriptable" :) TIA, Daniel :) EDIT: I should probably clarify: Running those commands above are all valid, but they'll only succeed fully if I re-run the "attrib" and "del" commands at next boot. The C: pagefile is in use at the time, so I cannot delete the file it uses, and Windows itself won't remove it when I configure it to not use C: as a page file drive. Instead, it'll leave an orphaned c:\pagefile.sys file behind (which is really large). I don't necessarily need this to work in one go, registering the last two commands to run after a reboot would also be great :)

    Read the article

  • batch copy files with error log on missing permissions

    - by sc911
    Hi *, I'm searching for a tool to batch-copy files, that should support the following points: copy files from a net-share report any errors show errors only or filter log on errors don't stop on an error also report if a file or a folder could not be copied due to missing permissions if possible it should have a queue where new job can be added while copying I tried the following tools: TerraCopy: takes a lot time to just calculate the time and the size of the job and does not report errors due to missing permissions (it doesn't even add those files to the copy-queue) Karne's replicator: does not report errors due to missing permissions xcopy: does a great job when using the right parameters and piping the output to a file (in the German localization xcopy /k /r /e /i /s /c /h SOURCE TARGET>LOGFILE 2>&1 will do the job. opening the logfile in IE will give you a great monitor). but quing jobs it not possible (ok, you can join them all in a batch-file, but you can not queue jobs while another one is running (hm, thinking of a batch-script that loops through a file with the source-target-config...)) to be continued Which tools do you use? Tell me! Thx sc911

    Read the article

  • Enter network credentials as part of batch script

    - by Michael
    WinXP: I have several system services that are needed to run some machinery in my lab. The machine these services are running uses a lab login that has administrator rights. Our IS department, unfortunately, has it set up where at some point during the night the login "loses" the privilege level to start/stop these services. The account stays logged in, but the software controlling my hardware becomes unresponsive. In order to get things back up and running, I have to stop the system services and restart them. Because of the security settings, however, I have to re-enter the user password to start the service (even though the user was never logged out). That, I get the "This service cannot be started due to a logon failure" and I have to enter the password. What would be ideal is to have a batch script run before anyone gets into work that stops all of the necessary services, enters the user credentials when prompted, and then restarts them so that everything is ready for first shift to run. I assumed that using the Task Scheduler in Windows would work as it allows you to run batch files with a user's name and password, but this didn't seem to do the trick. With this setup I would arrive to find that all the services are stopped but not started again. (Presumably because the authentication failed.) The batch file is about as simple as it gets, all I have is: net stop "Service1" net stop "Serivce2" etc., then restart in reverse order based on dependency: net start "Service2" net start "Serivce1" What would it take to accomplish what I'm trying to do and restart the services?

    Read the article

  • Batch file to perform a looped search based on the line items of a text file.

    - by Tulga
    I have been reading great posts in this forum and got close to what I want to do but couldn't figure out the exact code. I want to create a windows batch file to do following: Perform a looped search for each line item of a text file (this is a list of keyword) to locate files in a a specific directory For this search partial match is okay. Each time a file is found, move it to a predefined directory (e.g. C:\temp\search_results) Thanks.

    Read the article

  • Escaping an equals sign in DOS batch string replacement command

    - by Alastair
    Hi, I need to replace some text in a JNLP file using a DOS batch file to tune it for the local machine. The problem is that the search pattern contains an equals sign which is messing up the string replacement in the batch file. I want to replace the line, <j2se version="1.5" initial-heap-size="100M" max-heap-size="100M"/> with specific settings for the initial and max heap sizes. For example at the moment I have, for /f "tokens=* delims=" %%a in (%filePath%agility.jnlp) do ( set str=%%a set str=!str:initial-heap-size="100M"=initial-heap-size="%min%M"! echo !str!>>%filePath%new.jnlp) but the = in the search pattern is being read as part of the replacement command. How do I escape the equals sign so it is processed as text?

    Read the article

  • Photoshop batch image processing based on EXIF?

    - by davr
    I use Photoshop to batch convert my RAW files to JPG. I was wondering if there was a way to make it take different actions based on EXIF? With my particular camera lens, if I open it all the way to F1.7 there is noticeable vignetting, but stopping down smaller doesn't have that problem. What I'd like to do is have Photoshop batch process all my RAW files, and anything that is at F1.7 it should automatically apply vignette correction, but not on the others (applying correction to the others would over-brighten the corners of the image). Is anything like this possible? Should I use some other RAW processing tool instead? FYI they are RW2 files from a Panasonic GF1 camera.

    Read the article

  • variables in batch scripts [closed]

    - by richzilla
    I'm trying to set up a batch file to automatically deploy a php app to a web server. Basically, what I want is an entirely automated process: I would just give it a revision number from the repository and it would then export the files, upload via ftp and then update deployment info at the repo host (codebase). However, I'm starting from scratch here. How would I set up a batch file to accept a variable when it was run? For example, the command myfile.bat /revision 42 should deploy revision 42 to my server. If anyone can point me in the right direction I'd appreciate it.

    Read the article

  • Recursive Batch File

    - by MCZ
    I have a file that looks this: head1,head2,head3,head4,head5,head6 a11,a12,keyA,a14,a15,a16 a21,a22,keyB,a24,a25 a31,a32,keyC,a34 a41,a42,keyB,a44,a44 a51,a52,keyA,a54,a55,a56 a61,a62,keyA,a64,a65,a66 a71,a72,keyC,a74 some message Objective: Write list of unique keys to a text file. For example, the result for the file described above should be: keyA, keyB, keyC Here's the pseudocode I would like to implement in batch file recur.bat Read second line of inputfile If no key exist on second line, return else continue Append keyX to list FINDSTR /v keyX inputfile Pipe results to recur.bat I don't know if this is the most efficient way to do this without using actual programming language. Any suggestions for actual batch file code?

    Read the article

  • Copying single files into a folder that changes name every time the batch file is executed

    - by Daniel Jochem
    Can you please help, I am using this to put the text files made by the batch file into the folder created by the batch file as well. but my problem is that the name is changed of the new folder every time because it is named by the date and time it was created. This is the code: @echo off for /F " tokens=1,2,3* delims=/, " %%i IN ('date /T') DO ( set CUR_DAY_OF_WEEK=%%i set CUR_MONTH=%%j set CUR_DAY=%%k set CUR_YEAR=%%l) for /F " tokens=1,2,3* delims=:, " %%i IN ('time /T') DO ( set CUR_HOUR=%%i set CUR_MIN=%%j set AM_PM=%%k) if not exist E:\Private goto :F cd E:\Private md "E:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%" goto :start :F if not exist F:\Private goto :G cd F:\Private md "F:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%" goto :start :G cd G:\Private md "G:\Private\%CUR_HOUR%.%CUR_MIN%%AM_PM% %j%%CUR_MONTH%-%CUR_DAY%-%CUR_YEAR%" goto :start :start start /min A /stext A.txt start /min B /stext B.txt start /min C /stext C.txt start /min D /stext D.txt (As the directory (E:-G:) changes, how can I check all without an error? And once that is found, then put all these text files into the date folder.

    Read the article

  • DOS Batch file to find "new" files by date

    - by Todd McArthur
    My PC has entered an infinite BSOD loop - but I do have access to a safe-mode command prompt. I'm trying to get an idea of "what changed" that might have triggered this. e.g. I might have gotten a virus, or an app update went belly up. I'd like to thus see which files were created/modified in the last few days/week or at least the *.exe, *.dll, *.com, *.bat etc. I thought I was ok with my Batch-fu but I'm stumped on how to write a quick batch file/command that would list the files for me. REM This will find the files, but the results are all muddled REM all EXE files, reverse sort by date, recursively through sub-directories dir *.exe /O-D /S What I'd really like is to find all (executable filetypes) that were created/modified in the last 3-7 days. Can anyone point me in the right direction?

    Read the article

  • Writing a simple batch file to setup a variable?

    - by Sam
    I want to write a simple batch file where i want to setup a environment variable based on the machine architecture. It is as below: set ARCH=%PROCESSOR_ARCHITECTURE% echo %ARCH% if %ARCH%==x86 ( set JAVA_ROOT=C:\Progra~1\Java\j2re1.4.2_13 ) else ( set JAVA_ROOT=C:\Progra~2\Java\j2re1.4.2_13 ) echo JAVA_ROOT is %JAVA_ROOT% On 64-bit machine where the architecture is 'AMD64' the JAVA_ROOT will be displayed as 'C:\Progra~2\Java\j2re1.4.2_13' at the echo statement. But when i run an application that uses this file, the first value of JAVA_ROOT would be picked up 'C:\Progra~1\Java\j2re1.4.2_13'. I don't have any idea why it goes in the 'if' part even though i am running this on 64-bit Windows7. When i echoed the

    Read the article

  • if exist !SOMEPATH! not working in batch file

    - by akash
    I have a batch script in which i am using multiple if exist statement, the problem is all statements are working except one . Following variables are set SETLOCAL ENABLEDELAYEDEXPANSION SET basedrive=E: SET tfworkspace=!basedrive!\TFS SET envdefault=%1 SET projenv=!envdefault! echo subapp=!subapp! subappservice=!subappservice! SET tfworkspacepath=!tfworkspace!\!releasebranch!\!app!\!subapp! SET tfworkspacepathservice=!tfworkspace!\!releasebranch!\!app!\!subapp!\sourcecode\build\!projenv! This statement works, if exist "!tfworkspacepath!" (robocopy "!tfworkspacepath!"\sourcecode\messagebroker\ /E /NFL /NJS /NDL /ETA "!basedir!\!messagebroker!" ) else SET /a foldererror=1 This statement doesn't work, by does not work i mean even thou the path does not exist it it still tries to robocopy. if exist !tfworkspacepathservice! ( robocopy !tfworkspacepathservice! /E /NFL /NJS /NDL /ETA "!basedir!\!scripts!") else SET /a foldererror =!foldererror!+1 I am new to batch writing, please guide me

    Read the article

  • Error in batch file to copy folder: 'Invalid number of parameters'

    - by Daniel
    I am making a batch file in Windows XP to copy my folders I need to another folder on my PC. I am getting an error. I get the error "Invalid number of parameters". xcopy /s/z D:\Documents and Settings\%username%\Desktop C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\Favorites C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\Start Menu C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\My Documents C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\PrintHood C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\NetHood C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\Templates C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\Searches C:\SomeRandomFolder\ xcopy /s/z D:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\Outlook C:\SomeRandomFolder\ pause Then I changed the batch and get this error: "File not found - Desktop" xcopy /s/z D:\...\%username%\Desktop C:\SomeRandomFolder\ pause How do I fix these errors?

    Read the article

  • How to concatenate multiple lines of log file into single variable in batch file?

    - by psych
    I have a log file containing a stack trace split over a number of lines. I need to read this file into a batch file and remove all of the lines breaks. As a first step, I tried this: if exist "%log_dir%\Log.log" ( for /F "tokens=*" %%a in ("%log_dir%\Log.log") do @echo %%a ) My expectation was that this would echo out each line of the log file. I was then planning to concatenate these lines together and set that value in a variable. However, this code doesn't do what I would expect. I have tried changing the value of the options for delims and tokens, but the only output I can get is the absolute path to the log file and nothing from the contents of this file. How can I set a variable to be equal to the lines of text in a file with the line breaks removed?

    Read the article

  • Administrator's shortcut to batch file with double quoted parameters

    - by XXB
    Take an excruciatingly simple batch file: echo hi pause Save that as test.bat. Now, make a shortcut to test.bat. The shortcut runs the batch file, which prints "hi" and then waits for a keypress as expected. Now, add some argument to the target of the shortcut. Now you have a shortcut to: %path%\test.bat some args The shortcut runs the batch file as before. Now, run the shortcut as administrator. (This is on Windows 7 by the way.) You can use either right-click - Run as Administrator, or go to the shortcut's properties and check the box in the advanced section. Tell UAC that it's okay and once again the shortcut runs the batch file as expected. Now, change the arguments in the target of the shortcut to add double quotes: %path%\test.bat "some args" Now try the shortcut as administrator. It doesn't work this time! A command window pops up and and disappears too fast to see any error. I tried adding test.log 2&1 to the shortcut, but no log is created in this case. Try running the same shortcut (with the double quotes) but not as Administrator. It runs the batch file fine. So, it seems the behavior is not because of the double quoted parameters, and it's not because it's run as Administrator. It's some weird combination of the two. I also tried running the same command from an administrator's command window. This ran the batch file as expected without error. Running the shortcut from the command window spawned a new command window which flashed and went away. So apparently the issue is caused by a combination of administrator, the shortcut, and the double quotes. I'm totally stumped, does anyone have any idea what's going on?

    Read the article

  • Running batch file through a service.

    - by wallz
    I'm trying to schedule a batch file to run through a third party application, however the output file doesn't get created in the directory. If I run the .BAT file from the command line, it works and the file gets created. Also using the Windows Schedule will also succeed. Basically, the 3rd party software will schedule the .BAT file and it shows success within the 3rd party user interface. The difference between running from the command prompt and the software, is that the software will use its Windows service to launch the batch. The 3rd party software will show success since it was able to successfully call the .BAT file to run, however it has no control of the other EXE's that's being called within the script. I'm able to run a simple .BAT file in the 3rd party software, for example a copy command. The .BAT I'm having problems with calls a compiled EXE which launches Excel to create a file to a location. The .bat file calls something.exe, which then calls Excel.exe: C:\something.exe -o D:\filename.xlsm C:\filename.xlsm refresh_pivot Do you think it's a permissions issue? I used Process Monitor to verify any Access Denied errors but everything seems to be working according to the trace. It worked on a non-64-bit OS, I'm currently using Win2008 64-bit.

    Read the article

  • Moving hidden files/folders with the command-line or batch-file

    - by Synetech
    Question Does anyone know of a way to move files and folders that have the hidden, system, or read-only attribute set from the command-line or a batch file? (No, stripping the attributes first is not an option since there is no practical way to know which attributes were set in order to re-set them after the move.) (Failed) Attempts Using the basic move command does not work with items with the hidden or system attribute set and for some reason, it does not have switches to specify attributes like the dir and del commands do. I tried using a utility I wrote that uses the shell’s file operation function, but that requires using start /w to prevent the batch file from running on ahead, and it complains about long-filename support for some reason. I tried using robocopy, but it first copies the files and then deletes the originals instead of simply moving the source (which results in a frustrating delay, even with the excessive output redirected to nul). (Surprisingly it seems that few people have ever needed to move hidden files from the command-line. All I could find was this one person who abandoned the attempt.)

    Read the article

  • Migrating ODBC information through a batch file

    - by DeskSide
    I am a desktop support technician currently working on a large scale migration project across multiple sites. I am looking at a way to transfer ODBC entries from Windows XP to Windows 7. If anyone knows of a program or anything prebuilt that already does this, please redirect me. I've already looked but haven't found anything, so I'm trying to build my own. I know enough basic programming to read the work of others and monkey around with something that already exists, but not much else. I have come across a custom batch file written at one site that (among other things) exports ODBC information from the old computer and stores it on a server (labelled as y: through net use at the beginning of the file), then later transfers it from the server to a new computer. The pre-existing code is for Windows XP to XP migrations. Here are the pertinate bits of code: echo Exporting ODBC Information start /wait regedit.exe /e "y:\%username%\odbc.reg" HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI (and later on) echo Importing ODBC start /wait regedit /s "y:\%username%\odbc.reg" We are now migrating from Windows XP to 7, and this part of the batch file still seems to work for this particular site, where Oracle 8i and 10g are used. I'm looking to use my cut down version of this code at multiple sites, and I'm wondering if the same lines of code will still work for anything other than Oracle. Also, my research on this issue has shown that there are different locations in 64 bit operating systems for 32/64 bit entries, and I'm wondering what effect that would have on the code. Could I copy the same data to both parts of the registry, in hopes of catching everything? Any assistance would be appreciated. Thank you for your time.

    Read the article

  • How does the Windows RENAME command interpret wildcards?

    - by dbenham
    How does the Windows RENAME (REN) command interpret wildcards? The built in HELP facility is of no help - it doesn't address wildcards at all. The Microsoft technet XP online help isn't much better. Here is all it has to say regarding wildcards: "You can use wildcards (* and ?) in either file name parameter. If you use wildcards in filename2, the characters represented by the wildcards will be identical to the corresponding characters in filename1." Not much help - there are many ways that statement can be interpretted. I've managed to successfully use wildcards in the filename2 parameter on some occasions, but it has always been trial and error. I haven't been able to anticipate what works and what doesn't. Frequently I've had to resort to writing a small batch script with a FOR loop that parses each name so that I can build each new name as needed. Not very convenient. If I knew the rules for how wildcards are processed then I figure I could use the RENAME command more effectively without having to resort to batch as often. Of course knowing the rules would also benefit batch development. (Yes - this is a case where I am posting a paired question and answer. I got tired of not knowing the rules and decided to experiment on my own. I figure many others may be interested in what I discovered)

    Read the article

  • Old School Wizardry Tip: Batch File Comments

    - by jkauffman
    Johnny, the Endangered Keyboard-Driven Windows User Some of my proudest, obscure Windows tricks are losing their relevance. I know I’m not alone. Keyboard shortcuts are going the way of the dodo. I used to induce fearful awe by slapping Ctrl+Shift+Esc in front of the lowly, pedestrian Windows users. No windows key on the keyboard? No problem: Ctrl+Esc. No menu key on the keyboard: Shift+F10. I am also firmly planted in the habit of closing windows with the Alt+Space menu (Alt+Space, C); and I harbor a brooding, slow=growing list of programs that fail to support this correctly (that means you, Paint.NET). Every time a new version of windows comes out, the support for some of these minor time-saving habits get pared out. Will I complain publicly? Nope, I know my old ways should be axed to conserve precious design energy. In fact, I disapprove of fierce un-intuitiveness for the sake of alleged productivity. Like vim, for example. If you approach a program after being away for 5 years, having to recall encyclopedic knowledge is a flaw. The RTFM disciples have lost. Anyway, some of the items in my arsenal of goofy time-saving tricks are still relevant today. I wanted to draw attention to one that’s stood the test of time. Remember Batch Files? Yes, it’s true, batch files are fading faster than the world of print. But they're not dead yet. I still run into some situations where I opt to use batch files. They are still relevant for build processes, or just various development workflow tools. Sure, there’s powershell, but there’s that stupid Set-ExecutionPolicy speed bump standing in your way; can you really spare the time to A) hunt down that setting on all machines affected and/or B) make futile efforts to convince your coworkers/boss that the hassle was worth it? When possible, I prefer the batch file wild card. And whenever I return to batch files, I end up researching some of the unintuitive aspects such as parameters, quote handling, and ERRORLEVEL. But I never have to remember to use “REM” for comment lines, because there’s a cleaner way to do them! Double Colon For Eye-Friendly Comments Here is a very simple batch file, with pretty much minimal content: @ECHO OFF SETLOCAL REM This is a comment ECHO This batch file doesn’t do much If you code on a daily basis, this may be more suitable to your eyes: @ECHO OFF SETLOCAL :: This is a comment ECHO This batch file doesn’t do much Works great! I imagine I find it preferable due to the similarity to comments in other situations: // or ;  or # I’ve often make visual pseudo-line breaks in my code, and this colon-based syntax works wonders: @ECHO OFF SETLOCAL :: Do stuff ECHO Doing Stuff :::::::::::::::::::::::::::: :: Do more stuff ECHO This batch file doesn’t do much Not only is it more readable, but there’s a slight performance benefit. The batch file engine sees this as an invalid line label and immediately reads the following line. Use that fact to your advantage if this trick leads you into heated nerd debate. Two Pitfalls to Avoid Be aware of that there are a couple situations where this hack will fail you. It most likely won’t be a problem unless you’re getting really sophisticated with your batch files. Pitfall #1: Inline comments @ECHO OFF SETLOCAL IF EXIST C:\SomeFile.txt GOTO END ::This will fail :END Unfortunately, this fails. You can only have whitespace to the left of your comments. Pitfall #2: Code Blocks @ECHO OFF SETLOCAL IF EXIST C:\SomeFile.txt (         :: This will fail         ECHO HELLO ) Code blocks, such as if statements and for loops, cannot contain these comments. This is ultimately due to the fact that entire code blocks are processed as a single line. I originally learned this from Rob van der Woude’s site. He goes into more depth about the behavior of the pitfalls as well, if you are interested in further details. I hope this trick earns you serious geek rep!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >