batch

Handling extended characters in Windows commands?

I am debugging a windows batch command file. It is failing when extended (> 0x7f) characters are used in the paths or file names. The problem seems to be related to passing parameters to a command file that is CALLed from another. For an example, this command works as expected: xcopy "Pezuñero\1 - 001.wav" \temp This does not: call ...

Can you run AIR apps from command line?

The question ultimately aims at answering this question: can a batch script run an AIR app? The goal is to setup an AIR app on a web server and make it run through batches. I simply have to know whether this is possible by default or not. Thanks. ...

How long a Batch file takes to execute

I'm wonderin' how I can write a script to calculate the time the script took to complete. I thought this would be the case, but obviously not.. @echo off set starttime=%time% set endtime=%time% REM do stuff here set /a runtime=%endtime%-%starttime% echo Script took %runtime% to complete ...

Eclipse: How to automate export unsigned application in a batch file

I am developing a game for Android in Windows Vista environment. I want to automate the exporting unsigned application operation in a batch file. So, I wouldn't have to Right click on the project, go to Android Tools and then select Export Unsigned Application Package... anytime I want to run my project. Thank you. ...

Batch File Display Startup Items

Hey guys Just wonderin' if anyone here knows how to display startup items from within a batch file? ...

Displaying lines from text file in a batch file

Hi I'm tryin' to find a script that will let me display "linenumber# and linenumber# as well as lines#-#" from a text file in a batch file? I found this script here on this site.. @echo off setlocal enabledelayedexpansion if [%1] == [] goto usage if [%2] == [] goto usage SET /a counter=0 for /f "usebackq delims=" %%a in (%2) do ( if "...

[MS-Windows] Lauching a Java app from a batch file with the correct JRE

I have a very simple batch file that lauches a Java app (Saxon) with the simple command "java net.sf.Saxon.transform..." This app requires java version 1.5. This batch file will be used by 400+ users who each may or may not have some versions of the JRE installed on their machines. I had thought that simply installing the most recent ...

Deleting temp files in batch file

Hey guys Just building a batch file to delete temp files on my vista machines @ home that i want to add to task scheduler. i have this so far, but i get alot of access denied, and it never finds a thumbs.db file or index.dat and there are heaps of them. what am i doing wrong? attrib +a -s -h -r "%windir%\Temp\*.*" /s del /f /s /q "%...

I want to delete all bin and obj folders to force all projects to rebuild everything

I work with multiple projects and I want to recursively delete all folders with the name 'bin' or 'obj'. That way, I am sure that all projects will rebuild everyhing (sometimes it's the only way to force visual studio to forget all about previous builds). Is there a quick way to accomplish this (with a bat file for example) without ha...

Batch script to issue commands to mySQL db?

I am trying to create a batch script that would connect to a mySQL database and issue a delete command: @echo off echo Resetting all assessments... mysql -hlocalhost -urdfdev -p%1 rdf_feedback delete from competency_question_answer; I will run this script providing the password as a command-line argument, but all this script does is, ...

Non-Modal Notification Box from batch script

I would like to have a non-modal alert box called form a batch file. Currently I am using vbscript to create a modal alert box: >usermessage.vbs ECHO WScript.Echo^( "Generating report - this may take a moment." ^) WSCRIPT.EXE usermessage.vbs But I would like to proceed with the script (generating the report) without waiting for user ...

Batch File To Display Directory Size

Hi guys just wondering if u can help me modify this script that ive been playing around with, i cant get it to accept wildcard charcters '*' @echo off setLocal EnableDelayedExpansion set /a value=0 set /a sum=0 FOR /R %1 %%I IN (*) DO ( set /a value=%%~zI/1024 set /a sum=!sum!+!value! ) @echo Size is: !sum! k Its in a batch file calle...

Autostart a batch file on Windows

Hi, I want to create a script that will run whenever a server is turned on to do basic things like create a directory and copy a binary from an FTP server to it. I need it to run before a user logs in, as soon as the server is turned on. This will be deployed on my EC2 windows servers. Checking around (http://www.bleepingcomputer.com/t...

Setting a variable from an executable

I am running an executable in a batch file with two parameters; cmd /k ""executable" "param1" "param2"" This returns a string that I want to launch. I can't figure out how to set this return in a variable and subsequently launch it in IE. Any ideas? ...

Getting Batch Script Error Code

I would like a Win32 process to launch an external script and be able to retrieve the ERRORLEVEL that it returns. The other way around is quite easy. Just use exit(errorcode) or return errorcode; in your Win32 app and the calling script gets its ERRORLEVEL value set properly. But, from a Win32 calling application, getting the script e...

Batch File Querying Registry in 64-Bit Vista

Hi guys me again :) I have a problem with a batch file I wrote. It works fine on 32-bit, but apparently it doesn't work on 64-bit systems, and I don't know why because I do not have access to a 64-bit system. This is the code that works on Vista 32-bit system @echo off Set Reg.Key=HKLM\SOFTWARE\Malwarebytes' Anti-Malware Set Reg....

launch a gui program from windows console and then make it 'detach' itself

I'm trying to modify a legacy Delphi 5 app so that it can be launched either from it's icon/via Explorer, or from the console (command-line). When it gets launched from the console, I want the program to detach itself from the console process, so that the console can continue to execute other instructions without waiting for my program t...

Add a new line to a txt file in MS-DOS

Hello, and thank you for reading. I'm making a .bat file and i'd like it to write ASCII-Art into a txt file. I was able to find the command to append a new line to the file when echoing text, but when I read that text file, all I see is a layout-sign and not a space. I think it would work opening that file with Word or even WordPad, b...

How do I get the equivalent of dirname() in a batch file?

I'd like to get the parent directory of a file from within a .bat file. So, given a variable set to "C:\MyDir\MyFile.txt", I'd like to get "C:\MyDir". In otherwords, the equivalent of dirname() functionality in a typical UNIX environment. Is this possible? ...

How to batch insert in specific order?

EntityManager doesn't seem to care in which order to persist entities but I need that. Any ideas? ...