Search Results

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

Page 45/142 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Concatenate a variable with a string

    - by user311130
    Hello all, I wrote a small bat file: @echo off rem runs the {arg[0].exe} - using its fully qualified name %~f1 IF %errorlevel% NEQ 0 (set boolResult=False) ELSE (set boolResult=True) rem case1 EVENTCREATE /T ERROR /ID 700 /L "MyTest Application" /D "exitcode: %errorlevel%; session id is %SessionName%" rem case3 EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %boolResult%; session id is %SessionName%" rem case4 EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %errorlevel%; session id is %SessionName%" And I have got some questions, if you could help me out... case1: I get the following error: ERROR: 'MyTest Application' log does not exist. Cannot create the event. *The only way to initial eventlog in through high-leve (c#) code? case3: How can I concatenate a string with some bat variable ? case4: How do I add a newline in the description? "exitcode: %boolResult%\n session id is %SessionName%" didn't do that. Thanks for any assistance

    Read the article

  • How to get current datetime on windows command line, in a suitable format for using in a filename?

    - by Rory
    What's a windows command line statement(s) I can use to get the current datetime in a format that I can put into a filename? I want to have a .bat file that zips up a directory into an archive with the current date & time as part of the name, eg "Code_2008-10-14_2257.zip". Is there any easy way I can do this, independent of the regional settings of the machine? I don't really mind about the date format, ideally it'd be yyyy-mm-dd but anything simple is fine. So far I've got this, which on my machine gives me "Tue_10_14_2008_230050_91" rem Get the datetime in a format that can go in a filename. set _my_datetime=%date%_%time% set _my_datetime=%_my_datetime: =_% set _my_datetime=%_my_datetime::=% set _my_datetime=%_my_datetime:/=_% set _my_datetime=%_my_datetime:.=_% rem now use the timestamp by in a new zip file name "d:\Program Files\7-Zip\7z.exe" a -r Code_%_my_datetime%.zip Code I can live with this but it seems a bit clunky. Ideally it'd be briefer and have the format mentioned earlier. I'm using Windows Server 2003 and Win XP Pro. I don't want to install additional utilities to achieve this (although I realise there are some that will do nice date formatting).

    Read the article

  • How to use forfiles (or similar) to delete files older than n days, but always leaving most recent n

    - by Aidan Whitehall
    (Using Windows 2000 and 2003 Server) We use forfiles.exe to delete backup .zip files older than n days, and it works great (command is a bit like below) forfiles -p"C:\Backup" -m"*.zip" -c"cmd /c if @ISDIR==FALSE del \"@PATH\@FILE\"" -d-5 If a .zip file fails to be created, I'd like to ensure that we don't end up with 0 .zip files in the backup after 5 days. Therefore, the command needs to be: "delete anything older than 5 days, but ALWAYS keep the most recent 5 files, EVEN if they themselves are older than 5 days" We can use forfiles.exe or another solution (although anything that is a slick one-liner is ALWAYS preferable to a script file). Thanks!

    Read the article

  • Using Delphi or FFMpeg to create a movie from image sequence

    - by Hein du Plessis
    Hi all My Delphi app has created a squence called frame_001.png to frame_100.png. I need that to be compiled into a movie clip. I think perhaps the easiest is to call ffmpeg from the command line, according to their documentation: For creating a video from many images: ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi The syntax foo-%03d.jpeg specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable. From: http://ffmpeg.org/ffmpeg-doc.html#SEC5 However my files are (lossless) png format, so I have to convert using imagemagick first. My command line is now: ffmpeg.exe -f image2 -i c:\temp\wentelreader\frame_%05d.jpg -r 12 foo.avi But then I get the error: [image2 @ 0x133a7d0]Could not find codec parameters (Video: mjpeg) c:\temp\wentelreader\Frame_C:\VID2EVA\Tools\Mencoder\wentel.bat5d.jpg: could not find codec parameters What am I doing wrong? Alternatively can this be done easily with Delphi?

    Read the article

  • ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDO'

    - by Nitin Gurram
    I am trying to update the table which has millions of records. However my update query will update around 2-3 millions of records. I am facing below error on executing the update query. I googled and found that I need to update the Table Space as DBA But is there any work around for executing the update without actually extending the UNDO table space or something dba is not required UPDATESERVICE SET CREATION_TIME = LAST_UPDATE_TIME WHERE CREATION_TIME is null

    Read the article

  • Using file() incrementally?

    - by NeedBeerStat
    I'm not sure if this is possible, I've been googling for a solution... But, essentially, I have a very large file, the lines of which I want to store in an array. Thus, I'm using file(), but is there a way to do that in batches? So that every,say, 100 lines it creates, it "pauses"? I think there's likely to be something I can do with a foreach loop or something, but I'm not sure that I'm thinking about it the right way... Like $i=0; $j=0; $throttle=100; foreach($files as $k => $v) { if($i < $j+$throttle && $i > $j) { $lines[] = file($v); //Do some other stuff, like importing into a db } $i++; $j++; } But, I think that won't really work because $i & $j will always be equal... Anyway, feeling muddled... Can someone help me think a lil' clearer?

    Read the article

  • Make CMD sensitive to use with MySQL?

    - by acidzombie24
    I have a cleanup scrip in a bat file and i wanted to do the below but the problem is i get a mysql error saying unknown database and showing it as testdb. I guess i can change my code testdb but i would like to know. How do i have windows cmd use case sensitivity so i can execute queries properly instead of always in lower case? mysql.exe -u root -q "drop database TestDB; create database TestDB;"

    Read the article

  • bat cmd or vb script to move specific files from one location to another location

    - by Praveen
    can someone help me with a bat cmd to move specific files from one location to another location my file structure Source location E:\Test1\2011\18\5730547\5730552\html E:\Test1\2011\18\5730547\6430552\html E:\Test1\2011\38\7730140\2330582\html E:\Test1\2011\19\5718547\5730552\html wherein html folder contains css folder, xml and html files. I want to move only file name contains testcase.html and images.html files from the above location to below location Required location E:\Final1\2011\18\5730547\5730552\html E:\Final1\2011\18\5730547\6430552\html E:\Final1\2011\38\7730140\2330582\html E:\Final1\2011\19\5718547\5730552\html Please help me

    Read the article

  • Scheduled task to open URL

    - by Jeremy Stein
    At a certain time each day, I'd like my browser to pop open a tab to a certain URL. My goals: 1. be able to set the URL from the scheduled task 2. use the default browser (rather than hard-coding it) I can't seem to accomplish both of these goals at once. I'll post my partial solutions as answers, but I'm hoping someone will have something better.

    Read the article

  • Problems trying to run fitnesse on cyngwin.

    - by user368453
    Hey there everyone... I was trying to run fitnesse on cyngwin using the command "run -p 8585" but it doesnt work at all... I checked with the command echo $PATH and Cyngwin is recognising the OS variables... Someone know what can be the problem ? PS: The command does work on the windows prompt! Thanks in advance

    Read the article

  • Use .bat file to recursively loop through folders and get hold of .class files

    - by user320550
    HI all, This is what i'm trying to do. I have a .bat file which takes in a argument which is nothing but a folder name. What i do first is go one level up (cd ..). Now in this directory i have 3 folders and each folders have sub-folders and have .class files in them. What i want to do is recursively loop through the folders and get hold of the .class files. Once this is done i want to echo the target folder of the .class file as well as echo the name of the.class file. So c:\temp\potter\myclass.class. I would echo out c:\temp\potter\ and myclass. I'm able to do this by writing a separate bat file which works. But when i integrate this with the recursive function it seems to break. This is what i'm doing: :: call the junit classes... and save the results echo step 3... cd %1 cd .. for /r %%a in (*.class) do set Var=%%a echo Full file location %Var% for %%i in ("%Var%") do Set CF=%%~dpi Set CF=%CF:~0,-1% :LOOP If "%CF:~-1,1%"=="\" GoTo :DONE Set CF=%CF:~0,-1% GoTo :LOOP :DONE Set CF=%CF:~0,-1% echo Folder Location %CF% ::cd %CF% For %%j in ("%Var%") Do Set name=%%~nxj :: -6 because of Quotations Set name=%name:~0,-6% echo File Name %name% echo step 3 complete... However i only get the output of one directory, while i have multiple directories having .class files. This is the output i get: step 3... Full file location C:\NKCV\Project\MyActivities\6_Selenium\htmlTestCasesConve rted2JUnit\iexplore\flow2\testCase_app2.class Folder Location C:\NKCV\Project\MyActivities\6_Selenium\htmlTestCasesConverte d2JUnit\iexplore\flow2 File Name testCase_app2 step 3 complete... missing argument! usage htmltestCaseLocation for eg., "C:\NKCV\Project\MyActivities\6_Selenium\htmlTestCases" Could anyone please let me know whats wrong here? Thanks.

    Read the article

  • Editing "Time to display recovery options when needed" timeout value using a program

    - by chandra
    Hi all, I want to edit the timeout value of 'Time to display recovery options when needed' without using the UI display option. To navigate, Right click on 'Mycomputer' - Properties - Advanced tab - click on SETTINGS of 'Startup and recovery' = 2nd displayed check box. The value thought to be in c:\boot.ini file, but it has value of other timeout 'Time to display other operating systems'. After some searching, i found that 'c:\windows\bootstat.dat' file holds the timeout value for 'Time to display recovery options when needed'... but, i am not able to decode the .dat file or edit that file.. any suggestions would he helpful for me.. Thanks in advance

    Read the article

  • Hi, how to verify if file exists on windows bat file?

    - by CuSS
    Hi, i have to create a bat file that does this: 1 - If "C:\myprogram\sync\data.handler" exists, exit; 2 - If "C:\myprogram\html\data.sql" doesn't exists, exit; 3 - In "C:\myprogram\sync\" delete all files and folders except ('test','test3' and 'test2') 4 - Copy "C:\myprogram\html\data.sql" to "C:\myprogram\sync\" 5 - Call other bat file w/ option "sync.bat myprogram.ini". If it was in bash enviroment it was easy for me, but i don't know how to test if a file or folder exists and if it is a file or folder :/ Thanks

    Read the article

  • Rename files and directories using substitution and variables

    - by rednectar
    I have found several similar questions that have solutions, except they don't involve variables. I have a particular pattern in a tree of files and directories - the pattern is the word TEMPLATE. I want a script file to rename all of the files and directories by replacing the word TEMPLATE with some other name that is contained in the variable ${newName} If I knew that the value of ${newName} was say "Fred lives here", then the command find . -name '*TEMPLATE*' -exec bash -c 'mv "$0" "${0/TEMPLATE/Fred lives here}"' {} \; will do the job However, if my script is: newName="Fred lives here" find . -name '*TEMPLATE*' -exec bash -c 'mv "$0" "${0/TEMPLATE/${newName}}"' {} \; then the word TEMPLATE is replaced by null rather than "Fred lives here" I need the "" around $0 because there are spaces in the path name, so I can't do something like: find . -name '*TEMPLATE*' -exec bash -c 'mv "$0" "${0/TEMPLATE/"${newName}"}"' {} \; Can anyone help me get this script to work so that all files and directories that contain the word TEMPLATE have TEMPLATE replaced by whatever the value of ${newName} is eg, if newName="A different name" and a I had directory of /foo/bar/some TEMPLATE directory/with files then the directory would be renamed to /foo/bar/some A different name directory/with files and a file called some TEMPLATE file would be renamed to some A different name file

    Read the article

  • VMWare Tools StartUp Script

    - by Horst Walter
    I am on the latest version of VMWare Workstation. In my VMWareTools I have configrued an individual script file (start.bat) to be started when the (guest) OS is booted. Unfortuantely it does not run when starting the guest system as intended. When pressing "run now" it works Running the script from CMD works as well I have changed the service (VMWareTools service) to run under different users - no success All Users (of the service) have had Administrator privileges I have no idea what is going wrong. Maybe someone is having an idea ....

    Read the article

  • how to start stop tomcat server using CMD?

    - by ali
    i set the path for the tomcat and set all variables like 1.JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_22 2.CATALINA_HOME=G:\springwork\server\apache-tomcat-6.0.29 3.CLASSPATH=G:\springwork\server\apache-tomcat-6.0.29\lib\servlet-api.jar;G:\springwork\server\apache-tomcat-6.0.29\lib\jsp-api.jar;.; when i go to bin folder and double click on startup.bat then my tomcat start and when i double click on shutdown.bat tomcat is stop. But I want using CMD start and stop the tomcat. And in any folder i write command startup.bat the server will start and when i write the server will stop...... Thanks in advace..........

    Read the article

  • How to run a program on a specific remote computer

    - by lucc
    Hi, I have got this working line of code I would like to run via VBScript a share program on a remote computer in a domain environment. The first part is ok where it is asking me to enter a computer name, but the problem is in the second part. I don't know how to run the program on the remote computer that I've entered in the first part. computer = inputbox ("What computer do you wish to check? (Press Enter if this computer)","Computer") set WMI = GetObject("WinMgmts://" & computer) If computer="" then computer = "this computer" Dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run("""\\compname\Share\progr.exe""") Set objShell = nothing After running this script, it runs the program on my computer, not on the remote computer. I want to run the program on a specific computer that I have entered from keyboard. Please help. Thank you.

    Read the article

  • converting bash script to .bat

    - by Robokop
    #!/bin/bash function usage(){ cat <<EOF USAGE: $0 [strategylist] valid strategies are: ALLD ALLC TitForTat JOSS WeightedRandom Tester EOF exit 1 } [ -z $1 ] && usage javac robsAgents/*.java robsAgents/behaviours/*.java agentlist='leader:robsAgents.TournamentLeader' agentlist=$agentlist";$1:robsAgents.Contestant" while shift; do agentlist=$agentlist";$1:robsAgents.Contestant" done java jade.Boot -gui -host 127.0.0.1 "$agentlist" i have above bash script and have no access to a windows computer and i need to convert it to a .bat file, but don't even know how to do the shift and argument parsing

    Read the article

  • .bat file to update loopback controller to external ip

    - by cable729
    Okay, so I've figured out how to get my external ip using wget: wget -q -O - http://whatismyip.com/automation/n09230945.asp that outputs the ip to the command console. adding currentip.txt to the end will write it to a text file. But what I want to do is use netsh interface ip set address name="Local Area Connection 2" source=static addr=[WHAT DO I PUT HERE] Also, a way to make the command prompt not flash would be nice too :)

    Read the article

  • pushd - handling multiple drives from cmd

    - by user673600
    I'm trying to figure out how to install some programs where the components reside on two different drives on a networked path. However whenever I use pushd \\xyz\c$ I get a mapped drive which means I cannot use any knowledge of using for example c:\install e:\mycomponents.dll. Is there anyway that I can do this once I have used the pushd command? How can I ensure that I keep the drives the same for example. I'm in the process of installing services. So it seems that when I install the service, I need to keep the path as the same as the actual location of the .exe which means that I'm running into issues. Is there a way to simply use pushd but at the sametime not actually map drives? As when installing services, when I've been using net use, I've found that there is an issue with installing on drives which are mapped, as the service whilst can be installed doesn't find the actual .exe when it comes to starting up the service. So to expand this, is there a way to solve this using net use or pushd or a combination that lets me install a service as such: c:\windows\..\installutil e:\mynode? So to clarify, I need to somehow be able to see both drives on the remote machine by their relative drives i.e. E:\ and C:\ - if I use a mapped drive letter then it means installing service is a pain because I cannot use the path.

    Read the article

  • bat script to delete file older than 7 days

    - by Jessie
    hi guys i have a bat script in which gets all files in a folder and then converts this folder with its contents into a one RAR file. This script also adds the current date once it makes a copy and moves it this file into a backup folder, i am planning to have this bat file run by a windows scheduler task every day. My question is there a way to add into this cript to also delete all rar files older than 7 days in the backup folder? for /f "delims==" %%D in ('DIR D:\scripts /A /B /S') do ( "C:\Program Files\WinRAR\WinRAR.EXE" a -agyyyy-MM-dd -r "c:\backup\scripts.rar" "%%D" )

    Read the article

  • Cross Thread problem C#

    - by Frederik Witte
    Hello people - I got this code (lg_log is a listbox, and i want it to log the start_server.bat) Here is the code i got: public void bt_play_Click(object sender, EventArgs e) { lg_log.Items.Add("Starting Mineme server .."); string directory = Directory.GetCurrentDirectory(); var info = new ProcessStartInfo(directory + @"\start_base.bat") {UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true, WorkingDirectory = directory + @"\Servers\Base"}; var proc = new Process { StartInfo = info, EnableRaisingEvents = true }; proc.OutputDataReceived += (obj, args) => { if (args.Data != null) { lg_log.Items.Add(args.Data); } }; proc.Start(); proc.BeginOutputReadLine(); lg_log.Items.Add("Server is now running!"); proc.WaitForExit(); } When i run this, i'll get an error .. Anybody can help me? I'll rate the answer up! :D Edit: The error i get is this: System.InvalidOperationException Hope it helps :) The error comes at the lg_log.Items.Add(args.Data); code line

    Read the article

  • Tomcat6 fails to update User parameter on a stopped service

    - by Woot4Moo
    At the moment I have installed tomcat via the service.bat command. After install I stop the service and execute the following command: //US//TOMCAT6 --User=MyUser this fails to update the service with the user MyUser, in addition this command also fails //US//TOMCAT6 --User=MyUser --Password=MyPassword I am running xp sp3 and it is Tomcat 6.20

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >