Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

6901.

Solve : Need to have DOS Windows Open to install Next Program?

Answer»

I am writing a batch file to install IE 7 and WinBug. I install IE 7 first then next is WinBug program. However after IE7 INSTALLATION, the DOS Windows just closed and not proceed to WinBug installation. IE7 installation just calling IE7 MSI with norestart switch.

:IE7
ECHO Installing Internet Explorer 7. Please wait..........................
chdir /d "C:\Source\IE7"
install.CMD

:WinBug
ECHO Install WinBug
chdir /d "C:\Winbug"
WinInstall.cmd

How can I install WinBug after IE 7?

Thanks.You probably just need to CALL your CMD (or BAT) file. Like:
Code: [Select]:IE7
ECHO Installing Internet Explorer 7. Please wait..........................
chdir /d "C:\Source\IE7"
call install.cmd

:WinBug
ECHO Install WinBug
chdir /d "C:\Winbug"
call WinInstall.cmdFunction CALL GOT the job done!

Thanks!

6902.

Solve : how do you ask the program to read 1's and 0's?

Answer»

does any one have the answer to my question
That's REALLY all PROGRAMS and computers for that matter do, READ 1s and 0s.

What is it your are trying to ACCOMPLISH?

6903.

Solve : command.com / cmd.exe?

Answer»
hello there
i have been using the cmd.exe, and have just come across this paragraph, doe's this MEAN that i should be using the command.com, if i don't need the additional ENVIROMENT variables




When running Windows NT, 2000, XP, or future operating systems there are two versions of the command interpreter, command.com and cmd.exe. Cmd offers additional environment variables than command.com; however, it is recommend if you are attempting to RUN a MS-DOS utility that you utilize the command.com. To use command.com, click Start / Run and type command.


It depends on what you want to do. Like the paragraph says, if you are trying to run an old MS-DOS program or utility you may find it runs better under command.com, but if you aren't having any problems you may as well stick with Win32 cmd.exe like I and most others do.
CMD.EXE is compatible with most MS-DOS PROGRAMS, and it has SIGNIFICANTLY more functionality than COMMAND.COM does. I agree with Dias and would continue using CMD and if you see something that doesn't work, and then try COMMAND.thanks dias and Gurugary
6904.

Solve : Hiding the CMD window while running a .bat file?

Answer»

I've been racking my brain trying to work out how to hide the CMD window while running a batch file, anyone happen to know? :S (last resort)

Thnx,

JoeOh yeh, should have said, needs to be a line I can just stick at the TOP of the file.

Due to the restrictions on the computer I'm using I can't download anything or use QBasic. (and for some reason cmdow @ /hid wont work :-/)

Anyone got any ideas?

*looks disgruntled*

JoeYou can create a SHORTCUT for the batch file on the desktop. Right click the shortcut, click properties, click the program tab, and change the run parameter to minmized.

Good luck.

6905.

Solve : PQMAGIC (Partition Magic) Vs. Fdisk?

Answer»

In what WAYS is PQMAGIC (Partition Magic) PREFERABLE to FDISK? Is there any reason, apart from cost, why anyone might choose NOT to use PQMAGIC?

6906.

Solve : Batch file to delete duplicate files in 2 folders?

Answer»

I need help composing a batch file that will compare the contents of two folders ("A" & "B") and delete the files from "B" that also appear in "A". Leaving only one file in the "A" folder. Just to make things a little more complicated the file name structure is as FOLLOWS:

filename.prt.1

Each time the files are SAVED they are duplicated and the NUMBER extension at the end will be incremented (previous files are retained, just not used). I need for that number extension to be ignored.

I hope all this is clear enough. Any help would be greatly appreciated. ThanksYou lost me with the number extension. If you strip off the number from the files in FolderA, how will you ever match the names in FolderB where the files presumably still have their numbers?

Otherwise you have three possibilities: Filename is in A, Filename is in B, Filename is in A & B. I try not to post destructive code, so you'll need to replace the echo statements with del instructions.

Code: [Select]@echo off
for /f "tokens=* delims=" %%v in ('dir c:\FolderA\*.* /b') do (
if exist "c:\FolderB\%%v" echo File %%v in FolderA; File %%v in FolderB
if not exist "c:\FolderB\%%v" echo File %%v in FolderA; File %%v NOT in FolderB
)

for /f "tokens=* delims=" %%v in ('dir c:\FolderB\*.* /b') do (
if exist "c:\FolderA\%%v" echo File %%v in FolderA; File %%v in FolderB
if not exist "c:\FolderA\%%v" echo File %%v NOT in FolderA; File %%v in FolderB
)

As for the number increment, there are worst ways to spend your summer.

The code listed above works but I still need more help. The file name structure is as follows:

filename.ext1.#

Example:
3348053.prt.1
3348053.prt.2
ect...

I need to be able to strip off the last extension (the number) and search the folders using only the file name and the first extension.

Each time that the program (Pro/Engineer) saves a file it actually creates a copy. The last extension of the file name of the NEW file is then incremented. Giving you a complete history of your work (and a giant pain for file management).Just did one side of it. You can do the other.

Code: [Select]@echo off
for /f "tokens=* delims=" %%v in ('dir c:\FolderA\*.* /b') do (
if exist "c:\FolderB\%%~nv" echo File %%~nv in FolderA; File %%~nv in FolderB
if not exist "c:\FolderB\%%~nv" echo File %%~nv in FolderA; File %%~nv NOT in FolderB
)

These code notations for paths/files may help you out.

Quote

%~I - expands %I REMOVING any surrounding quotes (")
%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
%~aI - expands %I to file attributes of file
%~tI - expands %I to date/time of file
%~zI - expands %I to size of file
%~$PATH:I - searches the directories listed in the PATH
environment variable and expands %I to the
fully qualified name of the first one found.
If the environment variable name is not
defined or the file is not found by the
search, then this modifier expands to the
empty string



PS. With multi-dot file names, the extension is the data after the last dot.

I'm not going to pretend to really know whats going on with this code, but I think something is still missing. After changing the %%v to %%~nv the code strips off the extension of the file names in folderA and searches folderB for the file without the extension. The only problem is all the files in folderB still have their extensions. So the batch file says that none of the files in folderA are in folderB (even though that's not the case). The batch file needs to strip off the file name extensions in both folders and then compare them. I appologize for not making this clear before. Is this possible? Thanks!Could you please post a sample of the file names in both FolderA and FolderB. Unless I'm missing something basic, none of this makes any sense. Stripping off the increment number in the file name, guarantees duplicate file names.

Another approach would be to strip the extension in FolderA. By using the extensionless filename with a wildcard, you could grab all the files from FolderB with the same base name.

Your wildcard suggestion works perfectly. Thanks for all your help, I really appreciate it!
6907.

Solve : loop through directories?

