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.
| 8301. |
Solve : Printing to a Print Server?? |
|
Answer» Hello all. |
|
| 8302. |
Solve : add in batch? |
|
Answer» It's possible to make bat program wich will add the numbers to each other in loop?? |
|
| 8303. |
Solve : Please Help with Batch File to Delete Profiles? |
|
Answer» Hello Everyone, |
|
| 8304. |
Solve : DOS/Command Line file reading capabilities.? |
|
Answer» Hello all, |
|
| 8305. |
Solve : List of service's name, script to manage services ?? |
|
Answer» Hello, |
|
| 8306. |
Solve : scheduling a bat execution problem? |
|
Answer» I built a bat FILE in dos to copy all my documents on the desktop to my backup drive. I want to SCHEDULE the bat to run every day at 7:00pm. I set it up in XP "schedule task" but it fails with a "the scheduled tasks did not run because an incorrect password or user name was entered" . I built the scheduled task with a password and without and still get the same error. |
|
| 8307. |
Solve : Finding an .exe within multiple directories? |
|
Answer» Hello all! |
|
| 8308. |
Solve : DOS command in XP to remember prior entry RESOLVED? |
|
Answer» Hi, |
|
| 8309. |
Solve : find a moving files? |
|
Answer» in ms batch im trying to find all MP3 files on thew hard drive and then move them to a folder, not copy. or if copy then delete the original afterwardsQuote from: djbenny on December 04, 2007, 05:25:58 AM in ms batch im trying to find all mp3 files on thew hard drive and then move them to a folder, not copy. or if copy then delete the original afterwards If it is absolutely necessary to do it from the command line, using only commands that are available there, then someone will probably be along shortly to advise you. In the meantime, answer this: Are you using WinXP? if not, then what? If you just want to get the job done from the command line, it is possible to use a VERY handy third party utility program. Free. (uncrippled shareware) I've used it under MS-DOS, a dos WINDOW in OS/2, and dos windows in Win98. I BELIEVE it will work in a 'dos' window in XP. Fast File Finder (FFF) http://www.pcworld.com/downloads/file/fid,3771-order,1-page,1-c,alldownloads/description.html can be downloaded here. You will need to unzip it. Put it in a directory that is in your path, so you can run it on the command line from any directory. It is VERY easy to use. In your example, fff *.mp3 would quickly find them all, and present you with a menu. From there, you can elect to copy or move them. There are LOTS of other options too. I LIKE to keep a copy of this program on my computer, in the path. Sometimes it is just very handy to have it available when you want one of its functions. I hope this helps. |
|
| 8310. |
Solve : typing in a BASIC program to run in XP? |
|
Answer» I have a BASIC program I wrote in 1987 to run on an Apple IIE that I now want to run on my Gateway with XP. I do not REMEMBER how to enter the program and SAVE it to run. |
|
| 8311. |
Solve : Script to stop Windows services? |
|
Answer» This script provides the RESULT below. |
|
| 8312. |
Solve : batch command prompt? |
|
Answer» Hi, I need LITTLE HELP to know how to HIDE the execution of a prompt command |
|
| 8313. |
Solve : DIR on remote computers? |
|
Answer» Hey all, I'm trying to use the CMD command DIR to see the contents of a remote computer (i.e. \\PC01) CONNECTED via LAN (on the same server). |
|
| 8314. |
Solve : Help with AT command? |
|
Answer» Hello, |
|
| 8315. |
Solve : How do I lock a computer in DOS?? |
|
Answer» We've done this before, I have forgotten how to do it and my husband knows, but basically won't set it up for us to do this again. You see, he is a stay at home dad, with ADHD, who SPENDS 8 hours a day on the computer searching the MILLIONS of webistes available on a single topic to fill his time. Meanwhile, our house has been in remodel mode for 9 years! Kids are in school all day, so this would be the time to work. I can TELL when he's been on the computer compared to when he is off - more is done, and his mood is better when he is not on it all day long. What we did the in past what push a Function key to get in DOS mode when the computer was restarting, and then make some selections from the menu to get to the password section etc.Are you sure this is DOS? If you can move around the menu with the arrow keys and select options like passwords and boot devices you are probably in the computers BIOS. What exactly do you mean by lock the computer? Do you want it to ask for a password every time you switch it on before it loads XP? If this is what you want to do then the password will probably have to be set from the BIOS. If you don't remember how to do this it will be in your computers manual if it came with one and you still have it. Re: How do I lock a computer in DOS? « Reply #1 on: Today at 01:18:02 PM » -------------------------------------------------------------------------------- If you can move around the menu with the arrow keys and select options like passwords and boot devices you are probably in the computers BIOS. OKAY, WHAT YOU ARE DESCRIBING SOUNDS RIGHT. What exactly do you mean by lock the computer? Do you want it to ask for a password every time you switch it on before it loads XP? YES SO THAT I ONLY KNOW THE PASSWORD AND CAN TURN ON THE COMPUTER IN THE EVENING If this is what you want to do then the password will probably have to be set from the BIOS. If you don't remember how to do this it will be in your computers manual if it came with one and you still have it. GOOD POINT, I AM NOT SURE IF WE STILL HAVE IT..... UNFORTUNATELY i can't give exact instructions as pcs BIOSs vary. you can try looking on the internet though. Either search for an online manual for your PC using the model no. (it should be on the PC somewhere) Or enter the BIOS again and look for a make and version number for the BIOS itself. Search for instructions on using your particular BIOS with the make and version number. This might bring you more luck as some PCs share the same BIOSs.Thank you. This does help. |
|
| 8316. |
Solve : Locking Down BAT Files?? |
|
Answer» Whats the best way to convert a bat file to an EXE or even lock a bat file down so others cant get in and mess with your code and or use the code for other things?I never understood why users would take a reasonable sized BATCH file and convert it into a bloated 10K module but that's just me. |
|
| 8317. |
Solve : Unable to get C: prompt? |
|
Answer» A little history first. This is a computer I built for my 5 year old several years ago, PC100 Systemboard motherboard, WD 80G hard drive, 128M RAM. No internet, PRINTER at this time. I installed WIN 98. |
|
| 8318. |
Solve : keystrokes? |
|
Answer» i'm KIND of new to this,so bear with me. When I hit ENTER in the DOS program i get a log-in prompt... problem. It will not let me enter any key strokes to log-inYou need to be more specific so people know what you need help with. |
|
| 8319. |
Solve : NON SYSTEM DISK OR DISK ERROR? |
|
Answer» halo everyone |
|
| 8320. |
Solve : i need to save my data quick xp is dead only command prompt? |
|
Answer» my lap TOP crashed>>> hp compaq nx9010 windows xp home, |
|
| 8321. |
Solve : Need MS-DoS/Command Promt Script to Lock folders? |
| Answer» NEED MS-DoS/Command PROMT SCRIPT to LOCK FOLDERS | |
| 8322. |
Solve : Dual booting with multiple versions of DOS and Win98se? |
|
Answer» Does anyone know how or know where to learn how to setup a dual boot with MS-DOS 1.1, MS-DOS 2.2, MS-DOS 4.1, MS-DOS 6.22 and Win 1.1, Win 3.1, and Win 98se? Thanks for replying! Check out: http://oldfiles.org.uk/powerload/bootdisk.htm You might also like to browse: http://oldfiles.org.uk/powerload/msdos.htm After you decide on how many/which versions you want to install we can better advise...Thank-you to WillyW, I actually have that site bookmarked on my browser but hadn't thought to look there. To patio, Thank-you for the support, I haven't got a definite list yet but I will get back to you with in the next week or two. As the main man would say...we'll leave the light on.I'm not sure about 98, but I know Windows 2000 and XP and so forth automatically enable dual-booting when installed on separate PARTITIONS. Right now my C:\ hosts DOS 7.1 and a WfWg 3.11 installation and F:\ has W2k. But if the computer is too old to even install these at all then that solution won't work... There is another problem, at least for certain DOS versions. Unfortunately, DOS 1.1 does not support hard disks at all. That is, the DRIVE letter for any HD's likely will not appear. DOS 2.0 was the first one to support HD's, with HUGE drives up to 10 or 20MB . So if you do a dual-booting, or, tri-booting, etc... scenario, DOS 1.0 might not me applicable. DOS 2.0 will just need to reside on a teensy partition, keeping in mind that partitions larger then 10 or 20 Megs might not be visible. a Example Partitioning scheme might look like this: let's say you have say a, err, 4GB drive. 20MB C:\ with DOS 2.0 32MB D:\ with DOS 3.11 (I think that is the highest amount that version supports...) <4.0 omitted due to possible drive corruption....> 2GB E: with DOS 6.0. This can serve as a base in which you can install the versions of windows you desire, just make sure to put them in separate directories. Also, to ensure you get a selection screen with this config you will need either Win2K, WinXP, or one of those Linux CDs. I wouldn't be able to help with that last one, but I know of an easy way you can get the boot loader portion on the disk without necessarily installing (well, keeping it installed) the OS: the config could take a while, but here's a quick run-down. First make sure you have EVERYTHING you need. at once. some of these steps are necessary, and installing stuff out of sequence could be messy. -First, you need to repartition the drive of course. DOn't use the DOS 2.0 Fdisk.com, use a newer version. DOS 6.0 or DOS 7.1 (if you can find it...) version would be best. Make a primary partition, (for DOS 2 in this case), and then an extended partition that consumes all the rest of the space (trust me on this one....) -then, select the option to create logical drive letters in the extended partition. Go nuts here, make one for each OS you wish to install. If you have a big enough drive, make sure to leave room for whatever OS you will use to provide the boot screen.(W2k, XP) -once you have them partitioned, ready your newer DOS boot disk (not 2.0, at least not yet...) -format each partition. when formatting, you could plop a /s on the command for the drive that will contain DOS 6 and windows and so forth. not necessary though. -now reboot again, with the older dos disk. you could try to prove me wrong about DOS 1.1 not seeing drives, but I'm not holding my breath . Anyway, get say DOS 2 up with the floppy, and then SYS C: with it. Remember to Copy Command.com over there to. Older versions don't take the liberty for you. -now, for each DOS version you want to put each drive, use a boot disk from that particular DOS to SYS (or format /s) the drive in question. Note that using this method, if you need to (read, DOS 5 and 6) the DOS version, you can, but it is tricky: See, the Installer will probably rewrite the boot code on C:\. That would be the DOS 2.0 code there. so then when you reboot onto C:\, you'll be in the newer dos again! even though you say E:\DOS as the folder! So you need to do this- Reboot onto C:\ (now DOS 5, 6 or whatever new ver). do a quick SYS of the drive that ACTUALLY contains this version of DOS. make sure to specify for example E:\DOS\SYS.COM so you run the right version. reboot AGAIN onto the DOS 2 boot disk, and then reformat the C:\ drive AGAIN with /s (if DOS 2.0 has sys.com though, do that. I'm not sure if it does though....) you'll need to repeat this Install->Sys the right drive->re-sys first drive for each DOS installer you run. major pain. but what do you expect ? once (if ever) you finally get these all sysed (at the moment you cannot boot into any of them but C:\, but watch and learn. If you are using W2K or XP as the boot loader, your free. Just install the OS onto a unused drive, and presto! you have a dual boot between DOS 2 and XP. hey! where are the others? to get the others to work, you'll need to fiddle with boot.ini- it might look like this, and will be a hidden file in C:\. [boot loader] timeout=30 default=C:\ [operating systems] multi(0)disk(0)rdisk(1)partition(5)\WINNT="Microsoft Windows 2000 Professional" /fastdetect C:\="Previous Version of MS-DOS" notice the exclusion of any reference to D:\,E:\ or F:\. or whatever other drives you defined. the trick is simple! assuming you sysed them right, just add another line for each Drive as shown with "Previous version of MS-DOS" After your done, it might look like this: [boot loader] timeout=30 default=C:\ [operating systems] multi(0)disk(0)rdisk(1)partition(5)\WINNT="Microsoft Windows 2000 Professional" /fastdetect C:\="MS-DOS 2.0" D:\="MS-DOS 5.0 and Windows" E:\="MS-DOS 6.0 and Windows" F:\="please tell me you get the idea" and that should do it. If you didn't want Windows 2K or XP at this point, you could simply delete the partition it was on and remove the line from boot.ini that references it. Woops. I guess I got a bit verbose there. Guess I wanted to make sure to myself I understood the semantics involved. Also can't be sure it would work, since this is just off the top of my head. (I SWEAR!) |
|
| 8323. |
Solve : Surround a variable with double quotes in a FOR loop ??? |
|
Answer» Hello, |
|
| 8324. |
Solve : Problem with random number batch file? |
|
Answer» Im having problems with a batch file i created to generate a random NUMBER between 2 numbers. |
|
| 8325. |
Solve : Command line for screenshot? |
|
Answer» Is there any way to use command line to capture screen/window on XP and/or VISTA? |
|
| 8326. |
Solve : if not exist bad-command? |
|
Answer» Hi All,
Not sure how crude such a script should be. Any suggestions? Cheers, CameronHomework Hi Dusty, Actually no (but to be that young again!) Task was given to me by the boss, just to interupt my PCI work. When I posted the query; thought sadly that the question might be seen as some FORM of homework. I've not done work with timestamps or filesizes before, hence the question. And I've had my hand out of DOS scripting for a little while now. Any help/direction appreciated. Cheers, CameronHeres a VBScript that will do the job open note, copy and paste the script below, save as something.vbs open command prompt, type: cscript something.vbs filename where the filename is the file you want to check. This needs to include the full path. If you want to check mulitple files, you could create a batch file which calls something.vbs for as many files as you need '----------------------------------------------------- Set objArgs = WScript.Arguments If WScript.Arguments.Count < 1 Then wscript.echo "Usage: cscript scriptname.vbs drive:\path\filename" wscript.quit Else StrFile = wscript.arguments.item(0) End if Dim fsoFile Set fsoFile = CreateObject("Scripting.FileSystemObject") If fsofile.FileExists(StrFile) Then Set objFile = fsoFile.GetFile(StrFile) sName = objFile.Name sCreated = objFile.DateCreated sSize = objFile.Size If sSize > 1024 Then'Check Size Age = DateDiff("d", sCreated, Date())'Get Age difference If Age > 1 Then 'Check date is greater than 1 day wscript.echo objFile.Name wscript.echo objFile.Size wscript.echo objFile.DateCreated End If Else wscript.echo "Not met the criteria" End If End If set objfile = nothing set fsofile = nothing '-----------------------------------------------Many thanks TheManFrom, Spent a few hours stumbling with the old scripting last night - sad when you forget so much of it. Seems that to perform the task purely as a MSDOS/NT script would be a painful challenge. Is VBScripting becoming (or is now) more the MAINSTREAM ? Cheers, CameronYes I think VBS is the way forward for admin tasks. DOS is GREAT but has its limitations which is where I think VBS comes in handy Anyways GLAD I could help.is there a particular program you need to write VBscript? My school has "Object oriented Turing" but I want to write this at home, and the computer I use at home, doesn't have internet. . . can I just use notepad for Visual Basic? is there any ONLINE tutorials? (I forget the strings things. . . eg. var:String var:name var:pass cls LOOP put "what is your username" get name put "what is your password get pass exit when pass = "wood" or pass = name end loop that is Turing (except with a fault in the "Var" block at top. . . I can't seem to get that to work right. . . anyway can you write stuff like this in NOTEPAD?? (on a 10yr old computer?? with no internet. .) Please, these questions are important to me lol. . .VBScript is like a cut down version of visual basic and has the advantage of like dos batch file, you can simply open a text editor like notepad, add your script and instead of .bat, save the file as .vbs. Then to run the program, from the command prompt (Start->Run->cmd) simply type: cscript name.vbs You do no need internet however it would be handy for tutorials to learn from It doesnt matter how old your computer is as long as you have at least windows 95 (I think thats the minimum) As of your example above, in vbs you do not need to declare your variable (although it is best practise to always declare them ) The above in vbs would look somthing like Code: [Select]DO Pass="" pass = InputBox("Please enter your password") Loop Until Pass="wood" or pass="name" |
|
| 8327. |
Solve : Greater than/Less than help? |
|
Answer» This is what i want my batch to do: |
|
| 8328. |
Solve : For users on MS Windows Vista Ultimate 32 ENGLISH? |
|
Answer» HELLO, To apply settings from: http://www.blackviper.com/WinVista/servicecfg.htm using a .BAT file, I need the output from this script, to get the match SERVICE_NAME <-> DISPLAY_NAME(English): Code: [Select]SET z=.\%~n0.LOG TYPE NUL>"%z%" FOR /f "Tokens=1,2 Delims=:" %%r IN ('"SC QUERY state= all"') DO ( IF /i "%%r"=="SERVICE_NAME" (ECHO.%%s) IF /i "%%r"=="DISPLAY_NAME" (ECHO.%%s&ECHO.----------------------------------) )>>"%z%" For users on MS Windows Vista Ultimate 32 ENGLISH, please, could you post in this THREAD the output of this scrip? Thanks in advance I'm on a MS Vista Ultimate French, (so Service Display NAME are French). |
|
| 8329. |
Solve : Manager of Windows service's START_TYPE setting? |
|
Answer» Special thanks to all of you helping me to solve some problems while I was building this script. |
|
| 8330. |
Solve : Folder Copying Complex Batch File? |
|
Answer» Hi, this is my first post on this site! |
|
| 8331. |
Solve : back up with batch? |
|
Answer» Hi, I am making a program that I hope will back up some of my important document. I decided to USE batch but I am having a problem. The program that is meant to back up everything from my documents on will only take the FILES within my documents and not any of the folders within it. This is the program that I used: and comments or reasons why this is happening would help.. |
|
| 8332. |
Solve : Pins? |
|
Answer» What is the command for knowing the pin of the PERSON we are CHATTING to in windows XP?There isn't ONE... |
|
| 8333. |
Solve : using batch file.? |
|
Answer» what is script to EXECUTE a PROGRAM AUTOMATICALLY at every certain time LET say 5 minute.Script - Use the AT command or the SCHTASKS command. |
|
| 8334. |
Solve : Startup problem screen? |
|
Answer» This screen continues to pop up when I attempt to turn on my computer (I am using a different computer right now): "A problem has been detected and windows has been shut down to prevent damage to your computer..........Technical info: 0x000000F4 (0x00000003, 0x829A4290, 0x829A4404, 0x805D13B6) Please help!It looks like some hardware is failing. Most likely RAM, or hard drive. They also asked if I had the original operating system cd, which makes me think that if somebody on here could give me a simple answer, it would save me 40 bucks. Also, does anyone know how to use the cd if I am unable to get to windows, and will I lose any data?It depends what CD you have. If you have Windows XP CD, you can try Repair option, and you won't loose your data. If you have Recovery CD, you'll loose your data.I just tried a cd (operating system, "only use this dvd to reinstall the operating system on a dell pc) nothing happened, so i left the cd in and turned the computer off then on, now i am getting a different error message....KERNEL_DATA_IMPAGE_ERROR.... ..with a different stop code of : 0x0000007AYour latest error brings US to the very same diagnosis: bad RAM, or HD. ...and I think, Dell was wrong.i agree, just researched and tried rebooting in safe mode with prompt, then tried chkdsk/f/r but it tells me that the volume is in use by another process....any suggestions, places to take it that are CHEAP, or is it f'd???Try those two tools, I listed. |
|
| 8335. |
Solve : getting the no.of files and file name from a folder? |
|
Answer» HI All, Am new to this forum and also new to DOS(not having more idea) Here i have written a batch file to add header, root tag to the generated file and converting .csv into .xml and moving it to another folder here is the code : more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/header.xml > C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/root.xml >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data1/employee.csv >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/closeRoot.xml >> C:/gsk it's working fine, but in that i have hard coded the input and output file names like input file employee.csv and output file employee.xml instead of hard coding the those file names i would like to get dynamically, and also let me know how to take the count of messages in folder Thanks in Advance Note sure I fully understand the question But here goes.... To output a list of all files in a folder to output.txt dir /b c:\ | find "" /n /v >output.txt To output a list of all files in a folder and all sub folders to output.txt dir /b /s c:\ | find "" /n /v >output.txt To make this more dynamic and not hard code it, instead of for EXAMPLE employee.csv, you can use %1 If you for example saved this as xml.bat then running this batch file in the command prompt with the parameter employee.csv will replace %1 with employee.csv i.e xml.bat employee.csv if you use a second parameter, this would be %2 in the batch file You could then create another batch file which calls xml.bat with all its parameters. If you need to change the files, you would only need to change this batch file. Hope that helpsall i know is that to convert a file into another file copy the code below: rename *.csv *.xml The above will completely change your .csv into a .xml but the only thing you MUST remember is that you must have this program in the same folder you wish to change those certain files to the other file type. You can add the move .xml to another folder thing in when ever you want. Do not replace the '*' with anything else just leave it how it is. Tan_ZaHi Tan_Za This requirement is not that much easy as you said please go through my post again Hi TheManFrom, Thanks a lot for your reply, but here my problem is one application is keep on generating the files with the date_time stamp, i cannot pass the file name as an argument, because the files always generates id different timestamp and also i need to add the header, open root tag, close root tag to the each and every file please help me on this, because totally am new to dos(am not having more commanding on dos) Thanks in Adavance, Your Help is Appreciated Save the following in c:\xml.bat REM-------------------------------------- more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/header.xml >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/root.xml >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data1/%1 >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/closeRoot.xml >> C:/gsk REM-------------------------------------- Open notepad, copy and paste the script below and change the first line to point to your folder, then save as c:\xml.vbs '------------------------------------------ CONST StrFolder = "C:\temp" CONST StrBatch = "C:\xml.bat" Set fsoFolder = CreateObject("Scripting.FileSystemObject") Set folder = fsoFolder.GetFolder(StrFolder) Set files = folder.Files for each objFile in files set shell=createobject("wscript.shell") Shell.Run StrBatch & " " & objFile.Name, 0, True set shell=nothing next set files = nothing set folder = nothing set fsoFolder = nothing '------------------------------------------ open command prompt and type cscript xml.vbs This will now run the vbs script which will go and find all files in the folder you specified. It will then pass the name of the file to xml.bat, which will add the header, root etc and output as employee.xml Note, this will keep writing to the same employee.xml file - you will need to amend the batch file to change this. You can change employee.xml to "%1.xml" to have the name of file read .xml Hope thats what you neededNOTE: to list the files(s) in a directory (folder) simply type: DIR [path[dir]]? I do this all the time, to display files in a folder, when i boot my comp in DOS-Mode. I have no idfea what all the extra code is for, but can't u simply type: DIR [path] rename [path][filename]??The original code has a CSV file processed by the more utility and producing a XML file. This is not gonna happen. Oh, it will run OK, but you'll still have a CSV file (just with a new and misleading name). Code: [Select]more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/header.xml > C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/root.xml >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data1/employee.csv >> C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/data/employee.xml more < C:/gskgaa_v3/gskgaa/common/UTC_6.8.6/Receiver1/post-processor/closeRoot.xml >> C:/gsk Processing files thru the more utility does not change the organization of a file. NEITHER does copy, move or rename. A file extension acts much like the title of a book...it indicates what to expect when it's opened. Windows uses the file extension to call the proper application that can process each file type. Simply calling a CSV file a XML file does not make it so. Quote let me know how to take the count of messages in folder Down and dirty this snippet should work: Code: [Select]for /f %x in ('dir ^| find /i "file(s)"') do echo %x Use the above code at the command prompt. To use in a batch file, double up the percent symbols. |
|
| 8336. |
Solve : connecting/disconnecting local internet connection from .bat? |
|
Answer» Hi, new poster. nice place you have here . |
|
| 8337. |
Solve : saving comand prompt text to file? |
|
Answer» I have a batch file that TELLS me specific information about a program at a specific time. I was wondering if there is a way to save all the information shown in the comand prompt window to a text file using a command in that batch file.Quote from: brollins90 on December 11, 2007, 03:33:16 PM I have a batch file that tells me specific information about a program at a specific time. I was wondering if there is a way to save all the information shown in the comand prompt window to a text file using a command in that batch file. It depends. What's in your batch file? Redirection comes to mind. For example, if you have a batch file that causes some text to be printed to screen, you could redirect the output to a file instead. batch.bat on the command line executed writes to screen. batch.bat > filename.txt on the command line writes to filename.txt One redirection symbol will create the named text file if it does not exist, and if it exists it will overwrite it. Two redirection symbols will create the named text file if it does not exist, and if it does, it will append to it. As in batch.bat >> filename.txt brollins90 : I see that was your FIRST post here. Welcome to Computer HOPE. That works, thanks alot.Quote from: brollins90 on December 11, 2007, 05:05:53 PM That works, thanks alot. Good to know that did it. You're welcome, a lot. Stop in any time. |
|
| 8338. |
Solve : batch file to download pic's from digital camera to external harddrive? |
|
Answer» I am having problems devising a batch FILE to download pictures from my digital camera to my eternal harddrive. I can see with the echo on that it is pulling in the pictures but I cannot get them to go the temp file I created on my harddrive. My operating system is WINDOWS XP. My camera is a Sony. My camera is connected va USB as is my external harddrive. |
|
| 8339. |
Solve : Xcopy file operation order? |
|
Answer» HI, all: May be a totally EASY question, but I did look around a while for the answer and didn't happen upon it. When you are Xcopy-ing a large collection of files from a set of directories on ONE drive to another, what order are they copied in? Doesn't SEEM to be alphabetical or time-of-creation or anything else I can deduce. Thanks~~~Welcome to the CH forums. What is your Operating System? The specific instance was CMD in WinXP SP2, but I guess I would be CURIOUS if the order was in fact different from one version of XCOPY to the next as well. Thanks for the welcome! JG |
|
| 8340. |
Solve : DOS command problem for Noob? |
|
Answer» Hi all: Microsoft filenames Type the command exactly as it is SHOWN and post back with any displayed error message. |
|
| 8341. |
Solve : Executable command line output into variable? |
|
Answer» Hi. |
|
| 8342. |
Solve : All information from start and shutdown of computer? |
|
Answer» is there any command to view the details that we did from starting the computer to shutting down computer.. |
|
| 8343. |
Solve : how to go the c:\?? |
|
Answer» in my DOS PROMPT have this c:\ documents and settings \ users> |
|
| 8344. |
Solve : Printing in batch file? |
|
Answer» I am using windows xp pro sp2. |
|
| 8345. |
Solve : netsend..? |
|
Answer» i know this might sound stupid |
|
| 8346. |
Solve : Parsing the output of net view? |
|
Answer» Hey again. I'm WONDERING if there's any way to parse the output of net VIEW, so that there is no remark, only the computer name? I can get past the header and footer by skipping them in my search, but it's the remark that is really killing me here (I'm trying to search each line for the computer name, and then search that computer). |
|
| 8347. |
Solve : Debugging - FOR loop? |
|
Answer» cd \ setlocal enableextensions enabledelayedexpansion net view > list.txt set /a LNE=0 :find set /a LNE=%LNE%+1 for /f "skip=%LNE%" %%m in ('findstr . list.txt') do ( goto find ) set /a SKP=3 :begin if %SKP% GTR %LNE%-1 goto end :first for /f "skip=%SKP%" %%i in ('findstr . list.txt') do ( set PC=%%i if exist %PC%\multimedia goto go goto reset :go DIR %PC%\multimedia /s > find.txt findstr drvmgt.dll %cd%\find.txt >nul && echo %PC% >> pos.txt :reset set /a SKP=%SKP%+1 goto begin ) :end Here is an excerpt of my code (i.e. just CUT out the parts I need), that so far is meant to: 1. Send the output of net view to a text file 2. Check how many lines are in the test file 3a. Search for the multimedia folder on the remote computer 3b. Then send the directory of it to a text file 3c. Then search for a particular file, and if found, send the PC name to another text file However, just searching through my network of computers, there is no multimedia folder in there, so that eliminates some of the steps. However, my for loop is causing me some problems. The for itself isn't the problem, but I can't seem to isolate the exact cause of the unexpected error (from what I can read in a millisecond: . was unexpected at the time.) Anyway, any help would be appreciated. Thanks. I think we already had this conversation. The run log of your code looks like this: Code: [Select]D:\>setlocal enableextensions enabledelayedexpansion D:\>net view 1>list.txt D:\>set /a LNE=0 D:\>set /a LNE=0+1 D:\>for /F "skip=1" %m in ('findstr . list.txt') do (goto find ) D:\>(goto find ) D:\>set /a LNE=1+1 D:\>for /F "skip=2" %m in ('findstr . list.txt') do (goto find ) D:\>(goto find ) D:\>set /a LNE=2+1 D:\>for /F "skip=3" %m in ('findstr . list.txt') do (goto find ) D:\>(goto find ) D:\>set /a LNE=3+1 D:\>for /F "skip=4" %m in ('findstr . list.txt') do (goto find ) D:\>set /a SKP=3 D:\>if 3 GTR 4-1 goto end D:\>for /F "skip=3" %i in ('findstr . list.txt') do ( Set PC=%i if exist \multimedia goto go goto reset dir \multimedia /s 1>find.txt findstr drvmgt.dll D:\\find.txt 1>nul && echo 1>>pos.txt set /a SKP=3+1 goto begin ) D:\>( set PC=The if exist \multimedia goto go goto reset dir \multimedia /s 1>find.txt findstr drvmgt.dll D:\\find.txt 1>nul && echo 1>>pos.txt set /a SKP=3+1 goto begin ) D:\>set /a SKP=3+1 D:\>goto begin D:\>if 4 GTR 4-1 goto end D:\>for /F "skip=4" %i in ('findstr . list.txt') do ( set PC=%i if exist The\multimedia goto go goto reset dir The\multimedia /s 1>find.txt findstr drvmgt.dll D:\\find.txt 1>nul && echo The 1>>pos.txt set /a SKP=4+1 goto begin ) Doesn't seem to be a syntax error. I think it would be easier if you only processed the net view lines that CONTAIN any relevant data instead of hunting for dots and skipping headers. This little snippet should do just that: Code: [Select]for /f "tokens=1-2 delims=\ " %%x in ('net view ^| find "\\"') do (.... I'll leave it to you to fill in the do logic. Note: %%x contains the computer name (without the backslashes; if you want the backslashes, REMOVE the entire delims clause); keep in mind that one of the computers in the net view list is yours. PS. Pretty sure that if %SKP% GTR %LNE%-1 goto end does a string comparison and in any CASE if statments do not do arithmetic.For some reason, there is still the same error as last time. This is really annoying me now... there seems to be no apparent cause... I even tried removing one line at a time to see what was causing the fault, but to no avail... However, in the meantime I managed to make the rest of my code bug-free! But, although it was quite helpful, that's not much of a substitute. Anyway, I'll get back to work on the for loop again, and see if I can't get this thing to work... Thanks for your help --Dark Blade EDIT: But wait! It works now!!! I just replaced the PC variable with %%i (they are the same, after all), and then it worked! I always thought that creating a new variable was unnecessary.... My batch file is working perfectly now. That said, I haven't actually had a proper test run on any computers with \multimedia (my school has them, though). But I'm optimistic. Thanks again |
|
| 8348. |
Solve : Self renaming bat file? |
|
Answer» here's the code: |
|
| 8349. |
Solve : Rename help? |
|
Answer» I have a problem--- |
|
| 8350. |
Solve : displaying folder name? |
|
Answer» HI - I NEED to find out the folder name of the folder I am in and its parent and save them to a variable. I then need to use the names as aprt of the parameter for stating a program. The structure is like ClientName System Code: [Select]ECHO.%~dpnx0 FOR %%a in ("%CD%") DO SET CurrentFolder=%%~na ECHO.Current folder: %CurrentFolder% CD .. FOR %%a in ("%CD%") DO SET ParentFolder=%%~na ECHO.Parent folder: %ParentFolder% Pause &EXIT Result of this script: Code: [Select]C:\Documents and Settings\users\Bureau\ess.CMd Current folder: Bureau Parent folder: users Appuyez sur une touche pour continuer... |
|