Hot answers tagged

3

Building a DOS script to rename files Original filenames: FIL120_000112_DDMMYY ==> MYNAME_TLD_EXT_YYMMDD I need to take the original filename last portion (DDMMYY) and turn it into YYMMDD. Below is a Windows batch script that will do just what you list in your question—if you'd like an explanation of what this script is doing, let ...


2

Writing your diskpart commands in a separate file should work. However, you don't need the diskpart command again at the top (just the commands after you call it), and the commands need to be on separate lines. And if you want this to be in a batch script, then you should call diskpart in a batch script that uses a text file. whatever.bat @echo off ...


2

Adding the /s argument will include sub-directories in the listing (which you may not want), but a side-effect is that it also displays the full path to all files (which you want): So try something like DIR root\sound\weapons /B /S >Names.txt. Another alternative (which doesn't include subfolders) could be to create a batch file and use For. Something ...


2

How to copy a specific file from sub folders to one other folder In every ak47, m1, m4a1 etc. folders, I have 5 sounds. I wan't to copy only the *dist.wav sounds from every weapon folder and paste these sounds to a single folder with batch. Below is an example of how you can do this from a batch script or from a copy and paste. Please read ...


2

One way would be to copy/move the binary file to a new temporary location with a unique name and execute it. If the copy/move is successful, then the unique file exists and you can execute it without influence from "remote filesystem shenanigans". If not, then at least you know you will not get the pop-up window.


2

When you drag and drop a file or folder onto a batch file or executable, Windows launches the drop target and passes the full name of the dropped object as a command-line argument, with quotes if necessary. It appears that your program takes a folder name on the command line, so the equivalent command would be vpk "C:\Full\Path\To\Folder". You might be able ...


2

I fail to see what's incorrect in my batch code: FOR /R %a in (*.png) DO ( files\pngnq -s 1 -n 16 %~fa ren *nq8.png "%~na.png" files\gimconv "%~na.png" --format_style psp --format_endian little --pixel_order faster --image_format index4 del "%~na.png" ) I can see two obvious issues with the above code: In a batch file you need to ...


2

Batch file rename, strip off parenthesis and all characters between, but keep extension Save all the logic from the below example to a text file and name it something.cmd and then simply execute it. . . Script Notes Where SET RenDir=C:\Path is C:\Path, you'll need to put the full path where these files you wish to rename exist. The assumption with ...


2

for %%A IN (*.mkv) do ( "B:\OneDrive\Portable applications\mkvtoolnix\mkvmerge.exe" -o "remux-%%~nxA" "%%~A" "%%~nA.srt" echo Replace this Line with your othr commands! ) And see mkvpropedit -- Modify properties of existing Matroska and Change Default Language/Subtitles in MKV Files


1

Windows Batch File Rename to Replace %20 Characters with _ I have a folder with a lot of files that I need to rename. The original format for example is ABC%20DEF%20GHI%20JKL.xyz. What I need to do is to replace each %20 with _. So essentially I'm parsing out the %20 characters from the file names and then replacing those with an underscore _ ...


1

A batch file does not work in this way - each line is interpreted as a command to execute in turn. When you're calling ipmish.exe, it will block the rest of the batch until the process has ended. In order to achieve what you want to do, you could to look at the documentation for ipmish.exe and see if there is a method of scripting for it (As you're able to ...


1

You can use schtasks and provide the task user credentials. I use this regularly in my PowerShell scripts schtasks.exe /create /s NAMEOFCOMPUTER /ru DOMAIN\USER /rp PASSWORD /tn NAMEOFTASK' /XML PATHTOXMLFILE


1

When you run things in the Task Scheduler, the working folder (by default) is %windri%\system32. So any files created by the task, that don't have a path specified, will be written there (or at least it will attempt to write them there). To avoid this, specify an absolute path in your SET logfilename_sp_fix="SPSearchFix.log" line. E.g.: SET ...


1

How to create folders in one folder with batch Hello i want to create 25 folders with names into one folder. example: root\sound\weapons\ak,m4,m1,m45,m9 etc. I know how to create a folder with sub folders but not with multiple folders. How i can array with batch. Command Prompt Copy and Paste FOR %A IN (ak,m4,m1,m45,m9) DO MD ...


1

I had the same issue with POS software in regards to sending an eject code for the till which used COM1 - I'm sure there is a better way than this, but I used autohotkey to open a cmd window and type 'echo > com1 (enter)' then exit. You can set the variables of the cmd window to start minimised. Use autohotkey typecode.ahk (typecode.ahk being the script ...


1

The %~dp0 will give exactly what you're asking for (i.e. \\server\share\to\folder) . But you can't use it for your net use command. The net use command only accepts the \\server\share part to create a drive-letter. You can do some work to strip off the \to\folder-part and add it later in your batch-files but it might be better to use the pushd ...


1

This is a duplicate of: http://stackoverflow.com/questions/14531917/launch-minecraft-from-command-line-usename-and-password-as-prefix (I don't have enough reputation points to comment or mark as duplicate sorry)


1

Here are 2 free programs that I highly recommend for creating EXE's out of batch files 1 - Batch2ExecConverter 2 - Bat2Exec


1

I found this article which shows you how to convert a .bat to .exe file using a batch-scipt: @ECHO OFF ECHO Make EXE From BAT ECHO Written by: Jason Faulkner ECHO SysadminGeek.com ECHO. ECHO. REM Usage: REM MakeExeFromBat BatFileToConvert [IncludeFile1] [IncludeFile2] [...] REM REM Required Parameters: REM BatFileToConvert REM Source batch file to ...


1

How can I set the result of the following command to be a variable called model? wmic computersystem get model The output of this on my system is: Model VPCF22L1E Note the extra blank line. I've used VPCF22L1E to test the batch file. Use the following batch file (test.cmd): @echo off setlocal enableDelayedExpansion for /f "usebackq skip=1" %%i in ...



Only top voted, non community-wiki answers of a minimum length are eligible