Answer»

Hi,

I have a directory which CONTAINS a lot of subdirectories and each subdirectory contains one file. A these files have the same NAME and I WANT to rename all these file.
How can I dod that with a .bat file?
Thanks.

SandraIt's been a while SINCE my DOS DAYS, but if I recall, this should work in a batch file:

for %%f in (dir /b /s *.*) do ren %%f newname

Change newname to anything you wish. Make sure you run your batch file your top level directory.

Good luck,

6908.

Solve : Can't open DOS?

Answer»

I'm using Vista, and I can't seem to RUN most DOS programs. It says, "This system does not support fullscreen mode. Choose close to terminate the program." I can close or ignore; ignore just leads me back to the same ERROR message. I can run DOS programs that run in window mode, but not fullscreen. Can anyone help me?for old dos programs, expecially games you have to use DosBox atleast thats the easy way http://www.dosbox.com/download.php?main=1This is actually a Windows VISTA question check for compatibility options. Remember Vista has and ADVANCED Graphic interperter and some DOS programs won't understand the vid requirementsOkay, let's assume I know pretty much NOTHING about computers. How do I implement EITHER of your suggestions?

6909.

Solve : A Batchfile Problem for me!?

Answer»

Hi

I need to write a batchfile that will reconstruct a desired version from an incremental backup system (using a predefined directory structure). Each incremental version is stored in a subdirectory named .\ver_nn where nn represents the incremental SEQUENCE number.

e.g. The batchfile call 'remake.bat'. If a user SELECTS the directory ver_03, and drag & drops it over the remake.bat, then:

1. The program will create a subdirectory .\ver_03\full_ver\

2. All files from previous versions including the third version (i.e. ver_01, ver_02, ver_03 will be copied into the .\ver_03\full_ver\)

Please if ANYONE can HELP...Has any one know how to use the batchfile reads and shows one line of text in a textfile?

6910.

Solve : FAT file system VS. NTFS file system?

Answer»

What are the differences between a FAT and an NTFS file system. What are the advantages and disadvantages of each of them?Thomas,

Microsoft can explain this a lot better than me.

http://www.microsoft.com/windowsxp/using/setup/expert/russel_october01.mspx

Hope this helps. Good question, Thomas!

A hard drive must be formatted with some file system that the operating system (OS) recognizes before data may be saved to it. The file system used for hard drives determines which features are available to the OS installed.

FAT 16 (or just FAT) = File ALLOCATION Table. It is the 16-bit format used by DOS & early versions of Windows 95. Files saved on FAT 16 may not have names any longer than eight characters, followed by a dot & three characters.

FAT 32 = The 32-bit format most often used by later versions of Windows 95, Windows 98, Windows 98 SE, & Windows Me. FAT 32 is more stable than FAT 16, supports hard drive partitions larger than 2 GB, does a better job at saving space on your hard drive, & ALLOWS you to use much longer file names (over 200 characters).

NTFS = New Technology Files System. It comes in two flavors: NTFS-4 (used by Windows NT) & NTFS-5 (used by Windows 2000 & Windows XP). NTFS-5 is more stable than FAT 32, allows you to compress INDIVIDUAL files instead of entire logical drives, & lets you set security PERMISSIONS to protect your computer's data (just a few of its advantages).

Some older programs will not work with NTFS-5, but, in my opinion, the increased security & stability of the file system makes it the best choice when installing Windows XP.

Regards,
DOC

6911.

Solve : Trying to write a batch file 2?

Answer»

How do I write a batch FILE that will read a files name and move it, if the file is what I want. I am guessing an "if" statement will work? if so, how would it be WRITTEN?XP os[sigh]

If you have Win XP, my best suggestion would be to USE Windows Script. Not only is script more powerful, and readable, but batch language is equivalent to using a Flintstone TOOL in a Jetson world.

What would Rosie the Robot think?

Excuse me if I sound flip, but c'mon, GET with the program.

6912.

Solve : win XP batch files?

Answer»

hi
i recently upgraded to XP and fnd batch dont work proply 4 me, i tryin to do somethin real simple like just OPEN 2 PROGRAMMES, it opens 1 and keeps the cmd prompt up and with blinking cursur and nothing else,when i close that programme the other one opens. do i have add something to make the second 1 open by itself?Show us your scriptIt makes sense really. When you launch the PGM1, it gets control and the batch file is suspended. When you exit PGM1, control is returned to the batch file which then launches PGM2.

To accomplish what you want, USE the START command to launch both PGM1 and PGM2. If you want the close the command window, put an EXIT statement at the end of your batch file.

Example:

@echo off
start PGM1
start PGM2
exit

Hope this helps. Quote


Example:

@echo off
start PGM1
start PGM2
exit

Hope this helps.


???this just open two cmd prompts with the programs name on the title bar and thats it Quote
Show us your script


its just a simple batch run command:
"C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"
"C:\Program Files\MSN\MSNCoreFiles\msn6.exe"

i ve tried it with diff programmes as well as files with he same resultI assume you have upgraded to XP from Win.98se or some such OS which is DOS based. XP does NOT have DOS just emulation so many Dos based progs will not perform as they did in Win.9x SYSTEMS. I think Sidewinder's response is correct tho' I'm not sure of the Start command syntax. You could look here for an answer:

http://www.ss64.com/nt/
6913.

Solve : How to delay a net send massage?

Answer»

how can i delay a NET send message with -tThe only way I know to do that would be to use a "scheduled task" in Windows or the AT scheduler in NT and above.r u USING win xp?
if so us a DOS command CALLED MSG

it accepts delays on messages

type

msg /?

into dos

hope this helped

6914.

Solve : Setup command?

Answer»

I have a p-3 computer which "was" running Windows 98. I decided to reformat the hard drive and reinstall 98. However, I cannot find my Getting Started with Windows 98 book so I do not have the numeric key to open 98.

I have a new COPY of windows xp professional I can load, but I cannot get past the BOOTUP of w-98. I know there is a technique to get to dos which would allow me to get to my CD-rom and I can run setup on the xp-pro.

Someone please help!

THANKS, ronRonald:

Man! i wish you would have asked us before you formatted your hard drive. Someone would have explained how to use REGEDIT to search the registry for the product ID number.

You may still install Windows XP by changing the BIOS settings to first boot to your CD-ROM drive. Then just pop in the Windows XP installation CD & you're in business!

Let me know if you need any further assistance.
DocIs it straight Win.98 or Win.98se

6915.

Solve : Proggy Before Driver?

Answer»

Hello. I was wandering if anyone can help: Can you please tell me how to edit one of the CONFIG.SYS, AUTOEXEC.BAT, and/or MSDOS.SYS file(s) so that I can load a program before DOS loads the drivers? Or, can someone send me a HYPERLINK?

