batch

batch update SharePoint data

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 informatio...

How to make a batch file edit a text file

I got the code Set objFS = CreateObject("Scripting.FileSystemObject") strFile = "C:\test\file.txt" Set objFile = objFS.OpenTextFile(strFile) Do Until objFile.AtEndOfStream strLine = objFile.ReadLine If InStr(strLine,"ex3")> 0 Then strLine = Replace(strLine,"ex3","ex5") End If WScript.Echo strLine Loop The str...

Writing a batch file to delete files with wildcards

I have multiple websites set up in the same folder, and I want to create a batch file that will delete the cache in each of them without having to add a new line for each site. For example I am using this: del /S /Q D:\www\site-name\cache\* Which works, but I have to add a new line for every site in D:\www. The del command doesn't sup...

Compile batch file into an EXE file

I want to compile a batch file into an EXE file using C++. I can get through parsing the batch file and writing a new .cpp file. But I don't know how to compile the new .cpp file into an EXE file for the end user. OK, here's the thing, I am creating an application in DevC++ that will read in a batch file. Then, one by one parsing it usi...

DOS batch command to read some info from text file

Hello All, I am trying to read some info from a text file by using windows command line, and save it to a variable just like "set info =1234" Below is the content of the txt file, actually I just need the revision number, and the location of it is always the same line 5, and from column 11 to 15. In the sample it's 1234, and I am wonde...

What are the reasons to use dos batch programs in Windows?

Question What would be a good (ideally, technical) reason to ever program some non-trivial task in dos batch language on a modern Windows system as opposed to downloading either PowerShell, or ActiveState Perl? To be more specific, I make the following two assumptions for the duration of this question: anyone technical enough to be a...

Find folder name based on string value with batch

I need to return a full directory name from inside a specified directory that contains .default in the folder name. Basically I'm adding a line in a backup script to backup firefox bookmarks, but the profile name is going to be different on every machine and I need a way to find the folder the bookmarks.html file resides without knowing ...

Batch file: Extracting substring from input parameter to use in IF statement

This is a very basic example of what I am trying to implement in a more complex batch file. I would like to extract a substring from an input parameter (%1) and branch based on if the substring was found or not. @echo off SETLOCAL enableextensions enabledelayedexpansion SET _testvariable=%1 SET _testvariable=%_testvariable:~4,3% ECHO...

C# Batching Process?

Can every body tell me by simple answer where & what i can create a batch process for ordinary operations such saving, changing file properties and so... ...

Is there a short cut for desktop folder in Windows batch?

C:\Documents and Settings\Administrator\Desktop I don't want to type the above each time to refer to a file on the desktop ...

DOS Batch script loop

I need to execute a command 100-200 times, so far my research indicates that I would either have to copy paste 100 copies of this command, OR use a FOR loop, but the for loop expects a list of items, hence I would need 200 files to operate on, or a list of 200 items, hence defeating the point. I would really not have to write a C progra...

Windows batch file: is there a way to add an "and"?

The short version: is there a way to to write an "and" or an "or" clause in a batch file? The slightly longer version: I've inherited a Visual Studio project that creates a dll and then copies that dll to another location. As a post build step, VS runs the following script. if not '$(ConfigurationName)' == 'DebugNoSvc' goto end xcop...

Opening A Specific File With A Batch File?

I'm would like to know how I can open a specific file using a specific program with a batch file. So far, my batch file can open the program, but I'm not sure how to open a file with that program. @echo off start wgnuplot.exe ...

Save batch file path to local harddisk

Hi, I have a batch file that is Run when a selfextraction file is executed. The self extracted files must be copied to to specefic place on the harddisc. In the batch file the user is asked where the path is (if it's not located the default place) Part of the batch file: @ECHO OFF IF EXIST "C:\Program Files\program\program.exe". ( ...

Several ways to call a windows batch file from another one or from prompt. Which one in which case?

A windows batch file (called.bat or called.cmd) can be called from another batch file (caller.bat or caller.cmd) or interactive cmd.exe prompt in several ways: direct call: called.bat using call command: call called.bat using cmd command: cmd /c called.bat using start command: start called.bat I'm quite in trouble to differentiate th...

Are windows batch labels (:label) used with call and goto commands case-sensitive?

The question from title doesn't need more details. ...

Batch file to map a drive when the folder name contains spaces

I am trying to map a drive using a batch file. I have tried: net use m: \\Server01\myfolder /USER:mynetwork\Administrator "Mypassword" /persistent:yes It works fine. The problem comes when I try to map a folder with spaces on its name: net use m: \\Server01\my folder /USER:mynetwork\Administrator "Mypassword" /persistent:yes I have...

batch file command to run jar file

I am created jar file.The jar file is an executable one.But how can i run the jar file from the out side,using created batch file.I want to know the batch file coding to run the jar file without mentioning class path. Or is there any way to do it? ...

Batch scripting for directories or better method

Hi Everyone, Looking at creating a simple batch file for my app. My app needs some directories to be in place as it runs. The first method I thought was just make a batch script: @ECHO OFF IF NOT EXIST C:\App GOTO :CREATE ELSE GOTO :DONTCREATE :CREATE MKDIR C:\App\Code ECHO DIRECTORY CREATED :DONTCREATE ECHO IT WAS ALREADY THERE 1...

2 batch string questions.

1) Is there any built-in which can tell me if a variable's contents contain only uppercase letters? 2) is there any way to see if a variable contains a string? For example, I'd like to see if the variable %PATH% contains Ruby. ...