How to insert the output of a command to variable in a batch file ?
Inside a batch file on Windows I would like some variable to have the output of dir /b command. How this can be achieved ? ...
Inside a batch file on Windows I would like some variable to have the output of dir /b command. How this can be achieved ? ...
I'm running a batch file on Windows and got this error: The syntax of the command is incorrect. Is that possible to identify which line in the batch file is incorrect ? ...
var may be double quoted: set var="Very long text" or without quotes: set var=Some_Text I would like to get the unquoted text, i.e. Very long text in the first case and Some_Text in the second one. How could I remove the double quotes, if exist ? ...
I have a batch file that creates a scheduled task using schtasks like this: schtasks /create /tn my_task_name /tr "...\my_path\my_task.bat" /sc daily /st 10:00:00 /s \\my_computer_name /u my_username /p my_password It works OK ...
At my school I want to automate the process of telling the students to go to class and play a song five minutes before class starts at the end of lunch. I wrote a Bash script that will play the announcement, a random song. After five minutes the script will fade out the music and kill VLC. I need this script run on Windows as the is the...
I'm encountering an issue with the <exec> task on batch files in my NAnt project files. When running on Windows XP SP 3 (but not Windows Vista or Windows Server 2008) and using NAnt 0.85 or 0.91alpha2, the <exec> task will always succeed (returning an error code of 0) regardless of what the executed script returned. As an example, I wr...
Hi guys, I'm tryin' to find a way (from a batch file) that I can use to create a scheduled task that will execute 6 months from now. I've looked all over the net, and I'll I've come across is AT and SCHTASKS that will schedule the task monthly .. I'm looking for a solution that will execute this task every 6 months. I know this will r...
I have the following script to automate uploading a file to a remote server. The problem is that the password I have been given is full of special characters which are killing the login process. Here is a changed version of the characters. j7~]%&X When using a normal ftp app there isn't a problem. I have wrapped the password in ...
I have a batch file with a single line in it: src/Filé.txt When I run the batch file (either in the command prompt or by clicking it in Windows Explorer), I get the following: C:>src\FilΘ.txt 'src\FilΘ.txt' is not recognized as an internal or external command, operable program or batch file. It turned my é into an Θ! I've a...
We have batch files to compile all the sql scripts in a folder against a database. Problem is that we have a couple of thousand scripts and it makes an output file for each script. It makes it difficult to check for errors and a lot to do cleanup on. Is there any way to output all of the results to one file? Here is the script we use: ...
I'm trying to put together a batch file, that will ping a website, and assign its ip to a variable - I've searched around, but haven't really been able to put something together. Can anyone shove me in the right direction. Tim. ...
How Can I hide the console of a running batch file the batch is running from a cmd or start>run ...
Using a little app, I have a few lines that look like the following: netsh firewall add portopening name = "__Auto_WebAccess_TCP_80_IPCount=501_0" protocol = TCP profile = CURRENT mode = ENABLE scope = CUSTOM port = 80 addresses = ip addresses , e.g. 84.22.55.22 and son on comma separated Problem is, the maximum characters you can put...
I am looking to add a new item in a right click context menu for a certain file type. I suppose it would be easiest to run a batch file with the full path of the file as an argument. I need to rename the file, unzip it, then rezip it, then rename it. I suppose winzip command line would be appropriate tool to help with that, unless someon...
I'm using batch files to process text files with names of the form: CLL*1.txt, CLLM*2.txt located in a specific "download" folder. All files contain a string of the form: "File Reference : 0xxxx", where xxxx is a unique numerical identifier. I am trying, without much success, to use the following script to rename the file to CLL*xxxx...
I need to check whether a server is up or not? If down then i need to send an email And this task should be repeated in every 30mins. I have to do this using batch file. ...
I have many folders in a directory that contain various files. Each filename begins with XXX_ where XXX could be the name of the folder the file is in. What I am needing to do is to go through all those folders and delete any file where XXX is the name of the folder that file is in. ...
I have a folder with files x_blah.blah y_ho.hum z_hi.ho which I just need to drop everything to left of the underscore and the underscore from so I'm left with blah.blah ho.hum hi.ho ...
There is a way to assign to a file, lets call it abc.txt, a progressive number, that I suppose should come from the time set? So that the name of the file could become for example abc_5367879938763.txt ...
I'm guessing this is a basic DOS question, its with the del command. All I want to do is delete a file. C:\Documents and Settings\matthewe\Desktop\testfolder>del C:\Documents and Settings\matthewe\Desktop\testfolder\test.pdf The system cannot find the path specified. I can guarantee that test.pdf exists, and the fact I'v...