Thanks,
Adam.From the command prompt type....

edit autoexec.bat

I know how to edit the files, but what do I put INSIDE them?Assuming Windows 98 or lower then you put in commands that set the path, start TSR programs, load certain device drivers, etc. What you put in them is totally dependant on what you want to do and what hardware you are using.

If you are trying to do this on a computer with a Windows version greater than Windows 98 it will not use these files on boot up, only in specially configured command prompt windows or booting to command prompt only.

So you will need to provide use with significantly more information if you want some specific answers.it is for a DOS 6.22 bootdisk
OK, I will try this one more time.

What, other than booting the computer, do you want this disk to do for you?

For example....
If you want it to load your CD drivers then you need to find the appropriate device drivers from your CD manufacturer and then read the instructions for loading those drivers from you CD manufacturer's documentation. If you want it to load another device, then the same procedures apply.

I want the disk to load a DOS prompt so that I can load a game from the CD. I already have the CD-ROM and mouse drivers,

But my question is, how do I edit the files so that the computer loads a program BEFORE the drivers?You can't get there from here. Some drivers are required or the SYSTEM simply will not FUNCTION. After the BIOS loads the basic drivers it hands control to the OS. The OS then looks first at the config.sys for loadable device drivers which tell it how the system should be configured. These include such things as memory managers, CD rom drivers, etc. After these are loaded, it then turns to autoexec.bat to perform any additional operations specified by the user. You can use different configurations by using the CHOICE command to set them up. But loading a program to the exclusion of all drivers is simply impossible.Maybe a Startup Menu will do what you want:
http://dos.rsvs.net/DOSPAGE/CONFMENU.HTM

6916.

Solve : How much DOS is 'inside' XP??

Answer»

I used to be DOS only going back a longer TIME than I care to admit but - now and again use 'cmd' in XP to do something like a ping test etc.

I have not dug really deep but get the impression that what can be done in the console these days is very limited - chkdsk, diskpart etc seem to function but - interested to know from current DOS gurus just how much or little actual DOS function we have within XP? IIRC way back under Win 95 ORC 2 I had a pretty full deal.

I still have an old 6.22 fileset of DOS, including DOSSHELL etc but - from what I have been reading this will not perform or be useable within a current Win OS.The response to this will probably differ greatly between each person, but in my personal opinion, you can do a great deal with the CMD console. There are actually very few administrative tasks the command prompt under Windows XP can't do.

Create users or change passwords: "net.exe" command with the "user" param
View / edit the registry: "reg.exe"
Control panel tasks: "control.exe"
... plus thousands more

I still think some tasks are more efficient with the Windows GUI, but many are more efficient with the command prompt. I use a combination of both console and GUI, but I almost always have 3 or more command prompt windows open at any time either working or waiting to help me.Thx Gary - most encouraging. I should MAYBE dig deeper after all!

Further to that is perhaps the question also - does solid DOS SYNTAX still apply throughout - including all the good ol' DOS switches? What was one old one - shucks, memory going bad ......

DIR OEN/P - to stop a DIR listing scrolling?Quote from: ChrisXPPro on July 27, 2008, 08:32:51 PM

Thx Gary - most encouraging. I should maybe dig deeper after all!

Further to that is perhaps the question also - does solid DOS syntax still apply throughout - including all the good ol' DOS switches? What was one old one - shucks, memory going bad ......

DIR OEN/P - to stop a DIR listing scrolling?

THose switches are still there. Dir /oen/p works just the same. You may as well consider it a 32-bit DOS on steroids. Certain extras you'd expect like long filename support, etc. The batch language is greatly extended (you have loops!) but still mostly backwards compatible.

OK, but in relation to your initial question regarding how much of DOS in inside XP...not alot. With every new version of Windows, DOS is being watered down. I think XP was the first Windows version that didn't require DOS to be running, in some capacity, in the background. (I may be wrong on this)

The Command Interpreter has become something entirely different.It began as a DOS emulation tool, but with every new version more and more Windows-specific commands are added. I suppose, eventually, we may end up with it becoming the Windows Shell!Actually it was Windows NT that was the first to not use dos because DOS was 16bit, The Windows NT Family of OSs(including Win NT, 2000, XP, Vista)
is 32bit, execept for Vista, its 64bit. Just look at my signiture. But Any OS before NT, that includes 98, 95, ME, 3.1, was based on DOS.and yes i've noticed that Vista doesnt even have some of the important commands, like edlin, edit, ipconfig. Tsk Tsk...Thx guys - of course as I was thinking but did not mention - there is the 16 bit aspect with the old true DOS, as macdad points out.

I shall when time dig deeper out of interest but my impression had been that what is there is ''watered down'', even tho still of SIGNIFICANT potential use. I have noticed just occasionally an app will install (usually something like a small utility) and notice the console open briefly while files are expanded for example.

It would be nice if ''true DOS" could be run, which would include the old Qbasic and numerous other once familiar items.I don't think that NT 32 bit command is "watered down", and I first started using MS-DOS 3.30 in 1988. I think it is beefed up. I would hate to go back to short file names, tiny address space, etc. MS-DOS is all very interesting but it belongs in history as far as I am concerned.
MS-DOS...A winner in the Computer Hall of Fame
6917.

Solve : I'm here again and need assistance?

Answer»

Here I am again with more problems. Lol. This time it isn't actually a big problem. The computers at our school have a blocking system on and it is called websense. For my project I'm supposed to be looking for games to put on this bootdisk so when I have the disk in the computer a game should POP up....Well, websense blocks everything that is considered a game, educational or not. I'm lookinf for some TYPE of math game, like Algebra but not really hard Algebra. MAYBE Algebra ONE would be could...I can't find one anywhere that is free and it has to be less then 50kb, now I have found some programs that are 50kb or under but they are just couculators (I know I spelt that wrong) and my teacher says it has to be a math game...So, can anyone help me out? E-mail me to program or a link to a site, either or works and my e-mail is [emailprotected] Thanks for your time and consideration.
[glb]Valerie[/glb]

I really need to learn how to spell, lol

6918.

Solve : Computer won't open Bios?

Answer»

I have Microsoft 2000 and it was given to me but the problem is it is set up for a network so there for i need to GET into ms-dos to change the SETTINGS but when my computer boots i press F1 or F2 and and all that happens is the screen turns black and on the bottom it says HIT F10 for setup, it STAYS like that for a COUPLE of seconds and then goes back to booting normally. Why can't i get into the Bios F10then how do you get the computer to reboot in dos mode?There is no DOS in Windows 2000. What do you need DOS for? You said you wanted to get to the BIOS.

6919.

Solve : Does not end...?

Answer»

I made a simple batch file that ends a program, then restarts, and i want it to exit out..(which usually does by its self) but for some reason this does not... do anyone have any input??


