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.
| 2651. |
Solve : windows 95 trouble? |
|
Answer» ???could SOME1 please help... my mums comp keeps showing the message " 1/0 error accessing boot SECTOR file multi(0)rdisk(0)partition(1)\BOOTSECT.DOS " when windows 95 tries to load , ive tried alot of things but nothing seems to work.It seems you have a DUAL Boot System with Windows NT/2000/XP and Windows 95. |
|
| 2652. |
Solve : QChecker and dos? |
|
Answer» Hello, |
|
| 2653. |
Solve : Mike.log? |
|
Answer» Hi, can anyone tell me how to make a log of the actions of a batch FILE please? |
|
| 2654. |
Solve : adding a network printer in dos? |
|
Answer» I wonder if any one can tell me a way of installing a networked printer through DOS |
|
| 2655. |
Solve : Autoexec help!? |
|
Answer» I need to launch a program automatically on bootup. I know I need to edit my autoexec.bat FILE, in wich I have but cannot seem to get the commands right to get my program to launch properly. These are the commands I use once the c: prompt appears. |
|
| 2656. |
Solve : trying to install games and get autoexec error? |
|
Answer» I have TRIED to download several games, and one which is brand new, never installed, and there are some conflicting things going on that will not let it install on my computer. The message C:\WINDOWS\SYSTEM32\AUTOEXEC.NT. The system file is not suitable for running MS-DOS and Microsoft Windows applications. Choose 'Close' to terminate the application., appears everytime. If you click on close or ignore, it closes the installation and won't let you install the game! Is this the forum to help me or do I need to try someone else? Please help me!!This seems to be an increasingly frequent problem. It would be interesting to KNOW the cause. |
|
| 2657. |
Solve : How to run multiple batch files from single batch? |
|
Answer» hi all, |
|
| 2658. |
Solve : bat2exe.com? |
|
Answer» I have a .BAT file that has been running great. However someone got into it and altered the code and it now crashes. I fixed the code and ran it through the bat2exe.com download that I found on this site. The problem is, the .bat file works fine but when it is converted to the .com format and ran, I get "Bad Command or File name" for each line of code. I would appreciate any insight. Without knowing what was in your batch file it's impossible to give an answer. Bat2exe is an old PROGRAM (1990) and batch files have CHANGED greatly since then. I did find that bat2exe only handles files in 8.3 format, can't handle FOR statements and is iffy with IF statements. |
|
| 2659. |
Solve : MS DOS -- AT COMMAND? |
|
Answer» Dear List, |
|
| 2660. |
Solve : Access path and Variable? |
|
Answer» To the beginning of each ONE of my scripts, I would like to return in variables such as %a, %b... the access paths which I use in my script in order to facilitate the possible moving of my script. |
|
| 2661. |
Solve : Set Question? |
|
Answer» Hey, |
|
| 2662. |
Solve : date in dos bat file? |
|
Answer» Can someone help me create a dos bat file that will copy files that have todays date and yesterdays date as part of the file name? The dates should NOT be hard coded into the bat file. I will schedule the bat file to run AUTOMATICALLY each night. |
|
| 2663. |
Solve : how to launch a .SCR file with a batch file in XP? |
|
Answer» I am TRYING to launch a screensaver on an XP machine and I KEEP GETTING the setup insteed of RUNNING. Any SUGGESTIONS? |
|
| 2664. |
Solve : Searching for most recent files? |
|
Answer» Hi |
|
| 2665. |
Solve : format computer? |
|
Answer» i want to format my com but when i go to ms-dos command prompt i get a message saying c:\folders documentes alex. when i try to format from here it will not format ive tried to format from "my com." im running xp.You cannot format from within the OS. Boot to the XP CD and begin the installation process. You'll be offered an option to format from there.hi,ive tried formatting from xp disc but i dont get any options,,it goes direct to "setup xp"it just reinstall xp...kind regards theted Is it an original XP CD full version? If so, you should be given the option to delete/create partitions and format before the installation actually begins. Are you BOOTING to the XP CD?hi allan,no it isnt a xp copy,it just goes straight to xp install..is there any other way to format my c drive..any help would be appreciated...One more time. Are you BOOTING to the cd or are you trying to start the format from within Windows?hi allan,how do i" boot to xp cd"..do i have to go into safe mode...what i did was insert xp disc into SLOT and reboot computer,but as i said there is no options..i must be doing something wrong..theted Go into the bios and set the cd as the FIRST boot device in the boot order section. Then reboot to the cd.i think my brov will have to TAKE a wee trip down to his local pc repair shop...thank for all your help allan...theted You don't need to PAY anyone, just FOLLOW the instructions. Go into the bios and make sure the cd drive is at the top of the boot order. Then insert the XP CD in the drive and reboot. It's that simple. What part are you having trouble with?hi,i'll get my brother to get in touch with u...thanks ...theted |
|
| 2666. |
Solve : Need Advice with this Backup Script? |
|
Answer» Below is an Outlook backup script I have compiled through much searching and trial and error. This script will close Outlook on a networked client computer where the user is still logged on; then backup his/her Outlook .pst files to a shared user folder on a Win 2003 server. After the backup is done the script will RESTART Outlook minimized to the system tray. Some users Outlook needs to be restarted so a third party "Out of Office" application can run. |
|
| 2667. |
Solve : how to do stringtokenizer in batch file (DOS Command)? |
|
Answer» how to do stringtokenizer in batch file (DOS Command) |
|
| 2668. |
Solve : Need help Writing Batch File Code.? |
Answer» OKAY I made a Batch File saving notepad with .bat. So can someone show me what the code needs to be to Copy and Zip files older then 2 days and move the Zip to ANOTHER folder?QuoteOkay I made a Batch File saving notepad with .bat You stand a better chance of getting help if you show US your code. It gives us a better UNDERSTANDING of where you're going with the code. Double Post. Topic Closed. See your other Post for replies... |
|
| 2669. |
Solve : Deleting Directory Dynamically? |
Answer»
I need help on deleting directories; I have a particular ETL session, which will load data for each country from a particular folder called "TempData" This folder, CONTAINS ABCxxxxx_CNTRY_DDMMYYYY, where
I've tried using the following, RMDIR /s /q X:\TempData\*_JP_* DEL X:\TempData\ABC?????_JP_* BUT both don't work. any help would be highly appreciated. Thanks. Try using ROBOCOPY http://en.wikipedia.org/wiki/Robocopy It can HANDLE sub folders |
|
| 2670. |
Solve : How to judge whether the specified directory or file exists or not?? |
|
Answer» Hi All: IF EXIST FILENAME. echo found filename.Hello, if exist C:\Test\nul echo It is there will make an output "It is there" when the directory is present. if not exits C:\Test\nul echo Dir not found will make an output "Dir not found" when the directory ist not present. Instead of "nul" you can use filenames, too. Ciao. Brain |
|
| 2671. |
Solve : How to use the "find" command with extended ASCII characters ?? |
|
Answer» Hi everyone, |
|
| 2672. |
Solve : How do I create a batch file to delete log files older than 2 weeks????? |
|
Answer» Can anyone help me create a batch file that will delete log files in a certain directory that are older than 2 WEEKS? Can anyone help me create a batch file You said: Quote from: BatchFileBasics on July 22, 2009, 11:13:34 AM we are here to help people make stuff. Isn't that what hefe asked for?Quote from: manadude2 on July 22, 2009, 11:32:10 AM BatchFileBasics: but where is his progress so far?Quote from: manadude2 link=topic=88144.msg591102#msg591102 Isn't that what hefe asked for? [/quote you can ASK for help, but sometimes people want to see effort before helping.Have a nice day. Have a nice day. Hi guys, it's not a batch file, but I've found a program that will delete files in a specific FOLDER that are older than the specified time. It's called Cyber-D's Autodelete 2.15 and can be downloaded from here, here or here.I've seen this question (or one like it) a zillion times on this and other DOS sites, but never a pure DOS solution... thought it was about time I contributed. It looks a lot more complicated than it really is, but any comments or suggestions are welcome. First the basics: Code: [Select]@ECHO OFF CLS VERIFY OTHER 2>NUL SETLOCAL ENABLEEXTENSIONS IF ERRORLEVEL 1 ( ECHO Cannot enable Command Extensions GOTO EndError ) VERIFY OTHER 2>NUL SETLOCAL ENABLEDELAYEDEXPANSION IF ERRORLEVEL 1 ( ECHO Cannot enable Delayed Environment Variable Expansion GOTO EndError ) Which directory, and how many days of stuff do you want to keep? These are the only two variables you need to set. Code: [Select]SET RetentionDays=14 SET TargetDirectory=C:\Temp Obviously, you could change this variable usage to input parameters instead, to make this script more flexible. Also, consider a third argument for the filename.extension mask you want to keep/move/delete/whatever with this script. In this example, I am including ALL files. Next, set a group of date variables to today: Code: [Select]FOR /F "tokens=2-4 delims=/ " %%d IN ('ECHO %DATE%') DO ( SET dMonth=%%d SET DDAY=%%e SET dYear=%%f ) The XCOPY command we are eventually going to use requires the format mm-dd-yyyy. Set the "Retention Date" and start with today: Code: [Select]SET RetentionDate=%dMonth%-%dDay%-%dYear% Main DATE logic -- see internal REMarks: Code: [Select]IF %RetentionDays% GTR 0 ( REM -------------------------------------- REM Set the working date, start with today REM -------------------------------------- SET fooMonth=%dMonth% SET fooDay=%dDay% SET fooYear=%dYear% REM ----------------------------------------------------------------- REM Loop N times, where N=%RetentionDays%, REM and subtract one from the Working Date. REM REM The called PreviousDay.cmd script is attached as a TXT file. I REM adapted it from another script I found somewhere on the REM interwebs. Credit to the original author, whoever s/he is. REM REM PreviousDay takes one input argument in the format mm dd yyyy REM and echoes the previous day in the same format REM ----------------------------------------------------------------- FOR /L %%l IN (1,1,%RetentionDays%) DO ( FOR /F "tokens=1-3" %%p IN ('CALL %COMSPEC% /E:ON /V:ON /C PreviousDay.cmd !fooMonth! !fooDay! !fooYear!') DO ( SET fooMonth=%%p SET fooDay=%%q SET fooYear=%%r ) ) REM --------------------------------------------------------------- REM Now set the Retention Date to the Working Date we've calculated REM --------------------------------------------------------------- SET RetentionDate=!fooMonth!-!fooDay!-!fooYear! ) Main CLEANUP Logic -- see internal REMarks: Code: [Select]REM ----------------------------------------------------- REM First, build a List of ALL files in %TargetDirectory% REM ----------------------------------------------------- FOR /F "tokens=1 delims=|" %%b IN ('DIR /B %TargetDirectory%') DO ( REM optionally use FOR /F "tokens=1 delims=|" %%b IN ('DIR /B %TargetDirectory%\*.foo') DO ( REM ------------------------------- REM Store each filename in the list REM ------------------------------- SET ThisFileName=%%b SET ThisFile=%TargetDirectory%\!ThisFileName! SET DeleteThisFile=TRUE REM ---------------------------------------------------------------------- REM Next, build a list of files where datestamp >= (TODAY - RetentionDays) REM ---------------------------------------------------------------------- FOR /F "tokens=*" %%k IN ('XCOPY %TargetDirectory%\*.* %TEMP% /L /D:!RetentionDate!') DO ( SET KeepFile=%%k REM -------------------------------------------------- REM Exclude the "n File(s)" echo by testing with EXIST REM -------------------------------------------------- IF EXIST !ThisFile! ( REM -------------------------------------------------------- REM If ThisFile = KeepFile then KeepFile will NOT be deleted REM -------------------------------------------------------- IF /I "!ThisFile!"=="!KeepFile!" ( SET DeleteThisFile=FALSE ) ) ) REM --------------------------------------------------------------------------------------- REM Finally, test KeepThisFile and DELETE ThisFile if it was not found in the KeepFile list REM --------------------------------------------------------------------------------------- IF /I !DeleteThisFile!==TRUE ( ECHO DELETING !ThisFile! DEL /F /Q !ThisFile! > NUL ) ) That's it! Please note that this example deletes all files older than 14 days. In other words, it will keep all files date-stamped within 14 days, inclusive. Example: Today is 07/25/2009. That date minus 14 = 07/11/2009. Any files date-stamped 07/11/2009 (or 07/12, or 07/13, etc.) are not touched. Any files date-stamped 07/10 (or 07/09, or 07/08, etc.) are deleted. Also, this does NOT perform \Folder\ deletion, and I haven't gone out of my way to handle path\filenames with embedded spaces, but it won't take much to incorporate either of those features. Hope it helps! [attachment deleted by admin]excellent solution, if I say so myself! Thanks! Every line makes me like my sig more n more. Quote from: hefe on July 22, 2009, 09:08:38 AM Can anyone help me create a batch file that will delete log files in a certain directory that are older than 2 weeks?you can see here (Example 2) for an example using vbscriptSee also http://home.mnet-online.de/horst.muc/wbat32.htm DelAge32 deletes or moves files with a mimimum age given by the number of days, © 2003-2008, Horst SchaefferQuote from: gh0std0g74 on July 25, 2009, 10:48:20 PM you can see here (Example 2) for an example using vbscript Ghost, The Batch solution is much better and they are on the right Board.Quote from: billrich on October 22, 2009, 11:51:16 AM date manipulation is always not better using cmd unless you have tools like GNU date , or GNU find or even vbscript , period. GNU find, just one line does the job Code: [Select]c:\test> gnu_find.exe c:\path -type f -mtime +14 -delete # delete files older than 14 days vbscript does date OPERATION better than batch (cmd)...period. Code: [Select]Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("C:\temp") For Each efile in objFolder.Files If DateDiff("d",eFile.DateLastModified,Now) >= 30 Then WScript.Echo "file found that is 1 month old: " & efile WScript.Echo eFile.DateLastModified objFSO.DeleteFile(eFile) End If Next in the real world, one do not have to waste time doing unnecessary things when there are tools already there to help make one's job easier. Lastly, why do you reply after 3 months...? You are so bored because nobody is nitpicking with you? |
|
| 2673. |
Solve : batch file with ASCII art? |
|
Answer» Hi guys, echo _ You are using the 'pipe' so the Command Interpreter expects a valid command after it but finds __ instead. This is invalid so the script fails the first TIME the 'pipe' is used. To correct this Escape the pipes. & Welcome to the CH forums..Quote You are using the 'pipe' so the Command Interpreter expects a valid command after it but finds __ instead. This is invalid so the script fails the first time the 'pipe' is used. Aah, and I've already been AFRAID of that stuff. Quote To correct this Escape the pipes. I had to prefix them with carets?! I did that for all pipes but failed again. What are all relevant special characters and symbols in this regard? Quote & Welcome to the CH forums.. Thanks. :-) Thank you.I Escaped the pipes using the caret and the script ran without problem. echo ^|__ echo ^|/_/ echo ^| echo ^| ... I failed. But after prefixing also '<', '>' and '_' it ran! :-) Maybe there is a whole bunch of special characters needing a such special treating?! Thanks so far! There's a list here.. Quote from: Dusty on October 23, 2009, 01:18:34 AM There's a list here.. Thank you! Quoting from there: When piping or redirecting any of these charcters you should prefix with the escape character: \ & | > < ^ e.g. ^\ ^& ^| ^> ^< ^^ end of quoting As you can see this shouldn't be a _complete_ list because I had to prefix ' _ ' in my batch, too?! No. the underscore has no special meaning to the command interpreter and therefore does not require escapement.Quote from: BC_Programmer on October 23, 2009, 10:31:29 AM No. the underscore has no special meaning to the command interpreter and therefore does not require escapement. Well, that may be or not. In fact I had to prefix even all underline characters (not 'underscore') in order to get my batch running. But maybe there is a 'hidden truth'? That's why here again what I did for another example: echo ^_^_ ^_^_ echo .' `...' `. echo ^_^_^| ^| ^|^_^_ echo .' \ . / `. echo ^| ./###\. ^| echo ^>---- ^|#####^| ----^< echo ^| `\###/' ^| echo `.^_^_ / . \ ^_^_.' echo /^| ^| ^| echo / `.^_^_^_.^.^_^_^_.' echo ^| echo ^| echo \ echo \ )\ echo `. /' ^| echo \ /' ) echo \ /' /' echo \ /' /' echo \( /' echo ) /' echo ^| /' echo ^|( echo ^|^| Thank you. Belka - your script works perfectly without the underline (underscore) characters being escaped. Try this, works for me, tested on Win2k, Win2k.Pro, Win XP.HE and Win XP Pro. Code: [Select]@echo off cls echo __ __ echo .' `...' `. echo __^| ^| ^|__ echo .' \ . / `. echo ^| ./###\. ^| echo ^>---- ^|#####^| ----^< echo ^| `\###/' ^| echo `.__ / . \ __.' echo /^| ^| ^| echo / `.___..___.' echo ^| echo ^| echo \ echo \ )\ echo `. /' ^| echo \ /' ) echo \ /' /' echo \ /' /' echo \( /' echo ) /' echo ^| /' echo ^|( echo ^|^| Although when you do escape them, it has a bunch of anime smiley's... Quote from: Dusty on October 23, 2009, 03:07:55 PM Belka - your script works perfectly without the underline (underscore) characters being escaped. I admit you're right. I checked it renewed. Ago I got a failing, no idea what happened. Okay, in this way we both learned something new. Thank you for reliable supporting. |
|
| 2674. |
Solve : Did you know?? |
|
Answer» Did you know that WSH or wsh is an alias for the wscript object in VBScript? So that e.g. wsh.echo works just like wscript.echo does, and WSH.Echo WSH.FullName, WSH.Version works just like wscript.Echo wscript.FullName, wscript.VersionI have been aware of this, but my VBScript editor (VBSEdit) does not OFFER to help with intellisense unless I spell out WScript. SOMETIMES readability OUTWEIGHS KISS. |
|
| 2675. |
Solve : Issues with batch file reading input.txt? |
|
Answer» Hello everyone. I can tell you now that I'm a complete NEWB to this. the read-raw.exe works perfectly when it's fed in the row #'s individuallywoops, didn't get that part in your first post, sorry. So my "fix" wouldn't be related. Quote I'm stumped I just checked and I can't get the code for the .exe anyway. Anyone else have other ideas?Quote from: Salmon Trout on October 20, 2009, 01:41:34 PM need to know what is the 4th character of row 999. |
|
| 2676. |
Solve : Creating a Batch File...? |
|
Answer» I am in a Computer Networking Systems course. Our teacher wants us to create a Batch file that takes files from one folder that are older then 2 days and zips them and moves them to another folder. How do I create the batch file that does this?does your teacher ask you to do things that he or she hasn't taught yet? If yes, you should ask your teacher how its done. If not, show us what you have so far I don't have anything so far. I just know how to create the file by making it .bat I don't know how to get it to perform the commands he wants.Quote from: ItalianOnEdge on October 22, 2009, 11:34:28 PM I just know how to create the file by making it .bat I don't know how to get it to perform the commands he wants.so where is that .bat file since you say you know how to create it. does it have any commands in it ? or is it a blank .bat file?? you can go to here for some dos tips...or here on a side note, seriously if you aren't learning anything out from your teacher, you might as well stay at home and learn from internet. by the WAY, you are not SUPPOSED to post homework questions here ... (without putting in effort) Actually I have put effort. I just cant get it to perform the commands. I been checking on sites to get a general idea on how to write the command script. But what I getting if a million different ways and i know how to get them to work the way I want them to. I just saved the .bat file to the desktopQuote from: ItalianOnEdge on October 22, 2009, 11:51:18 PM Actually I have put effort.and where is it? post it here so that the so called "batch gurus" can GUIDE you alongListen I am modifying this cause I over reacted. Dude if I knew what I was doing I wouldn't be asking here. I tried to make it and it didn't work. Not even close, so I deleted it. So if you are gonna insult me by questioning my being lazy or not then just don't respond.Quote from: ItalianOnEdge on October 23, 2009, 12:13:24 AM Dude if I knew what I was doing I wouldn't be asking here.if you don't know anything, ask the teacher again. or revise your notes. If the teacher had asked you to do things that he hasn't teach, then ask for his advice on how to go about doing it.. Quote I tried to make it and it didn't work. Not even close, so I deleted it.if you really put in effort and it didn't work, you should post it and let others take a look and POINT you to right direction. However, you have not done that. It leads me to deduce that what you say about putting in effort is bull. Quote So if you are gonna insult me by questioning my being lazy or not then just don't respond.At least i did not specifically call you a lazy bum in my posts. all i did was ask you to show what you have. It is hard to believe that you attend a course, and learn nothing at all from it. Another hint for you, you can search this forum on "DELETING file more than X number of days". There are similar posts which you can learn how to do it from . |
|
| 2677. |
Solve : GUI for copying file names to text file? |
|
Answer» This was asked on Facebook and I'm not FAMILIAR with any GUI, so CURIOUS if anyone else has ideas. |
|
| 2678. |
Solve : calling .bat from another .bat fails with invalid login. why?? |
|
Answer» Hi all, |
|
| 2679. |
Solve : Runas error 267?? |
|
Answer» I'm attempting to run explorer as a different user, however when I run the batch, I get error 267, invalid DIRECTORY. The directory I specified is C:/WINDOWS/explorer.exe |
|
| 2680. |
Solve : Create batch file that deny access to certain websites? |
|
Answer» Hi everyone, I'm trying to create a batch file that stop the end user surfing some specific website such as adult website. I heard that we have to find the ip ADDRESS of that website and copy it to the batch file with some commands but I don't know how to do that. I'm new to MS-DOS. If you have any good resources that can help, it would be great. I don't mind reading. khuynh, you want to find out the ip addresses of adult websites? hmmm..... Thank you Salmon Trout on how to block access to Porn sites. If I understand your instructions: We don't need the IP address of the porn site. URL ( the site address ) is what is blocked. A grandson or son can easily reverse the Block. The Porn sites are out of control and a better screen is needed. Thanks again Salmon Trout for your professional advise.So what is your suggestion? To block an ip address requires additional software such as a firewall. Quote from: The OP I'm trying to create a batch file that stop the end user surfing some specific website such as adult website. Add the url that you wish to block to HOSTS then make HOSTS readonly and hidden, finally deny admin provileges to the relevant users. i believe this wiki page has the right information of hosts and blocking sites, as well as other information of hostsThanks everyone. I'll give it a shot... Alright!!!! I did it. Thanks alot everyone. Quote from: khuynh on October 21, 2009, 09:40:40 PM Thanks everyone. I'll give it a shot... How did you block all Porn sites? Can anyone remove your Block? http://www.netdogsoft.com |
|
| 2681. |
Solve : Saving variables for re-use? |
|
Answer» Gudday all |
|
| 2682. |
Solve : Escaping \? |
|
Answer» How does one escape the '\' in a path. *censored* fat fingers. Thank youQuote from: Salmon Trout on October 21, 2009, 01:04:43 AM You don't need to escape a backslash. You just need to use delims with an 's'.I will try those variable modifiers. Thank you. |
|
| 2683. |
Solve : SET CLASSPATH? |
|
Answer» I am trying to set a CLASSPATH variable to compile an application, the script should look for all .jar files in a directory and add the results on a local variable to give that variable to a JAVAC and compile the java classes... javac -target 1.X -classpath D:\old\java2.jarYou could call it MyBigJob.bat and if it does not work right, edit it with Notepad using global replace command. The objective is not to see how concise you can make the job, but how you can do the job right. Is this of any help? But if somebody else has a good answer, that's fine with me. |
|
| 2684. |
Solve : move file from server to server? |
|
Answer» I need a batch file that will copy a file from serverA location to SERVERB location |
|
| 2685. |
Solve : Boot time assistance? |
|
Answer» Hello everyone! |
|
| 2686. |
Solve : start exe by vbs? |
|
Answer» Hi All, Is it posiple to start the.exe file by VBS command? what is the code? and how to disable it? thanksQuote from: tabehsn on October 20, 2009, 07:02:05 AM Hi All, Which .exe file? An .exe file can be a program or a process? You may run .exe file from a batch file when you KNOW the complete path to the .exe file. Or the .exe is INCLUDED in the search path. C:\>path PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Co mmon Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10 .0\DLLShared\;c:\bin C:\>On my XP pro machine there are 2,123 .exe files. C:\>dir /B /S *.exe | wc -l 2123 C:\> C:\WINDOWS\system32>dir /B /P *.exe accwiz.exe actmovie.exe ahui.exe alg.exe append.exe arp.exe asr_fmt.exe asr_ldm.exe asr_pfu.exe at.exe atmadm.exe attrib.exe auditusr.exe autochk.exe autoconv.exe autofmt.exe autolfn.exe blastcln.exe bootcfg.exe bootok.exe bootvrfy.exe cacls.exe calc.exe charmap.exe ChCfg.exe chkdsk.exe chkntfs.exe cidaemon.exe cipher.exe cisvc.exe ckcnv.exe cleanmgr.exe cliconfg.exe clipbrd.exe clipsrv.exe cmd.exe cmdl32.exe cmmon32.exe cmstp.exe comp.exe compact.exe conime.exe control.exe convert.exe Press any key to continue . . . Quote Is it posiple to start the.exe file by VBS command? You can use the Run method of the shell object: Code: [Select]Set WshShell = CreateObject("WScript.Shell") WshShell.Run "c:\windows\system32\programname.exe",,True Note: The True parameter indicates to wait on return. In other words, wait until the program finishes executing before continuing with the NEXT instruction. Quote and how to disable it Not sure you can. It's part of the VBSCRIPT instruction set. Good luck.C:\>type cal.bat @echo off calc.exe REM full path :C:\WINDOWS\system32\calc.exe C:\>cal.bat ______________________ Disable calc.exe by renaming calc.exe or delete calc.exe C:\>ren /? Renames a file or files. RENAME [drive:][path]filename1 filename2. REN [drive:][path]filename1 filename2. Note that you cannot specify a new drive or path for your DESTINATION file. C:\>cd C:\WINDOWS\system32 C:\WINDOWS\system32>ren calc.exe xxcalc.exe Thank you bro billrich and sidewinder |
|
| 2687. |
Solve : Printing MS-DOS to a USB port? |
|
Answer» Hi group, I have 2 tower PC,s windows 95 & XP and I can print with the command dir>prn (LPT1) but they are connected with a parallel LPT1 port. My DOS for Dummies book shows how to get a printer working on a serial port but only mentions USB as an aside comment. How do I get to print straight from my laptop via USB WHILST using MS-DOS. I print out directories. I know I can copy and paste into Wordpad but not a directory with more than 250 entries. HELP !!!!!!! Best wishes Dave Edwardsbut you could CREATE a file with the directory and open and print with word pad..... dir > dir.txt Hi Gary, Didi what you said with my largest directory 12,000 plus and it worked. I had to search for it however. I then changed it to dir>dir.rtf and it opened in wordpad but I had to search again for it. It goes to a long long named folder because thats the folder the command prompt opens in. It's Documents and Settings\Dave Edwards\Desktop\name of file. Is there a way of me getting it to say My Briefcase which I have on the desktop with not much in. Many thanks for your help. Best wishesDon't remember much about the briefcase but you can put it anywhere you want, just specify the path.... dir > c:\dir.rtf dir > c:\desktop\dir.rtf (maybe that was c:\windows\desktop)Can anyone describe a solution for such problem more in details? My mother has an old dos application and she want to use it on her new notebook with Windows XP SP3. DOS program works but it prints nothing on the USB printer now. This doesnt always work with DOS programs, but might be worth a shot and its redirecting the LPT communications through USB via a network shared printer. You dont even need a network to make this happen, just need to create the network share and then create the LPT1 redirect to the USB printers \\computername\sharedprintername and it might work for you. Here is the link SHOWING how to do this: http://support.microsoft.com/kb/103938sorry to be a pain, but I have read forums and not found answer, I have a similar problem. My work computers run Vista but my main accounts program is a very old dos based program written in pascal. I need the speed of the modern computers to run the rest of my one person business, but I need the dos program for twenty YEARS of records! I have to date , been able to install pci parallel cards to run the two printers used in the accounts program because I can't get the program to use usb printers. I can see a time when parallel cards will not be available (they are hard enough to find now), so how can I get the program to use usb ports, or is this not possible?This thread is VERY old. If you have a problem, please make your own thread. Ok, I still have a problem since I'll create new thread with the same question. Thank you. |
|
| 2688. |
Solve : Batch scripting - Extracting block of data from text lines? |
|
Answer» Win XP HE SP.3+ Cmd.exe BATCH scripting. |
|
| 2689. |
Solve : incorrect ms-dos versioni? |
|
Answer» You can try. |
|
| 2690. |
Solve : Search subfolders for filename!? |
|
Answer» Hey GUYS! |
|
| 2691. |
Solve : Backup a couple of directories using a batch file? |
|
Answer» Hello guys! There are some compressors/decompressors that work from the command-line.Can you tell me how to find out if I have any and how to execute them?Google for 7-zip Quote from: Salmon Trout on October 18, 2009, 09:43:58 AM Google for 7-zip Thanks a lot mate! That worked truly great!!! Problem with backup is solved now! |
|
| 2692. |
Solve : HELP(ADV): Batch file - rename file to directory name+++? |
|
Answer» I want to specify a folder in the batch file (ie. C:\Users\intellilogic\Documents\TopFolder) and have it take all the files and subdirectories in it and rename the files, appending there parent directories to the name and movie them to the root folder specified. I want to do this unlimitedly deep, but only renamed the files to its parent and then moving them all the way to the root. Ideally, I would like to avoid duplicate file names, so if duplicate files come about, appending a number to them would work well. first i would like to say that bill is making an effort at a joke, we don't charge at all!. teach him how to fish, not fish for him.Peace.Once I have the file, i will look at the code and learn it that way, it's like watching Jesus fish... =-0Why not break the job into smaller taks? Do you have plenty of disk space? First GENERAL rule is not to put stuff into the root. Why do you want us to bend this rule? How about a directory called D:\BOGUSROOT Quote from: billrich on October 01, 2009, 07:52:41 AM How did Jesus feed the mulitude? Jesus fed the people fish. Jesus did not teach them to fish.can you ask Jesus, whoever he is, to GIVE you a fish now? tell him to drop the fish from the SKY.. if you can do that, i will treat you to a cup of coffee. Bye@bill, stop babbling nonsense. Quote from: Geek-9pm on October 01, 2009, 12:12:00 PM Why not break the job into smaller taks? Sorry - I meant the root from which you start from, IE the top folder.OK you can use this as a starting PLACE. Code: [Select]@ECHO OFF CLS REM THIS WILL SCAN THE CURRENT FOLDER AND RETURN SUB-FOLDERS TO A TEXT FILE CD %CD% DIR /b /s /ad>"%TEMP%\DIRTEST.TXT" REM USE DIRTEST.TXT IN A FOR LOOP FOR /f "delims==" %%A in (C:\DOCUME~1\%USERNAME%\LOCALS~1\Temp\DIRTEST.TXT) DO SET A=%%A& CALL :DIR %%A CLS IF EXIST "%TEMP%\DIRTEST.TXT" DEL "%TEMP%\DIRTEST.TXT" IF EXIST "%TEMP%\DIRFILE.TXT" DEL "%TEMP%\DIRFILE.TXT" ECHO JOB COMPLETE..... Pause GOTO END :DIR REM THIS WILL SCAN THE CURRENT FOLDER AND RETURN FILES TO A TEXT FILE CD\ CD "%A%" DIR /b /a-d>"%TEMP%\DIRFILE.TXT" REM USE DIRTEST.TXT IN A FOR LOOP FOR /f "delims==" %%A in (C:\DOCUME~1\%USERNAME%\LOCALS~1\Temp\DIRFILE.TXT) DO SET FILE=%%A& CALL :DIRFILE %%A :DIRFILE ECHO %FILE% PAUSE :END Please let me know if this dose not work for you.This looks very helpful, I will play with it - I think I will start at the top w/ IF EXIST "%TEMP%\DIRTEST.TXT" DEL "%TEMP%\DIRTEST.TXT" JIC =] Can I take a stab at this using a SCRIPTING approach ? Comments are inserted so you can see what the script is doing line by line. Code: [Select]############################################## # Script: tf.txt (Not sure what to call it) ############################################## # Usage: script tf.txt root("C:\Users\intellilogic\Documents\TopFolder") ############################################## # Script moves all files in the root folder (and its sub and sub-sub folders) # to the root folder with the parent folder name prepended to file name. # # For example, if root is "C:\Users\intellilogic\Documents\TopFolder", # # the file C:\Users\intellilogic\Documents\TopFolder\Folder1\File1.bla # will be moved to # C:\Users\intellilogic\Documents\TopFolder\Folder1-File1.bla. # # File C:\Users\intellilogic\Documents\TopFolder\Folder3\SubFolder1\File1.bla # will be moved to # C:\Users\intellilogic\Documents\TopFolder\SubFolder1-File1.bla. ############################################## # Input argument. var str root # This value is passed to the script. # If not assigned, current folder will be used. # Go to root folder. cd $root # Collect a list of all flat files. var str list ; lf -rng "*" "." ($ftype=="f") > $list # Loop thru files. while ($list <> "") do # Get the next file. var str file ; lex "1" $list > $file # $file has the full path. Get just the file name. It is after the last /. # Preserver value in $file. We will need it in move command later. var str name ; stex -p "^/^l[" $file > $name # Get the parent folder of the file. It is between the last and # secondlast /. var str parent # Get the portion of $file upto the last /. stex -p "]^/^l" $file > $parent # $parent now has full path of parent folder. # Get just the folder name. That's after the last /. stex "^/^l[" $parent > $parent # The new file name is now $parent-$name. # We want to move the file to $root/$parent-$name. system -s "move /Y" ("\""+$file+"\"") ("\""+$root+"/"+$parent+"-"+$name+"\"") done Script is in biterscripting ( http://www.biterscripting.com ) . But you should translate it to any scripting language of your choice or batch commands. I have added comments for that. (The script just looks bigger because of all the comments and beautification.) |
|
| 2693. |
Solve : ms-dos shorthand command help needed? |
|
Answer» Can someone point me to MS-DOS documentation that explains what is happening on LINE 5? Kind of hard to search for ":~" and find anything helpful. Can someone point me to MS-DOS documentation (1) This is not "MS-DOS". It is WINDOWS NT family command script. Specifically Windows 2000 and later. (2) set /? (part) CODE: [Select]...specify substrings for an expansion. %PATH:~10,5% would expand the PATH environment variable, and then use only the 5 characters that begin at the 11th (offset 10) character of the expanded result. |
|
| 2694. |
Solve : Logging batch completion question? |
|
Answer» First off let me thank all of the guys posting answers on this forum. I have found many answers to my never ending questions. |
|
| 2695. |
Solve : Newbie BAT file problem? |
|
Answer» Hi everyone,
To have a program run at startup time, the program must be placed in the startup folder: C:\>cd %homepath%\Start Menu\Programs\startup copy c:\findstring.bat . ( The "." above says copy to current directory. ) http://www.microsoft.com/windowsxp/using/setup/hwandprograms/autorun.mspx To configure a program to start automatically 1. Right-click Start, and then click Explore. Windows Explorer opens and displays your Start menu. 2. In the left pane, click Programs. Browse to find the program you want to automatically open. In the right pane, right-click the program, and then click Copy. 3. In the left pane, click Programs, right-click Startup, and then click Paste. 4. Repeat steps 2 and 3 to add more programs to your Startup group. The programs you add to the Startup group will start automatically the next time you log on to your computer. Top of page I tested the start service with the net command. It worked as expected. The first loop said we were able to start the service. The next two loops said the service was already working. C:\>type findstring.bat Code: [Select]@echo off cd \ findstr /s "ABC" Background1* findstr /s /m "ABC" Background1* > foundfile.txt for /f "delims==" %%a in (foundfile.txt) do ( echo %%a NET START "Error Reporting Service" ) pause REM the pause is necessary when run at startup time. OUTPUT: C:\>findstring.bat ground\Background1-002:ABC ground\Background1-003:ABC ground\Background1-010:ABC ground\Background1-002 The Error Reporting Service service is starting. The Error Reporting Service service was started successfully. ground\Background1-003 The requested service has already been started. More help is available by typing NET HELPMSG 2182. ground\Background1-010 The requested service has already been started. More help is available by typing NET HELPMSG 2182. Press any key to continue . . . |
|
| 2696. |
Solve : how to run a basic goto program? |
|
Answer» hello,im blocc. my ? is way BACK in the 80's i use to run this program on computers in school. 10 rem 20 print "blocc" 30 goto 20 and then hit run or enter. it WOULD scroll across the screen and depending on how u PUT the name or anything there how it would cross the screen. as well as change and color. i would love to run this on windowsxp but do not KNOW how as far as the cmd i think is not the same. what do i need to run this? if someone could HELP me out thanks. |
|
| 2697. |
Solve : MS-DOS Installation? |
|
Answer» hey, im Tony, im having sum trouble with the installation of DOS... i have it on my home computer, but im trying to install it @ school... it sayz i need a DISC, but i got the one @ home without one.... how can i install it without a disc? plz help but im trying to install it @ school Forum rules prevent us advising on this as you might breach your school's security rules by installing on their system. Please consult your tutor/school IT specialist. Good luck.I am a school computer programmer, my boss says if its blocked dont mess with it.... i just want to have it for the use of it on my, single computer..... please help, it would make my job soooooooooo much easier...You need the 4 floppy DOS DISKS to install it... You can't simply MOVE it to another machine and make it work.All school PCs have a command prompt where the student is allowed to use commands that are similar to but better than the 1981 DOS machine.Bootdisk.comQuote from: billrich on October 14, 2009, 02:03:51 PM All school PCs have a command prompt where the student is allowed to use commands that are similar to but better than the 1981 DOS machine. No. Some schools block command prompt.I like the assumption that ALL school PC's are the same.... Wish i would have gotten that winning bid...i'd be out to pasture.If the school blocks CMD in the first place then don't install anything, you'll GET busted. |
|
| 2698. |
Solve : for loop runs twice? |
|
Answer» I have an issue where a for loop from a previous post is running twice. I am trying to get the file properties from the current directory and all sub directories. The only issue is that I am getting double results in my out put file. The issue is some where in the below code. I notice you are using the append redirection symbol >> to write to the csv so each time you run the batch the csv will get bigger. Also take out the GOTO NEXT. You do not need that, nor the :next label. the >> is so the file will be appended to. with out that the file would be recreated each time. That would be fine except this will be ran on all sub directories. the goto was to try and force it to leave the loop without going through it twice. That is the issue I am trying to FIX now. The loop SEEMS to be picking on on the next LINE of the dir.txt. I have also tried to make it create the csv in the for loop and I still have the loop executing twice. Any ideas on how to fix it? Thanks, WayneIf there are 2 lines in the dir.txt then the loop will execute 2 TIMES. Investigate why the dir.txt has 2 lines. Also your "tokens=" block is redundant. yes well is there a way to to only have it run on the 5th line and not the 6th and 7th? Code: [Select] setlocal enabledelayedexpansion set line=1 for /f "delims==" %%v in (dir.txt) do ( if !line! EQU 5 ( SET PS=%%~dpnxv SET FS=%%~zv SET FMDT=%%~tv ) set /a line+=1 ) |
|
| 2699. |
Solve : Make Silent Installation? |
|
Answer» How to make silent INSTALLATION in batch ... like i have setup.exe i want to INSTALL it silent so how i make batch programme that install setup.exe SILENTLY...? ? ?I suggest you contact the system administrator at your school for HELP with thisA quote from Peter Grifin, "NO!". I suggest you read the rules Deadly D. Any GUESSES on what the 'D' stands for? |
|
| 2700. |
Solve : Help with Batch file creation? |
|
Answer» Code: [Select]if "%filedate%" == "%cdate%" goto run
|
|