" if NOT %pass%== *Info gets used here* goto :exit That way when someone first runs my batch file, they " /> What Am I Doing Wrong With My Batch Script

TRENDING NEWS

POPULAR NEWS

What Am I Doing Wrong With My Batch Script

How do i make a self editing batch file?

I need to know a batch command that would allow the user to input a password, and then the batch file uses that password in part of it's coding. Here is the snippet of code i need it for, basically i need a series of commands that lets the user enter some info, and then the info gets used in the snippet of code below...
echo Enter password
set/p "pass=>"
if NOT %pass%== *Info gets used here* goto :exit

That way when someone first runs my batch file, they can set up a password without needing to edit the batch file themselves.

Will moving a running batch file stop it?

I am a writing a batch file.

Halfway through the code, I am going to make the batch file move itself into another directory.

Will this stop the batch file from continuing to run?

Thanks for any help

How Do I write a DOS batch script to find the disk space used up by specific types of files in a drive or folder?

Dos batch is not really a scripting language and doesn’t even contain functions for math. dir /s would show all files, and could be fed more syntax to be more specific like dir /s *.jpg to see how many jpg files are on the disk. If you really want to do this, use xtgold Xtgold which is a dos file manager. Or ZtreeWin if you’re in windows ZTreeWin . You can log an entire drive using ALT L then press F to adjust the file specs you’re looking for, and S to show all files. I’ve used DOS a lot :)

How do you build a simple computer game using a batch script?

Other than a way of testing your batch script abilities, you normally wouldn't bother.Normal situations dectiate that you use the right tool for the job and batch was never the right tool for computer games and probably for most tasks other than automation.That said, if you can build loops and if conditions and print characters to the screen then you can build almost any text based game and using some tricks you can get pretty awesome text based art or may be even animation.Going all the way with that to build a simple 2d Sprite based platformer or even flappy bird will be tough without drawing routines, those just won't come by easily and I think it is too complicated to do using the limited functionality batch provides.I am not saying it isn't possible, but it is just too hard to do it this way, it is probably as hard as doing 3d graphics in assembly language which is just too daunting of a task that you don't believe is possible until you see it with your eyes (check rollercoaster tycoon to see it was possible)

My batch file doesn't run in schtasks?

I'm thinking that your task scheduler isn't designed to run batch files. What you can do is download a batch to exe compiler and then program your task scheduler to open up the EXE file.

Question about Batch File! Renaming a computer, and changing the current Domain?

SET /P PCNAME=Please enter the computer name:

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Co... /v

ComputerName /t REG_SZ /d %PCNAME% /f

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\T... /v Hostname /t REG_SZ /d

%PCNAME% /f

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\T... /v "NV Hostname" /t

REG_SZ /d %PCNAME% /f
@echo off
echo Please Restart your computer Manually. The Program will exit now.
echo.
echo.
pause


So, basically this already works, per-say. It does rename the computer like I want it to like magic. I want to add a function to where I can type in either in the code so it is that same every time. Or, if I have to set it manually in the batch to change the domain name as well.

Please let me know if you have information regarding the extra bit of code I require. THANKS!

Any way to make a batch file prompt unclosable?

use the /K switch. For example:

cmd /k ipconfig /all

will open the command prompt, run the ipconfig command and leave the window open.

To make it temporary, just use the pause command.

Keyboard input during loop in batch file?

SET /P input=Please type a value:

To test the value of input use
%input%

This will however stop the program on every loop and may not be what you want.

Have fun.

Why doesn't this batch file work?

How are you running this batch file?From reading your code, I get that the batch file should be run as followsbatchfile.bat directoryname fileoutput.txt
If so the file should probably work.For exampledirlisting.bat C:\ cdir.txt
may produce a file called cdir.txt with contents Volume in drive C has no label.
Volume Serial Number is

Directory of C:\

10-Apr-17 10:58 AM 1,297,862,656 2017-04-10-raspbian-jessie-lite.img
09-Apr-17 08:26 PM

AdwCleaner
18-Feb-17 01:44 PM ESD
17-Dec-16 08:42 PM Intel
07-May-17 08:13 AM MinGW
01-Dec-06 11:37 PM 904,704 msdia80.dll
24-Nov-16 01:27 PM NVIDIA
09-Dec-16 12:05 PM PathAdder
19-Mar-17 05:03 AM PerfLogs
01-Apr-17 05:14 PM php
03-Jun-17 10:21 AM Program Files
05-Jun-17 09:56 PM Program Files (x86)
13-Jan-17 08:32 PM Python27
14-Dec-16 01:21 PM Ruby23-x64
15-Dec-16 10:31 AM solidangle
13-May-17 01:25 PM Users
02-Jun-17 07:46 PM Windows
01-Jan-17 10:01 PM xampp
2 File(s) 1,298,767,360 bytes
16 Dir(s) 271,915,327,488 bytes free

TRENDING NEWS