taskkill /f /im litestep.exe
taskkill /f /im litestep.exe
taskkill /f /im litestep.exe
C:\LiteStep\litestep.exe
exit

i put exit because it doesnt exit out.. but it seems the COMMAND prompt is FROZEN after executing the line C:\LiteStep\litestep.exe...It's waiting for the litestep.exe program to finish before executing the next line, "exit".

Try........
taskkill /f /im litestep.exe
taskkill /f /im litestep.exe
taskkill /f /im litestep.exe
start C:\LiteStep\litestep.exe
exit
OH... god dam it, i knew that... why didnt i THINK of that...

THANK you so much.

6920.

Solve : list of internal command?

Answer»

can ANYBODY have list of internal command including its. parameter.. ex.. for /f .......... etc..etc..

thanks..Depending on the underlying OS, BATCH language comes in many flavors. Microsoft keeps adding new extensions (which are not backward COMPATIBLE) with each release of Windows. The easiest way to find the parameters for a command is to type command /?

ALSO this site will probably help you out.

http://www.allenware.com/icsw/icswidx.htm

Good luck. or just type help after the cmd PROMPT........which windows.......

6921.

Solve : Windows 98 won't start from DOS...?

Answer»

Ok, so here is what has happened so far...

A couple of DAYS ago I restarted my laptop and it came to a screen that said, "INVALID system disk..." However, there were absolutely no floppy disks or CD's in any drives. So I made a Windows 98 boot disk from my other computer and put it in my laptop and restarted my computer.

Then, I transferred the system over to my hard drive. Once I did that, and restarted my computer it goes into the Windows 98 loading screen for about a second but then goes straight to DOS. I went into C:\WINDOWS and typed in "win" to try and run it but it says that "HIMEM.SYS" is missing.

I looked through the Windows directory and there is a HIMEM.SYS file there so I thought that it may have just been a corrupt file. A copied a new HIMEM.SYS file from my boot disk onto C:\WINDOWS, OVERWRITING the old file. Then when I restart my computer it still goes to the Windows 98 loading screen and goes back to DOS and when I type "win" in C:\WINDOWS it still says that the HIMEM.SYS file is still missing.

Then I tried going into CONFIG.SYS on my computer to make sure that it said DEVICE=C:\WINDOWS\HIMEM.SYS and I am pretty sure that it did but it said some stuff after that on the same line.

It still says the HIMEM.SYS file is still missing and I no longer no what to do. Is there anyone that can please help me because I am getting really frustrated. All of the stuff that I did before, was I right in doing this? If not, please let me know so I can fix it. Thank you and any help on this issue would be greatly appreciated.try typing "Exit" from the command line, that's what I do when I'm working in dos and want to get back to windowsI had the same problem but without it saying missing file. I tried UNLOCK or UNLOCK C: and then WIN and it worked.

Hope it does for you!

6922.

Solve : Floppy Image?

Answer»

Hi,

I'm TRYING to install Virtual Machine Additions for DOS. I have the FLOPPY disk image, but for some reason when I try to transfer it to disk it says I need an extra 16.5K. I'm using a STANDARD 1.44 HD floppy disk and it's been formatted. Am I doing something wrong?I think you'll FIND that it's a virtual floppy image for use with VirtualPC, it's not meant for making a real floppy.

Quote from: Dias de verano on July 25, 2008, 09:05:10 AM

I think you'll find that it's a virtual floppy image for use with VirtualPC, it's not meant for making a real floppy.



Yes DIAS is correct you will need to create the Virtual PC but Install DOS onto it.Ahh my bad, I get it.

The article I read stated 'boot from floppy'. I just assumed it meant the physical one LOL.

Cheers.I don't think you need to transfer it to a floppy disk. From your Virtual Machine (while running in DOS), choose the Floppy menu at the top and choose "Capture Floppy Disk Image" and point it to your Virtual Machine Additions for DOS image.
6923.

Solve : Random Password & MAC Generator..???

Answer»

i dont understand how he can use random password generator as a hacking etc. tool. light me up guys. same for mac adresses.because if he tried to hack a sys, all he would have to do is run the random password generator to find the correct code. and MAC address is a Modems Physical address unlike its virtual address(IP address)hack a system using batch ? i would see thi?s
Code: [Select]because if he tried to hack a sys, all he would have to do is run the random password generator to find the correct code.and how do you want to SEND them to app ? easiest way i THINK will be VBS . but that all generating etc may take a lot of timeWait, I don't think I understand...Something like Brute Force?well no i this would be part of a hacking prog. you would first have to write a app in VBS or C to interface with the app. but thats pretty dang hard to do so nobody know how to do it, i dont know how to do it either.Yeah. That's what I thought.oh well, but we BETTER get back on subject and talk to gumbaz about this.He is a BIT of a hit and run poster. I spent a whole afternoon crafting a batch file for him and got not a single word of acknowledgement. Not the way to win friends.

yea and you toke up some of your time doing a favor for him.Sorry guys if it seems like I come off ungrateful to you and your hard work + effort that you have provided me, by all means I greatfully appreciate all of your guys dedicated hard work and help for all my crazy azz ideas that i come up with. I'm just a lil busy some times and forget to post back my testings with yer guys codes.. sorry bout that.. no offense intended...

Not sure what batch file your talking about though Dias de verano that you spent all afternoon crafting for me, but I do appreciate you doing that for me.. i just probably didn't have enough time to check to see if it worked yet. and forgot about it or something because i moved on to some other crazy *censored* idea that popped into my noggin..

i still don't understand why you guys think that im going to use this Random Password + MAC Generator to hack people or what ever.. My intentions were more the other way around for preventing people from hacking into me or my accounts by using random Complex generated passwords that i can use for more Secure Privacy of my accounts in such Ect..
and the MAC generator is just for my router so i can change its MAC easily without having to make up random MAC's from scratch off the top of my head..
When i change the mac on my router and reboot it my ISP gives me a new IP.. it comes in handy if yer IP gets DDOS or what not from Lots of incoming connections - Torrenting Ect..

Im really a good lil lad with good intentions, im not a criminal, im an ALIEN.....i mean, a human being *censored* ..!!!

6924.

Solve : Run a batch while sleeping?

Answer»

Hello everyone! I'd like to have a second batch run while the first is in delay, displaying a message to wait. I also want it to run after killing explorer. I've DOWNLOADED and using sleep.exe for the delay/display, but unsure if the second batch is actually running during the sleep, or if it runs COMPLETELY before sleep starts, or if sleep kills it. In general, the second batch will run very quickly, but MAY take upwards of 5 to 7 seconds, so have sleep set at 10. Does sleep put everything to sleep, or just the batch it's running from?

Not SURE if it matters, but this is intended to run on XP.

