1
vote
0answers
135 views

Trying to run a netsh batch with foreign characters

I am trying to run a batch file with the following content: netsh interface ip>set dns "Połączenie lokalne" source=dhcp The file is saved as ANSI. My Windows codepage is 1250, the OEM one 852. ...
1
vote
1answer
100 views

Weird issue with .bat script

I have a .bat script which instals 3 pieces of software. When i open an elevated Command promt , browse to the file and run it everything works fine. When i run the .cmd directly ( using the 'run as ...
1
vote
1answer
1k views

Checking if shared folder exists using CMD

How I could check if network folder shared exists using batch script? Example: \\10.10.10.1\folder1\folder2\shared_folder
2
votes
0answers
208 views

Access Denied error when running xcopy in jenkins on windows 2008 r2

I have installed Jenkins on a Windows Server 2008 R2 and in the build script i use xcopy to copy the generated war file to a specific folder The problem I am having is that every so often the build ...
0
votes
0answers
71 views

Batch script terminates too soon

I need some help with Windows batch/CMD scripting. I wrote a script to record mic-in to a MP3 for 12 hours. It runs ok when running it manually. It will run with task scheduler too - just that, ...
2
votes
1answer
184 views

Is there a cmd/certutils to copy a certificate from one store to another?

I would like to know if there is a cmd to copy an existing certificate from one store to another. I am trying to copy a certificate from the Users Intermediate Certification Authorities store ...
2
votes
1answer
703 views

Batch - how to copy file by minimum size and date modification?

I have this simple batch script which copies the newest file in some dir to another place. I want this script to also ignore all files (in the DIR command section) under 1GB of size. FOR /F ...
1
vote
2answers
270 views

batch file, delete line by number

i have this: set myvar = ^J | FIND /N /I "texttolookfor" %WINDIR%\system32\drivers\etc\hosts now i have the lines it fined the text in how can i delete these line from the file? i know i can run ...
1
vote
2answers
1k views

How to “ignore” username and password prompt in net use

I have at the moment a logon.cmd script, that I'm using to map network drives to the users profile. It looks like this: ::Onboarding net use m: /delete net use m: \\BOB\onboarding ::Bookings net use ...
2
votes
1answer
492 views

Checking .BATs exit code with NAGIOS?

I currently have the following script on a Windows Server: @echo off set path=%PATH%;C:\UnxUtils\usr\local\wbin cd /D Z:\videos forfiles /M *_1.mkv /D +%date% > C:\mkv.txt >NUL 2>&1 ...
2
votes
3answers
682 views

Using a for loop in Microsoft cmd.exe, how can I process only the files with a certain extension?

I have a the folder c:\test\ and two files in it a.txt and b.txtv. I would like to process just the files with extension equal to .txt. If I write this commands cd c:\test for %f in (*.txt) do echo ...
-1
votes
3answers
199 views

creating a bat file or cmd

I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error. mybat.bat: ...
-1
votes
1answer
476 views

Copying a set of local files to ftp

I want to copy a set of local files to ftp://124.30.124.230 (it will ask for a username and password). I want to do this work on 400 systems so I have planned to do this work by creating a batch file ...
0
votes
3answers
1k views

Transferring files from ftp to local system

I want to copy a file from FTP and paste it to my local system. I want to run this through a batch file. I am trying this for a week. But I couldn't find the solution. Anyone help me please.... This ...
19
votes
4answers
61k views

Get directory containing the currently executed batch script

I use %0 in batch file to get the containing directory of the batch file but the result is :- c:\folder1\folder2\batch.bat I want just directory, without batch file name, like this :- ...
0
votes
1answer
173 views

How to create a windows user from the command line, using a password from a file

Im in a somewhat unique situation. I am trying to create a windows user, using the command line or a batch file. I know how to do that in the basic case: net user username password /add The ...
1
vote
1answer
444 views

more than one start statment in the same batch file?

I wrote the following batch file: start D:\folder1\bin\run.bat start D:\folder2\bin\run.bat start D:\folder3\bin\run.bat start D:\folder4\bin\run.bat It executes the first start but then gives me ...
2
votes
2answers
1k views

Batch file to call multiple batch files and keep going after errors

I have a batch file like this, the issue that I have is that if the first batch file fails, the second one never gets started, how can I get them to both keep going? @echo off MapNetworkDrive_J.cmd ...