Unable to create blank .txt file on desktop using batch file on a USB

When I run the batch file (on a usb) with this code: @echo off cd desktop type nul > Test.txt It creates Test.txt on the usb instead of on the desktop. Is it possible to make the Test.txt file created on the desktop instead of USB?

View details »

How to loop through every windows service in batch

I am trying to create a batch script that changes services' startup types based on their service names. But something is not working in my loop, and I don't know why it is not working :( Please help

View details »

How to check if variable in a batch script has only new line?

I am trying to exit from a batch script if git status is not empty: setlocal EnableDelayedExpansion FOR /F "tokens=*" %%g IN ('git status -s') do (SET GIT_STATUS=%%g) (SET LF=^ %=this line is emp

View details »

When calling a powershell script from a batch file, and exiting with a value, errorlevel is 0 in batch file, not the exit value

When calling a powershell script from a batch file, and exiting with a value, errorlevel is 0 in batch file, not the exit value I've tried using the code below to call a powershell script which exi

View details »

Redirection from windows batch file

I am executing following command (cmd) file in windows . FOR /F "delims= " %%A IN ('aws autoscaling describe-auto-scaling-instances --region us-east-1 --output text --query "AutoScalingInstances[?A

View details »

Copying the files from one server to another server getting NTFS error

I am using one batch file to copy files from one server to another server. That batch file run fine when I run it manually, but I run the same batch file using task scheduler am getting below error.

View details »

How to make a variable define other variable in batch?

I need to make a variable define the next variable as such @echo off set A=john set B=shyaam set john= THIS IS JHON set shyaam= THIS IS SHYAAM echo %%A%% So this should echo THIS IS xyz, but echoes %A%

View details »

having trouble using spaces in folder names

When the user enters a space in the folder name, I can create and remove the folder with the following code, but the line to start or open the folder will not work. I have tried several different t

View details »

findstr returning wrong error code inside block

When executing a loop, the errorlevel being referenced by !errorlevel! is returning 1 instead of 0 even though the statement is true. setlocal enabledelayedexpansion is enabled I have tried rearran

View details »

Batch file redirect to an empty file when using php exec() to call that batch file

I have a Windows batch file "gcloud_batch.bat": gcloud auth application-default print-access-token > token.txt And php file: exec("gcloud_batch.bat", $output, $return); When I run the php file fro

View details »

How to batch create folders with names, and extract many zips to each different folder, with python?

Im having trouble creating many different directories for a number of different zip folders containing different raster data and then extracting all the zips to the new folders in a clean script.

View details »

Batch merge pdfs

Got about 1600 single side pdf's that need reducing to 800. ie make 2 pdf's into 1 double sided pdf Merge manually 1 by 1 Dont have any code. Propose to put all pdf's in one folder. Naming convent

View details »

How to find which network profile(s) are active via cmd or batch script

In the windows registry here: **HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles** we can see a list of network IDs with Network name like usually "Network 1" for wired netwo

View details »

Is it possible to archive files by non constant numbers in their names using windows batch script?

For example, We have a folder c:\files The folder contains files like these: abc_m2611somthing.pdf abc_m2611somthing.dat abc_m2611somthing.log abc_m3849somthing.pdf abc_m3849somthing.dat

View details »

Batch file delayed expansion only seems to effect the first parameter called

I am trying to automate some SFW deepfake creations. In my code you'll see I ask for a batchSize and then call it twice afterwards. The first time !batchSize! is called, it works fine and whatever

View details »

Remotely Enable Wakeup from Shutdown

I am trying to get 400 pcs setup to wake on lan. everything is enabled on all the pcs but one check box. Under the advanced tab on the nic, "wakeup from Shutdown" is disabled and I need to enable it

View details »

Batch file input - Check if user imputed a 6 numbers and if it contains 3 fives

I want to create a batch file that prompts a user to enter a number sequence that is 6 numbers long and the batch file will check if it has, For Example, 3 of the number 5 in it @echo off set /p Us

View details »

I want to uninstall some application/software which are in control panel from command prompt

I am able to uninstall some application like putty from cmd. but. some application are not display in the cmd. but it is showing in control panel some of the command i used. wmic product get nam

View details »

Why wont echo produce this “text-image”? (Batch)

I'm not too sure why this won't work, I'm putting the echo's after every line but it keeps on crashing upon start, similar to a c++ hello word without "PAUSE" in it. I've tried looking up info on t

View details »

Batch script for Laravel Project

I'm working on a script to start the laravel project from a github repo. But it stops after the composer install, any idea how to do it? start cmd /c "mysqld" mysqld --log_syslog=0 --console

View details »