Any help would be APPRECIATED. Batch files are completely new to me.After posting I got a brainstorm and answered my own question. I put batch 2 into an endless loop and watched it run continuously during the 10 second sleep.

6925.

Solve : windows 98 in dos?

Answer»

every TIME that i start up WINDOWS 98 it goes to dos mode. ive tried things like UNLOCK C:\ c:\win , EXIT and C:\windows\win but when i do any of them it says:
windows PROTECTION error. you need to RESTART your machine. Any ideas

6926.

Solve : Cant run W XP. I have a DOS boot disk..Please Help?

Answer»

i have a problem....

on my pc I cant run windows XP... I CREATED a dos bootable floppy disk but I dont know how to start windows through DOS...
Can Somebody help please Some more info required.

What HAPPENS when you you to W XP?
What message R U Getting?
What stage did you GET to?
Are U not getting the Wxp splash screen at all?
you should TRY and put in the XP CD to see if you can repair if that is your problem...

6927.

Solve : add user and file directory in batch file??

Answer»

I would like to know how to add a list of user from a file in batch file. and also how to add directory/file in using batch file?

thank youAdd a user to what?
Local computer users?
Domain computer users?
Active Directory?
SQL Server?
Oracle?add to active directory. ThanksYou need to write an ADSI script.

strContainer = ""
strName = "EzAdUser"

'***********************************************
'* Connect to a container *
'***********************************************
Set objRootDSE = GetObject("LDAP://rootDSE")
If strContainer = "" Then
Set objContainer = GetObject("LDAP://" & _
objRootDSE.Get("defaultNamingContext"))
Else
Set objContainer = GetObject("LDAP://" & strContainer & "," & _
objRootDSE.Get("defaultNamingContext"))
End If
'***********************************************
'* End connect to a container *
'***********************************************

Set objUser = objContainer.Create("user", "cn=" & strName)
objUser.Put "sAMAccountName", strName
objUser.SetInfo


You have to make changes to the strContainer and strName variables. Save the file with a VBS extension and run it from the Windows Run Box. Include the extension for execution. FEEL free to CONFIGURE the script to your needs.

Hope this helps. sorry, i can't get you. PERHAPS you can explain in a simple way. previously i thot i can write a .bat file and run it in dos prompt, which will be able to generate a set of user based on an INPUT userlist file.I understand that Dsadd utility found in windows 2003 can add a user to Active Directory (AD) from the command line without using a script?

what if i wan to create not one a single user, but a list of user which import from a file, can this command help me without using a script?
Oops, I REALLY screwed this one up. You can use DSADD from the command line.

for /f %%i in (namefile.txt) do dsadd ...

%%i is a user name from your file
namefile.txt is the label of the file containing the names
... are the DSADD switches (there is boat load of them)

If you type DSADD /? at the prompt, you should get a list of all the switches, or try this site:

http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/dsadd_user.asp


Personally, I would use a script. It's much more powerful than batch language and was designed to automate these types of tasks.

Good luck.

6928.

Solve : Create Batch file to execute 3 programs?

Answer»

I need a Batch file to start 3 applications. I've tried the FOLLOWING in a batch file:

Code: [Select]"C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
"C:\Program Files\Mozilla Firefox\firefox.exe"
"C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
It starts the first one; Messenger, and stops there.

How can I get it to proceed to execute the remaining applications? Ideally each one should only start after the previous one has successfully started, but it is not an absolute requirement. Oh, and all this must be silently. No input required to process the next line.

Thanks in advance.Try the following:

Code: [Select]@echo off
start "" "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
start "" "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"Thank you, that works

Is there a way to delay processing the next line, e.g

Code: [Select]start "" "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
wait 10 seconds then proceed
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
wait 5 seconds then proceed
start "" "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
You could have a look here:
http://malektips.com/xp_dos_0002.htmlCode: [Select]start "" "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
ping -n 1 -W 10000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
ping -n 1 -w 5000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"Quote from: devcom on JULY 28, 2008, 09:16:05 AM

Code: [Select]start "" "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
ping -n 1 -w 10000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
ping -n 1 -w 5000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
I had something like that but I couldn't find it. Thanks. Quote from: Carbon Dudeoxide on July 28, 2008, 08:58:25 AM
You could have a look here:
http://malektips.com/xp_dos_0002.html

Quote from: Carbon Dudeoxide on July 28, 2008, 09:17:22 AM
Quote from: devcom on July 28, 2008, 09:16:05 AM
Code: [Select]start "" "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
ping -n 1 -w 10000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
ping -n 1 -w 5000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"

Much appreciated Thank you.

I did download the Windows Server 2003 RESOURCE Kit Tools, and the Sleep command works. I'll save the second method for when I reinstall Windows and don't need the Windows Server 2003 Resource Kit Tools.
Fair enough. Quote from: devcom on July 28, 2008, 09:16:05 AM
Code: [Select]start "" "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
ping -n 1 -w 10000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
ping -n 1 -w 5000 1.1.1.1 >nul
start "" "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"

I would highly discourage anybody from issuing a PING command on something they don't have control over without a reason. I like to write code as clean and polite and portable as possible. Why not ping 127.0.0.1 or localhost INSTEAD of 1.1.1.1? It would be less work for the computer, more predictable results, and it is more portable and more polite.

Just my 2 cents.By using 127.0.0.1, the 'timer' doesn't work at all.Quote from: Carbon Dudeoxide on July 28, 2008, 06:22:48 PM
By using 127.0.0.1, the 'timer' doesn't work at all.

That depends on the syntax. Using 127.0.0.1 is actually much more accurate than using an IP address you don't control. With 127.0.0.1 you know that it will reply (unless you have done something to disable this), and since I assume you don't control the IP address 1.1.1.1 then you don't really know if it will respond to an inbound ICMP echo request or not ... or when it will change. So knowing that 127.0.0.1 (or localhost) will respond, just use:
ping -n (seconds+1) 127.0.0.1

So if you want to pause for 5 seconds, use:
Code: [Select]ping -n 6 127.0.0.1 >NUL
This works because the first count will be instant, and the others will follow at 1 second intervals.
6929.

Solve : Win XP batch Disable Keyboard/mouse?

Answer»

hello,

im lookin for a WAY to disable the mouse/KEYBOARD untill next RESTART from a batch file in WinXPso far i have tried:

rundll.exe keyboard,disable but cant get it to work!

any HELP greatly appreciated,

Ian Duffy
(Fluffman)

6930.

Solve : Using Dos Batch file for deletion by date?

Answer»

Hi everyone,

I got a small problem. I have been looking for a way to delete certain files created on a specific date.

Is there a posibility to do that with a BATCH file? I thought I read it somewhere but It SEEMS to ave SLIPPED my mind on how to do it.

I have created three batch which copy and rename a file and delete it in it original folder (for archiving). Now I would like to delete certain files which were created on a specific date.

Thanks for the help or HINTS in advance.hi just one thing it would not be the creation date. I would need the modify date. is that possible?? yes?? how??DOS is not aware of a MODIFIED date or for that matter the create date, only the date the file was last saved.

You may want to look at doing a VB Script for this type of thing. VB Scripts can retreive extensively more information from Windows than can a DOS batch file.hi gussery

thanks for the quick reply...mmhhh.. yes the last saved does not help my much...but the idea with VB script is great.

Thanks a bunch...will get to work on the VB

cheers

6931.

Solve : Detecting External CD With MSDOS?

Answer»

I'm trying to install Win95 using an external CD with serial port connection. I GET a "No valid CDROM device DRIVER SELECTED" message. Is there an MSDOS command that will direct the computer to look at the serial port?
Thanks.MSDOS doesn't detect anything. You would have to get a DOS driver from your CD ROM MANUFACTURER, configure it CORRECTLY and load it in your autoexec.bat and config.sys.

6932.

Solve : using std output to input batch file?

Answer»

writing a SCRIPT
1: write one script to check the status of server
2: using that output (whatever runing suspend) to MANIPULATE my NEXT step
e.g
program flow
getserverstatus say running ( using that output "running")
if status is running do something

NEED assistanceNajmuddoja,

What OS and what server are you referring to? I might be able to come up with a script, but I need more details.

Keep in touch...

6933.

Solve : I know this is a newb question, but...?

Answer»

:-[What is the COMMAND to start BATCH off DOS 5.2? I can't SEEM to find it anywhere...
Seriously.Oh God, I am so DUMB... Sorry there... Figured it out.

6934.

Solve : Help!! MS-DOS Files?

Answer»

Aaughh!!!

I was recently talking to a friend on msn messenger when somethin started downloading, before i could stop it had downloaded. It was, wat i believe to be an MS-DOS virus which sends to everyone when i log on to msn.

I found the folder it was living in and also descovered 8 others!! i was happy and jus deleted them and emptied my recycle bin and thought nothing of it. Went back a BIT later to find them back again.

Descovered if i DELETE them, a shortcut copy of them automatically comes back.

Anyone know how to completely get rid of them? Or what i need to buy to do so??

Thanks Are you running any anti-virus software? If so scan your computer with your anti-virus software and see if it can remove it.

If not, get some anti-virus software and stay off of the Internet until you get it.I RUN Spybot: search and destroy, and a form of nortans anti virus but its STILL there.

Will buy some more i think to see what that does.

If anyone else has any more ideas please let me know

6935.

Solve : I cant start w xp, i have a DOS boot disk?

Answer»
i have a problem....

on my pc I cant run windows XP. i created a dos bootable floppy disk, but i dont know how to start windows xp through DOS...
Can SOMBODY help me please Start the OS? You can't.

If your question meant something else, please PARDON the intrusion. Thanks.Is there any chnce i could run the windows xp CD Intaller ? from DOSMarioc4387.....exactly what is it your TRYING to do ?
Is XP already installed ? or are you trying to install it on a freshly formatted drive ?

dl65
6936.

Solve : I WANT TO PLAY THIS MOD?

Answer»

I cant make half-life work this pops up all the time (autoexe.nt is not suitble for runing MS-DOS im trying to get half life on my pc i found a cool mod for it on www.rivalspecies.com its a cool mod but i cant play it unless i get some help from ANYBODY here plz plz plz plz :- This one is an oldie but a GOODIE. From the CMD prompt, ENTER:

copy c:\windows\repair\autoexec.nt c:\windows\system32

After the copy you may want to FIND the copied file in Explorer and lock it down but setting it's properties to read-only.

Good LUCK.

6937.

Solve : Copying Files?

Answer»

I want to copy files from a Floppy on Drive A: to a Folder on Drive C: entitled "Digital Photos, how do I code this using DOS copy a:\whatever c:\anotherplace\Ah yes - I seem to REMEMBER DOS - isnt that the OS which will not ALLOW spaces in a filename without enclosing in double quotes? Can't quite recall the syntax - something like

copy "a:\this file c:\that folder\this file"


What version of Dos are you using???I TRIED copying all files from A: to C: using the following DOS Command, Copy A:\ C:\My Documents and I keep getting a message stating "Too Many Parameters". What am I doing WRONG? Any info would be appreciated, thanks!copy a:\*.* "c:\my documents"

Notice the quotes, they are required.I tried copying files on A: Drive to C: using the DOS Command Copy a:\*.* "c:\My Documents", now I'm getting a message stating "Files on Drive a:\*.* Not Found". Shouldn't this command copy all files from Drive A: to C:? Thanks for your help.You need to understand what the DOS command is doing and exactly what you want to do. When you use copy a:\*.* you are telling DOS to copy all files in the root directory of a: . If there no files in the root directory the command will fail. If you want to copy all directories and files in all directories, you need to use the xcopy command. Type xcopy/?[\b] at he DOS prompt to see the switches available for the command.

6938.

Solve : Oracle SQL Plus Automation?

Answer»

Hello everybody,

I am new to scripting, I would appreciate any help.

What I need to do is to create a batch file that launches 3 Oracle services, then to connect to SQL PLUS. Till here, everything goes fine, but when SQL Plus starts, the execution GETS stuck and I don't know how to automate the work INSIDE it. What I want to do is to issue the command "startup" to start the database from inside SQL Plus, then issue the command "exit" to get out from SqlPlus, then start a program that connects to the database. Here is my UNFINISHED script:

net start OracleOraDb10g_home1TNSListener
net start OracleServiceDatabaseName
net start OracleDBConsoleDatabaseName
sqlplus Username/[emailprotected] as SYSDBA
?? How to work inside SqlPlus and get out to continue ??
C:\Test.exe

Thanks in advance for any reply.

Joe.Put the SQL Plus items you want to process into a single file, mystuff.sql and add it to the command line for SQL Plus

sqlplus Username/[emailprotected] as SYSDBA @c:\mystuff.sql

Since you are also starting your database just 2 lines earlier you will need some sort of PAUSE in there to allow the database time to mount.Thank you very much.

Joe.

6939.

Solve : Multiple processes?

Answer»

i was wondering how i could IMPLEMENT multiple instances of a program like winamp through a batch file. Once the call is made to winamp the batch file DOESNT progress. any SOLUTIONS. i admit this is probably an elementary problem but im new to this so be kindInstead of calling winamp in the batch file like..

winamp

use the start command

start winamp

Batch files wait for each line to finish before moving on to the next so just calling winamp, will cause the batch file to pause until winamp CLOSES. Using the start command tells the batch file to procede once the application starts and not wait for it to end.

hehe i had the same PROB too

6940.

Solve : ms dos 3.0?

Answer»

have an old AT that is used in business that i need to reinstall an exe file that is written over two 5 in floppies. have novell network and have tried everything two get the two files together when i use standard copy commands 2nd part of file writes over first part. it won't let me do the renaming SAYS it's duplicate. any copy commands that will let me write each part to hard disk? can't use zip on program. been tryin SINCE oct 04 can't find any one who knows. must be a command somewhere since it was written on two different floppies . company who wrote went out bus, in 85. and can't find any one who can convert my files over to a NEW program so i am stuck. thanks bob rich. [emailprotected]Wow! An AT. I have one myself still running PC-DOS 7 (the VERSION that came with REXX)...I guess it keeps me humble.

I found lots of splitter/joiner programs on the net, but they all seem to work in tandem. The join program only joins files that were split with its counterpart. You could try and see if they work, but it's doubtful. There are no switches to DOS copy that will help you out here.

Good luck. Have you Tried to copy disk1 to a folder then disk2 to a different folder,then maybe you can combine the files into a single folder?
Just A thought.Do the files have extensions other than .exe??FD#1 contains filename1.exe
FD#2 contains filename1.exe
You want to combine these 2 into 1 file?

1. Rename FD#2 filename1.exe to filename2.exe
2. Copy filename2.exe from FD#2 to FD#1.
3. Copy filename1.exe /b + filename2.exe /b filename3.exe /bthank you very much it worked. i have tried for 6 months and four different so called experts and known of them new how. very similar to what my dos book said but you made it understandable thanks again bob rich

6941.

Solve : Rename parts of files?

Answer»

hello,
I've got a directory filled with many files (a mix of .CSVs and .MSGs) that have the number "1990" in them somewhere in the file NAME. I want to change that to "1980" in all instances.

My original, naïve attempt was: RENAME *1990*.* *1980*.*

But I did not get what I wanted or expected.
I would be grateful for any help.

Thank you,Launch this batch file in the folder and it will create `renfiles.bat.txt` for you to examine in Notepad and then rename to `.bat` and execute if you are happy with it.


Code: [Select]@echo off
dir /b /a-d |find /i /v "%~nx0" |find /i /v "repl.bat" |repl "(.*)1990(.*)" "REN \q$&\q \q$11980$2\q" ax >"renfiles.bat.txt"
The above uses a helper batch file called `repl.bat` - download from: https://www.dropbox.com/s/qidqwztmetbvklt/repl.bat

Place `repl.bat` in the same folder as the batch file or in a folder that is on the path.

Thank you foxidrive.
Unfortunately, out IT group blocks dropbox, so I cannot retreive the helper batch file.
Is it possible to get the code for repl.bat and re-create it?
Quote from: one stupid guy on April 08, 2014, 09:22:37 AM

Thank you foxidrive.
Unfortunately, out IT group blocks dropbox, so I cannot retreive the helper batch file.
Is it possible to get the code for repl.bat and re-create it?
TXT file attached.

[recovering DISK space, attachment deleted by admin]Thank you so MUCH, Geek-9pm and foxidrive.
I was ABLE to use and alter the program as needed.

I very much appreciate your help.
6942.

Solve : Enable Batch File to Log Itself?

Answer»

I found this online:

Code: [Select]@REM *** START: Turns logging on ***
if "%~1" == "NOWLOGGING" goto NowLogging
set SchedulesLogFile=%TEMP%\%~n0 - %date:/=-% %time::=_%.txt
set SchedulesLogFile=%TEMP%\%~n0 - %RANDOM%.txt
set SchedulesLogFile=%TEMP%\%~n0.txt
%0 "NOWLOGGING" > "%SchedulesLogFile%" 2>&1
goto :EOF
:NowLogging
@REM *** END: Turns logging on ***
I don't call batch files like this so I'm wondering how to change this one so it starts like this:

Code: [Select]SET NOWLOGGING=yes
IF %NOWLOGGING%==yes.....

I've done this and tried using
Code: [Select]%0 >"%SchedulesLogFile%" 2>&1
but it's not working.

How should the above sample from the Internet be modified to run when the NOWLOGGING variable is set in the batch file itself?

Thanks,

MJNice to see I'm not the only one who's having trouble with this

Anyone?

MJQuote from: powlaz on March 26, 2014, 10:41:27 AM


I've done this and tried using
Code: [Select]%0 >"%SchedulesLogFile%" 2>&1
but it's not working.


Create a new batchfile called "logging.bat" and run that when you need to log it. The mybat.bat file can't be interactive because you won't see anything.

Code: [Select]@echo off
"c:\folder\mybat.bat" >"c:\folder\file.log" 2>&1

foxidrive - thanks. I've done it that way too. I've gotten used to not being able to see the script run, I'm OK with that. Can you help me make it work the way I described?

Ultimately when it is run the script will ask if I want to enable logging. If I enter "yes" it will set NOWLOGGING equal to "yes" and the script will kick off the logging command . . . if you can help me make it work when NOWLOGGING=yes.

Thanks,

MJI don't know anything about your batch file and there are any number of scenarios
that change the way it should be handled.

I want to use the command to troubleshoot new scripts. Generally I work with the script opened in NOTEPAD++, I run the script and modify as needed. I just want to tailor the commands so the script logs its activity without me having to call it from the command line.

My idea was to set a variable equal to "yes" at the TOP of the script. If this variable = "yes" then the script will log its activity to a text file that I can then look back over. If it is set to "no" the script will run as it was written to without logging itself.

I don't know of a better way to capture where a script hangs up that doesn't involve calling the script from the command prompt or another script. I'm open to suggestions but also could still use help modifying those commands.

Thanks,

MJQuote from: powlaz on APRIL 08, 2014, 06:53:29 AM
I don't know of a better way to capture where a script hangs up that doesn't involve calling the script from the command prompt or another script.

I generally use echo statements to track the changes along with pause statements. That's the most friendly debugging that I know of.
My file manager gives me an instant command line and enhanced access to launching and editing, which helps too.

Does notepad++ allow you to call the batch code in DIFFERENT ways?
6943.

Solve : How to put output of command in a file?

Answer»

I'm pretty sure that there is a command to do this, but I have no idea what it is.

I want to put the output of DIR/S to a text file. Basically, I want to make a text file with all the INFORMATION on my G:\ drive.

(Can it get any HARDER to post a TOPIC?)dir /s >yourfile.txtAwesome! THANKS!

6944.

Solve : cd ejecting someones else drive?

Answer»

how can i EJECT soemone ELSE cd drive wht do i need there ip addressand some SCRIPT files and administrative control of their machine.how can i eject soemone else cd drive wht do i need there ip addressIt can be done thru your ADMIN panel. But they have to local network and you have to have admin rights.

6945.

Solve : Boot to DOS?

Answer»

I have a windows 2000 computer thats completley trashed and i need to format the c drive is there any way to MAKE this computer BOOT directly into doshttp://www.bootdisk.comwhich bootdisk would i wanna use to get it to boot up to dos >?

6946.

Solve : Need help plz?

Answer»

I recently started to make small programs using C++ and when i RUN the PROGRAM it POPS up the dos screen but it quickly disappears before i can EVEN read the displaygo to your command prompt and run it from there.

6947.

Solve : DOS Viewing of Number of Lines from end of file!?

Answer»

I have a small BATCH file that counts total lines in a file then use more to display from the calculated value. But I would LIKE loop this batch file to display all files in a given folder to the screen or to a file! Can't figure out how to loop thru every file in a folder!
Help!!!!!!!!

Example Below:

@echo off
cls
setlocal
:: Syntax: %1 = displayed Lines
:: %2 = path and input filename.
:: EX: eof 10 \Input_filename.txt ( wildcards may be used )
If {%1} equ {} echo %%1 Missing Data - Re-Enter&&exit /b
If {%2} equ {} echo %%2 Missing Data - Error Data Missing&&exit /b
:@echo on
:start
set infile=%2

for /f "tokens=3" %%A in ('find /v /c "@[emailprotected]" %infile%') do (
set lines=%%A
)

set /a count=%lines%-%1
More +%count% %infile%
:@echo * * * Total Lines in %infile% = %lines% * * *
:endI'm not sure how this would implement into your code, but here is how I would do it:
Code: [Select]@echo off

REM Allow us to alter variables and use the altered value in a for loop
setlocal EnableDelayedExpansion

REM DECLARE total variable
set total=0

REM loop thought the output of the command 'dir /b /a:-d'
REM which OUTPUTS all files withing the current directory
REM that are not folders and only outputs their names
REM aka: makes a list of files in %cd% and loops through them
REM assigning %%A to the current one.
for /f "delims=" %%A in ('dir /b /a:-d') do (

REM clear %working%, which will count our lines in each file
set working=0

REM loop through the file and count the number of lines
for /f "delims=" %%G in (%%A) do set /a working+=1

REM add the current file to the total list
set /a total+=!working!

REM close our loop
)

REM undefine %working%
set "working="

REM report outcome
echo Total lines in %cd% is %total%.

REM delay the closing of the window
pause>nul
Couple of options for you.
1) You could drag and drop the files you want to view onto the batch file and then have it prompt you for input to get the displayed lines.
2) You could drag and drop a folder onto the batch file and then have it prompt you for input to get the the displayed lines and it would then process all the files in the folder.Thanks Guys!!!!!!!!

This is close, looking at my example, on the command line I supply two variables (EX:eof.bat 5 c:\filename & path) then count total of the single file, then subtract 5 from total count, then use more from that number ( total lines - 5 ) to display on the screen ( or file ).
But I'm unable to process more than one file at a time. So I'm really displaying the last 5 lines of each file.Quote from: graymj on April 03, 2014, 04:56:46 PM

But I'm unable to process more than one file at a time. So I'm really displaying the last 5 lines of each file.

What is it that you really want to do?I have a small batch file that counts total lines, subtract a inputted value (5), then use more to display from that line number to the end of file to the screen or file. But I would like loop this batch file (below) to work on all files in a folder Can't figure out how to loop thru multiple files in a folder! ( The code below works fine for a single file, I just need to do more then one at a time )
Help!!!!!!!!

Example Below:

@echo off
cls
setlocal
:: Syntax: %1 = displayed Lines
:: %2 = path and input filename.
:: EX: eof 10 \Input_filename.txt ( wildcards may be used )
If {%1} equ {} echo %%1 Missing Data - Re-Enter&&exit /b
If {%2} equ {} echo %%2 Missing Data - Error Data Missing&&exit /b
:@echo on
:start
set infile=%2

for /f "tokens=3" %%A in ('find /v /c "@[emailprotected]" %infile%') do (
set lines=%%A
)

set /a count=%lines%-%1
More +%count% %infile%
:@echo * * * Total Lines in %infile% = %lines% * * *
:endThis will process every *.txt filename in the folder

It enables delayed expansion within the loop so that filenames with ! in them are processed too.

Code: [Select]@echo off
for %%a in (*.txt) do (
"set file=%%a"
setlocal enabledelayedexpansion
echo filename=!file!
endlocal
pause
)OK, Where do I put my code? I guess I'm not quite sure how to interface the two pieces! Thanks Again for all your help! Code: [Select]@echo off
if "%~2"=="" (
echo Lists the number of lines from the end of files
echo Syntax: %0 NumberOfLines "d:\path\filespec"
echo.
echo example: %0 5 *.txt
echo example: %0 3 "c:\my files folder\*.txt"
pause
goto :EOF
)

setlocal enabledelayedexpansion
for %%a in ("%~2") do (
for /f %%b in ('find /v /c "" ^< "%%a" ') do set "lines=%%b"
set /a count=lines-%~1
if !count! GTR 0 More +!count! "%%a"
)
pausePerfect! Now just trying to figure out why it works! Thanks sooooooooo Much! You're welcome.
6948.

Solve : windows xp restart in dos?

Answer»

hey hey,
i am a newbie here. i am working on a xp os and i NEED to do some DOS work.
I want to restart in dos but xp doesnt give me that option at shutdown nor can i SELECT it at any piont during startup.
can u help?XP does not have DOS only a dos emulator. You can use the command prompt by clicking Start > Run and enter cmd. Note that not all strictly DOS commands produce the same result in XP

Good luck
Hi,

I love the "open a command window here" in the menu when you right click on any folder.
A small file you download from MICROSOFT Power Toys for XP site.


Best wishes

6949.

Solve : Printing from DOS?

Answer»

Hi,

LOOKING for some help in sourcing a new printer which must print from DOS.

I need a printer that can print directly from DOS. The one area that I would appreciate some help with is the printer language. I've found that GDI (used by Brother amongst others) is no good for printing with DOS. What about PCL 6?

Is there a printer language I should be looking out for which I KNOW will work with my program?

MANY thanks.Is this for pure text printing or are there some pics??You could use something like DOSPRN http://www.dosprn.com/ to do the TRICK.

6950.

Solve : MS-DOS PROBLUM?

Answer»
HOW CAN WE ANY WAY TO (SHUTDOWN,RESTART,AND LOGOFF ALSO) WITH ANDY COMMAND OR PATH.
PLZ TELL ME ABOUT ITS COMMANDS
Please do not USE all caps. It is considered very rude and shows that you are yelling. Thank you.

Shutdown:

@echo off
echo G=FFFF:0000 | debug

Restart:

MICROSOFT shows you how to build your own reboot program USING debug: http://support.microsoft.com/kb/q67929/

Logoff:

Has no meaning in MS-DOS. It's a single user machine.

Hope this helps.