Explore topic-wise InterviewSolutions in Microsoft.

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

51.

Solve : Network inventroy?

Answer» <html><body><br/> i am to doing Network inventory i want list of all  .mp3, .avi , .3gp video audio <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a> in my all network PC drive &amp; folder if it is possible with dos or there is any client server <a href="https://interviewquestions.tuteehub.com/tag/option-25810" style="font-weight:bold;" target="_blank" title="Click to know more about OPTION">OPTION</a>???<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/pls-591756" style="font-weight:bold;" target="_blank" title="Click to know more about PLS">PLS</a> <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a> me.<br/></body></html>
52.

Solve : Help with batch...?

Answer» <html><body><p>hello, very nice community<br/><br/>i have made the following batch <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a><br/><br/> Code: <a>[Select]</a>ECHO off<br/>cls<br/>:start<br/>set /p input=Write What are you search for :<br/>findstr /n /i /c:%input% * /all &gt; %input%_bY_Chrisad.txt<br/>goto end<br/>:end<br/><br/>What this do : <br/><br/>ask from user to insert a string<br/>Search all text files in the directory for some string that user want.<br/>Collect the lines of texts that contain the string<br/>and create a new text file named searched_string_by_Chrisad.txt<br/><br/>Works Gr8! <br/><br/>but i need to do some changes and i need help. <br/><br/>i want same procedure but i want the searched sting not entered by user but  to be at a text file stings.txt like that :<br/><br/>sting1<br/>sting2<br/>sting3<br/><br/>.......<br/><br/>and search for the fist (sting1) all text files ---&gt;  and create as results  sting1.txt <br/><br/>after <br/><br/>search for the second (sting2) all text files ---&gt; and create as results string2.txt<br/><br/>after <br/><br/>search for the <a href="https://interviewquestions.tuteehub.com/tag/third-1414358" style="font-weight:bold;" target="_blank" title="Click to know more about THIRD">THIRD</a> (sting3) all text files ---&gt; and create as results string3.txt<br/><br/>hope to be understandable <br/><br/>thanks for any help<br/>My batch is a bit rusty, but you can do this using FOR<br/><br/>ECHO off<br/>cls<br/>:start<br/>set /p input=Write What are you search for :<br/>findstr /n /i /c:%input% * /all &gt; %input%_bY_Chrisad.txt<br/>goto end<br/>:end<br/><br/><strong>for /f "tokens=1*" %%a in ('type INPUTFILE.TXT') do findstr /n /i /c:%%a%%b * /all &gt; %input%_bY_Chrisad.txt</strong>thanks for reply, <br/><br/>i try this : <br/><br/> Code: <a>[Select]</a><br/>ECHO off<br/>cls<br/>:start<br/>for /f "tokens=1*" %%a in ('type INPUTFILE.TXT') do findstr /n /i /c:%%a%%b * /all &gt; results.txt<br/>goto end<br/>:end<br/><br/><br/>but :<br/><br/>if INPUTFILE.TXT have 5 lines <br/><br/>text1<br/>text2<br/>text3<br/>text4<br/>text5<br/><br/>i take the message :<br/><br/>findstr : CANNOT OPEN */ALL<br/>findstr : CANNOT OPEN */ALL<br/>findstr : CANNOT OPEN */ALL<br/>findstr : CANNOT OPEN */ALL<br/><br/>Four times and i take results only for the last line (text5) <br/><br/>the same thing <a href="https://interviewquestions.tuteehub.com/tag/happen-1015459" style="font-weight:bold;" target="_blank" title="Click to know more about HAPPEN">HAPPEN</a> if  the INPUTFILE.TXT have 2-3-5 or any other number of values only take the last one...<br/><br/>any other help ?I have 1 txt file X having <a href="https://interviewquestions.tuteehub.com/tag/fields-251233" style="font-weight:bold;" target="_blank" title="Click to know more about FIELDS">FIELDS</a> a, b, c and I want to make Y file which would only contain b field from X file with the help of batch file. Kindly help how I can make it? <strong>('type INPUTFILE.TXT')<br/></strong><br/><br/>I think the problem is you're not including the path..<br/><br/><strong>('type C:\folder\INPUTFILE.TXT')</strong><br/><br/>Or maybe change directory</p></body></html>
53.

Solve : Help to create a batch file?

Answer» <html><body><p>Hello<br/><br/>I am new to this forum and am not <a href="https://interviewquestions.tuteehub.com/tag/sure-656539" style="font-weight:bold;" target="_blank" title="Click to know more about SURE">SURE</a> where to post this.. so moderator please feel free to move this post into the appropriate section..<br/><br/>Now my issue, I have a <a href="https://interviewquestions.tuteehub.com/tag/text-11613" style="font-weight:bold;" target="_blank" title="Click to know more about TEXT">TEXT</a> file(not empty) which I have to open, save and close using a batch file. I am <a href="https://interviewquestions.tuteehub.com/tag/able-361137" style="font-weight:bold;" target="_blank" title="Click to know more about ABLE">ABLE</a> to open the file and close it but not able to save it. I do not want to write anything to the file.  So can somebody please tell me if I can save the file using batch file <a href="https://interviewquestions.tuteehub.com/tag/commands-18925" style="font-weight:bold;" target="_blank" title="Click to know more about COMMANDS">COMMANDS</a>..<br/>Please find my code below for opening an closing the file..<br/> Code: <a>[Select]</a>echo off<br/>start ED.txt <br/>taskkill /f /<a href="https://interviewquestions.tuteehub.com/tag/im-504522" style="font-weight:bold;" target="_blank" title="Click to know more about IM">IM</a> notepad.exe<br/>Exit<br/><br/>thank you for your time</p></body></html>
54.

Solve : MS DOS Batch - String Manipulation?

Answer» <html><body><p>Does anyone here have experience with modifying text files via batch?  I would like to create a .BAT that can be executed via Shell Wait in MS Access 2003.  The text file needs to be modified/overwritten to remove lines of text that presently represent headers/footers causing problems with MS Access import specifications.  The file originates as a UNIX print spooler file that I have retrieved via ftp and saved to the Windows box as an ASCII .txt file.<br/><br/>Please respond with "dummy" instructions.  My DOS is very old rusty knowledge and will require some hand holding to implement.To remove lines with specific text you could try using the TYPE command piped to the FIND command and redirect the output to a new file. The /v switch for FIND means "filter lines that do not contain the text in quotes".<br/><br/>examples<br/><br/> Code: <a>[Select]</a>type "before.txt" | find /v "This text is only found in a HEADER" &gt; "after.txt"<br/>type "before.txt" | find /v "This text is only found in a FOOTER" &gt; "after.txt"<br/>type "before.txt" | find /v "This text is only found in a HEADER" | find /v "This text is only found in a FOOTER"&gt; "after.txt"<br/><br/>Having done the processing you could then <a href="https://interviewquestions.tuteehub.com/tag/delete-karana-436574" style="font-weight:bold;" target="_blank" title="Click to know more about DELETE">DELETE</a> before.txt and rename after.txt to before.txt.<br/>SUPER - I just tried it out and it worked like a CHARM!  Do you know how I can use the same to incorporate special characters such as CR, LF, etc also can I include wildcards? Quote from: danyelle on February 23, 2010, 03:08:23 PM</p><blockquote>SUPER - I just tried it out and it worked like a CHARM!  Do you know how I can use the same to incorporate special characters such as CR, LF, etc also can I include wildcards?<br/></blockquote> <br/>I am not sure what you mean by this; if you filtered out lines with a CR or an LF, you'd filter out everything. If you want to replace one character (or a set of characters) with another within word or line of text that is possible<br/><br/>e.g.<br/><br/>set text=Mary had a little lamb; its fleece was white as snow.<br/><br/>set text=%text:Mary=Joe%<br/>result:   Joe had a little lamb; its fleece was white as snow.<br/><br/>set text=%text:lamb=cat%<br/>result:   Joe had a little cat; its fleece was white as snow.<br/><br/>set text=%text:white=black%<br/>set text=%text:snow=coal%<br/>result:   Joe had a little cat; its fleece was black as coal.<br/><br/>as for "wildcards", that makes me think you would do well to study "regular expressions", which you can use with find's  grown up brother, findstr.<br/><br/>For heavy duty string manipulation, Visual Basic Script is probably easier to use and more efficient.<br/><br/><br/>you can use batch to do string manipulation but its capabilities in <a href="https://interviewquestions.tuteehub.com/tag/terms-239101" style="font-weight:bold;" target="_blank" title="Click to know more about TERMS">TERMS</a> of string/text manipulation is primitive and full of inefficiency. for better text manipulation capabilities, use tools, such as Perl (or Python) or gawk (see my sig).  <br/>you can also make use GNU tools like head /tail to remove headers/footers ,<br/> Code: <a>[Select]</a>C:\test&gt;more file<br/>header<br/>text1<br/>text2<br/>footer<br/><br/>C:\test&gt;tail -n +2 file | head -n -1<br/>text1<br/>text2<br/><br/><br/>show an example of your text file, and describe the output  you want.[duplicate] Quote from: Salmon Trout on February 23, 2010, 03:48:45 PM<blockquote>I am not sure what you mean by this; if you filtered out lines with a CR or an LF, you'd filter out everything. <br/><br/>For heavy duty string manipulation, Visual Basic Script is probably easier to use and more efficient.<br/></blockquote> <br/>Good observation, I wasn't thinking <a href="https://interviewquestions.tuteehub.com/tag/clearly-420736" style="font-weight:bold;" target="_blank" title="Click to know more about CLEARLY">CLEARLY</a> when I mentioned the CR/LF as it relates to this <a href="https://interviewquestions.tuteehub.com/tag/function-11303" style="font-weight:bold;" target="_blank" title="Click to know more about FUNCTION">FUNCTION</a>.  My thoughts are that if the I know that line of text on which the real data begins, I could somehow remove or replace the first <em>n</em> lines each time which would me the first <em>n</em> CR/LF lines would be removed and then the script would be more universally suited to apply to a variety of text files where each header/footer may contain different text.<br/><br/>As for a Visual Basic approach I would be interested in your thoughts. I am ultimately doing this to accomodate an fix width delmitation into MS Access tables, that said I couldn't find an equivalent to InputString function VB function in VBA. Quote from: danyelle on February 24, 2010, 07:37:28 AM<blockquote>As for a Visual Basic approach I would be interested in your thoughts. I am ultimately doing this to accomodate an fix width delmitation into MS Access tables, that said I couldn't find an equivalent to InputString function VB function in VBA.<br/></blockquote> Use the InputBox function in VBA, for example<br/> Code: <a>[Select]</a>DocumentName = InputBox("Document Name ?")um..<br/><br/>VB.NET has an InputString Function:<br/><br/> Code: <a>[Select]</a>InputString(_<br/>   ByVal FileNumber As Integer, _<br/>   ByVal CharCount As Integer _<br/>) As String<br/><br/>looks like it reads data from a file- InputBox does not.<br/><br/>VBA is nearly identical to VB6 in what features it supports; so:<br/><br/>Paste In a new module:<br/><br/> Code: <a>[Select]</a>Public Function TrimFile(ByVal sFileName As String, ByVal sOutputFile As String, Optional ByVal SkipHeaderLines As Integer = <a href="https://interviewquestions.tuteehub.com/tag/0-242464" style="font-weight:bold;" target="_blank" title="Click to know more about 0">0</a>, Optional ByVal SkipFooterLines As Integer = 0)<br/>    Dim fnum As Integer<br/>    Dim ftemp As Integer, temppath As String<br/>    Dim textin As String<br/>    Dim FoundHeadercrlf As Long, FoundFooterCrlf As Long<br/>    fnum = FreeFile<br/>    Open sFileName For Input As fnum<br/>    <br/>    ftemp = FreeFile<br/><br/>    <br/>    Open sOutputFile For Output As ftemp<br/><br/>    textin = Input$(LOF(fnum), fnum)<br/>    Close fnum<br/>    <br/>    <br/>  <br/>    Dim currcount As Long<br/>    If SkipHeaderLines Then<br/>        FoundHeadercrlf = 1<br/>        Do Until currcount = SkipHeaderLines<br/>            currcount = currcount + 1<br/>            FoundHeadercrlf = InStr(FoundHeadercrlf + 1, textin, vbCrLf)<br/>        Loop<br/>       <br/>    End If<br/>    <br/>    If SkipFooterLines Then<br/>        FoundFooterCrlf = Len(textin)<br/>        currcount = 0<br/>        Do Until currcount = SkipFooterLines<br/>            currcount = currcount + 1<br/>            FoundFooterCrlf = InStrRev(textin, vbCrLf, FoundFooterCrlf - 1)<br/>        Loop<br/>       <br/>    End If<br/><br/>    textin = Mid$(textin, FoundHeadercrlf, FoundFooterCrlf - FoundHeadercrlf)<br/>    <br/>    'remove leading and trailing crlfs...<br/>    Do Until Left$(textin, 2) &lt;&gt; vbCrLf<br/>        textin = Mid$(textin, 3)<br/>    Loop<br/>    <br/>    Do Until Right$(textin, 2) &lt;&gt; vbCrLf<br/>        textin = Mid$(textin, 1, Len(textin) - 2)<br/>    Loop<br/>    <br/>    Print #ftemp, textin<br/>    <br/>    Close #ftemp<br/>    <br/>End Function<br/><br/><br/><br/>In my tests this seems to do what you require, if I understand what you require, of course.<br/><br/>basically, just call it like this:<br/>TrimFile(ByVal sFileName As String, ByVal sOutputFile As String, Optional ByVal SkipHeaderLines As Integer = 0, Optional ByVal SkipFooterLines As Integer = 0)<br/> Code: <a>[Select]</a>TrimFile("D:\Filename.txt","D:\output.txt", &lt;number of header lines to skip&gt;, &lt;number of footer lines to skip&gt;)<br/>remember to replace each parameter with the filenames and the number of header and footer lines you REALLY want to skip.<br/><br/>This code should work in Access 97 and higher, so you should be fine.</body></html>
55.

Solve : how do I change my background in DOS??

Answer» <html><body><p>The background colour in DOS is white and the text is yellow and very difficult to read! Can anybody help?Open up the window and right click and select defaults. Look through the tabs and you will find the colour options. Quote from: edm on February 24, 2010, 04:41:32 AM</p><blockquote>The background colour in DOS is white and the text is yellow and very difficult to read! Can anybody help?<br/></blockquote> <br/>lol edm. I think somebody pulled a joke on you.<br/><br/>Here are a few examples:<br/>(<strong>Background color, Foreground (font) color</strong>)<br/><br/>Black, Green<br/><strong>color 0a</strong><br/><br/>Blue, White<br/><strong>color 17</strong><br/><br/>White, Blue<br/><strong>color 71</strong><br/><br/>Black, White<br/><strong>color 07</strong><br/><br/>Enjoy.<br/><br/><br/><br/><br/>the problem with the Color command is it isn't permanent. Changing the <a href="https://interviewquestions.tuteehub.com/tag/selected-1199596" style="font-weight:bold;" target="_blank" title="Click to know more about SELECTED">SELECTED</a> Colors in the "Colors" tab From the windows System Menu's "Properties" Item is.You can make it permanent.<br/>Here's how:<br/><strong><br/>Start -&gt; Run -&gt; regedit</strong><br/><br/>Go to <br/><strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor</strong><br/><br/>On the <strong>right pane</strong>, <strong>double-click</strong> on the <strong>AutoRun </strong>value and fill this in:<br/><strong>color 0a</strong><br/><br/>This way, no matter when the computer starts, your commandline will remain<br/>in this color (<strong>I chose black, green as an <a href="https://interviewquestions.tuteehub.com/tag/example-239971" style="font-weight:bold;" target="_blank" title="Click to know more about EXAMPLE">EXAMPLE</a> (0a)</strong>).<br/><br/>My personal values for AutoRun are:<br/>cls &amp;&amp; cd \ &amp;&amp; color 0a <br/><br/>(You don't have to do that, though, it just does the <a href="https://interviewquestions.tuteehub.com/tag/following-463335" style="font-weight:bold;" target="_blank" title="Click to know more about FOLLOWING">FOLLOWING</a>:<br/>clear the <a href="https://interviewquestions.tuteehub.com/tag/screen-25632" style="font-weight:bold;" target="_blank" title="Click to know more about SCREEN">SCREEN</a>, change <a href="https://interviewquestions.tuteehub.com/tag/directory-11615" style="font-weight:bold;" target="_blank" title="Click to know more about DIRECTORY">DIRECTORY</a> to root and color the background back and the foreground green.<br/>The &amp;&amp; binds commands together.)<br/><br/>=)<br/><br/><br/> Quote from: Treval on February 24, 2010, 03:17:04 PM<blockquote>You can make it permanent.<br/><br/>&lt;stuff&gt;<br/></blockquote> <br/>Or just use the properties dialog...<br/><br/>LoL =P<br/>The advantage of mine is you can do multiple things at the same time. =O Quote from: Treval on February 24, 2010, 03:46:08 PM<blockquote>LoL =P<br/>The advantage of mine is you can do multiple things at the same time. =O<br/></blockquote> Changing the registry is not reccomended for non-experts.</body></html>
56.

Solve : Setting a filename with spaces and extention into a variable (N00b)?

Answer» <html><body><p>Hello, I am trying to <a href="https://interviewquestions.tuteehub.com/tag/move-548879" style="font-weight:bold;" target="_blank" title="Click to know more about MOVE">MOVE</a> files from one directoy to another, and I seem to be failing on filenames with spaces.<br/><br/>I tried the below, but I keep setting this <a href="https://interviewquestions.tuteehub.com/tag/variable-772077" style="font-weight:bold;" target="_blank" title="Click to know more about VARIABLE">VARIABLE</a>  (  %1) to only the first part of a filename before the spaces:<br/><br/> <br/><br/><br/>EXAMPLE:<br/>dir "x:\move" /b &gt;list.txt<br/>for /f %%a in (.\list.txt) do call :<a href="https://interviewquestions.tuteehub.com/tag/main-552371" style="font-weight:bold;" target="_blank" title="Click to know more about MAIN">MAIN</a> %%a<br/><br/>goto eol<br/><br/>:main<br/>pause<br/>set file=%1<br/><br/><br/>rename "x:\move\%file%"   "s:\move\%file%"Try this:<br/><br/><strong>for /f "usebackq" %%a in (.\list.txt) do call :main %%a</strong><br/><br/>The <strong>usebackq</strong> option allows long file names, as long as quotes are used around the name.I tried :<br/><br/> Quote from: killerb255 on February 22, 2010, 12:53:01 PM</p><blockquote><strong>for /f "usebackq" %%a in (.\list.txt) do call :main %%a</strong><br/><br/></blockquote> <br/>but the  %1 variable still has only the first 'word' (up to the filename's space)<br/><br/> <br/> Quote from: schreibman on February 22, 2010, 03:53:19 PM<blockquote>I tried :<br/><br/>but the  %1 variable still has only the first 'word' (up to the filename's space)<br/><br/> <br/><br/></blockquote> That would be because %# is delimited by spaces. The file name needs to be wrapped in quotes. For example:<br/>C:\Documents and Settings\My Documents\<br/>%1=C:\Documents<br/>%2=and<br/>%3=Settings\My<br/>%4=Documents\To eliminate it from using a space as a delimiter (which is the default), try this:<br/><br/>for /f "usebackq tokens=1 delims={" %%a in (.\list.txt) do call :main %%a<br/><br/>After the equal sign, you can use any character that's not being used in your file name list (so don't use a left brace ({) if your list has left braces).<br/><br/>The idea is to tell the batch NOT to use a space, as it'll use a space unless you specify otherwise (is there a way to specify a carriage-return as a delimiter?)<br/> Quote<blockquote>Hello, I am trying to move files from one directoy to another, and I seem to be failing on filenames with spaces.<br/></blockquote> <br/>Not sure why you have a <em>rename</em> in your <a href="https://interviewquestions.tuteehub.com/tag/code-25512" style="font-weight:bold;" target="_blank" title="Click to know more about CODE">CODE</a>, but you don't need it. This little snippet should take care of your space as delimiter and the quotes.<br/><br/> Code: <a>[Select]</a>echo off<br/>for /f "tokens=* delims=" %%a in ('dir /b x:\move') do (<br/>  move "x:\move\%%~nxa" "s:\move\%%~nxa"  <br/>)<br/><br/>Good luck.  <br/> Quote from: killerb255 on February 22, 2010, 04:02:32 PM<blockquote>To eliminate it from using a space as a delimiter (which is the default), try this:<br/><br/>for /f "usebackq tokens=1 delims={" %%a in (.\list.txt) do call :main %%a<br/><br/>After the equal sign, you can use any character that's not being used in your file name list (so don't use a left brace ({) if your list has left braces).<br/><br/>The idea is to tell the batch NOT to use a space, as it'll use a space unless you specify otherwise (is there a way to specify a carriage-return as a delimiter?)<br/><br/></blockquote> Quote from: schreibman on February 22, 2010, 03:53:19 PM<blockquote>I tried :<br/><br/>but the  %1 variable still has only the first 'word' (up to the filename's space)<br/><br/> <br/><br/></blockquote> Problem is highlighted. User input is delimited by spaces, %1-??? and I don't think that can be changed. Quote from: Sidewinder on February 22, 2010, 07:40:05 PM<blockquote>Not sure why you have a <em>rename</em> in your code,<br/></blockquote> <br/>Sidewinder, Cause I'm a <a href="https://interviewquestions.tuteehub.com/tag/n00b" style="font-weight:bold;" target="_blank" title="Click to know more about N00B">N00B</a>!<br/><br/>In anycase, you "suggestion" (basically your perfect re-write!)  both did the trick perfectly and educated me!<br/><br/>Thanks so much for your help!</body></html>
57.

Solve : how to develop a protected mode TSR under DPMI 0.9??

Answer» <html><body><p>hello everyone ,<br/>       I want to develop a protected mode TSR under DPMI 0.9 using BC4.5 . In DPMI1.0 there are functions 0c00 and 0c01 that supported a program to stay resident .But in DPMI 0.9 these functions didn't exist ,so I want to know how to develop it .If you know ,please tell me.If you have some examples ,please paste them or  you can mail it to me .My e-mail address is <a href="/cdn-cgi/l/email-protection">[email protected]</a> everyone.Welcome to CH forums<br/><strong>The moderator will remove your e-mail.</strong><br/>You are talking about:<br/> Quote</p><blockquote>DOS protected mode interface<br/>Abbreviated as DPMI, DOS Protected Mode Interface is a memory mode allowing DOS programs to operate in protected mode allowing DOS applications to support multitasking and use portions beyond the 640KB limit.<br/>Also see: EMS, Memory definitions, Protected mode </blockquote> Sorry I can not help you. Why can you not use the 1.0 version?<br/>DPMI 1.0 Programming API Specfication<br/><a href="http://www.delorie.com/djgpp/doc/dpmi/">http://www.delorie.com/djgpp/doc/dpmi/</a><br/>I wish I could use DPMI 1.0,but there is some limit.I hate the limit.But thank you also the same.who can help me!!!!!If anybody wants to know more about this:<br/><a href="https://en.wikipedia.org/wiki/DOS_Protected_Mode_Interface">http://en.wikipedia.org/wiki/DOS_Protected_Mode_Interface</a><br/>DPMI still works. But  most modern programing with use DiretcX or something like that.Finally I found a way,but I can't quite <a href="https://interviewquestions.tuteehub.com/tag/understand-720010" style="font-weight:bold;" target="_blank" title="Click to know more about UNDERSTAND">UNDERSTAND</a> it.First you should install the interrupt using function 0204h of int 31h,then keep the programe to stay resident using function 31h of int 21h.But I didn't know how to decide the size.The return code has been <a href="https://interviewquestions.tuteehub.com/tag/made-1082584" style="font-weight:bold;" target="_blank" title="Click to know more about MADE">MADE</a> to be zero.<br/>My question is that my TSR runs under protected mode .But the int 21h runs under real mode,can it read or wirte the memory of protected mode?Wish I knew the <a href="https://interviewquestions.tuteehub.com/tag/answer-15557" style="font-weight:bold;" target="_blank" title="Click to know more about ANSWER">ANSWER</a>. What little I have read seems to say you don't worry about it, that is what DPMI does.<br/>Here is a site that has a good but brief collection of tools for hard core low-level programming. The article does not directly cover you question, but maybe it sheds some <a href="https://interviewquestions.tuteehub.com/tag/light-238826" style="font-weight:bold;" target="_blank" title="Click to know more about LIGHT">LIGHT</a> on what you can do with a DPMI program.<br/><br/><a href="http://www.thefreecountry.com/programming/dosextenders.shtml">http://www.thefreecountry.com/programming/dosextenders.shtml</a><br/><br/>Scroll down the <a href="https://interviewquestions.tuteehub.com/tag/page-25452" style="font-weight:bold;" target="_blank" title="Click to know more about PAGE">PAGE</a> at take a look at CSDPMI DPMI Host.</body></html>
58.

Solve : Get system encoding?

Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/hi-479908" style="font-weight:bold;" target="_blank" title="Click to know more about HI">HI</a>,<br/>  <br/>    I want to <a href="https://interviewquestions.tuteehub.com/tag/know-534065" style="font-weight:bold;" target="_blank" title="Click to know more about KNOW">KNOW</a> the default <a href="https://interviewquestions.tuteehub.com/tag/encoding-769608" style="font-weight:bold;" target="_blank" title="Click to know more about ENCODING">ENCODING</a> of my system using command prompt.<br/>    <br/>    Is there any way so can I get that information. <br/>  What "default encoding"? Did you mean the current <a href="https://interviewquestions.tuteehub.com/tag/code-25512" style="font-weight:bold;" target="_blank" title="Click to know more about CODE">CODE</a> page? If so, type chcp at the prompt.<br/></body></html>
59.

Solve : batch to validate password?

Answer» <html><body><p>Hello everyone<br/>I'd like to <a href="https://interviewquestions.tuteehub.com/tag/make-249948" style="font-weight:bold;" target="_blank" title="Click to know more about MAKE">MAKE</a> an executable file that, when I run it, writes "Enter ID:" and when the user enters an ID I <a href="https://interviewquestions.tuteehub.com/tag/want-1448756" style="font-weight:bold;" target="_blank" title="Click to know more about WANT">WANT</a> the file to validate if the ID is 173227 then another executable file is run and if not the file is closed. can it be done with batch file? and what is the code?<br/><br/>thanksWelcome to CH.<br/>Somebody did that awhile back. But it was not very good. It required a hack to prevent the password from showing on the screen. And there is no piratical way to prevent the user from seeing the contents of the batch file. Not that I know about. If so, it would be something outside of what batch files normally do. Batch files normally do backups, clean up and system housework.<br/><br/>But if you would explain whyyou believe this shoyuld be done in a batch file we <a href="https://interviewquestions.tuteehub.com/tag/maybe-2821687" style="font-weight:bold;" target="_blank" title="Click to know more about MAYBE">MAYBE</a> be able to suggest a method <a href="https://interviewquestions.tuteehub.com/tag/taht-1238470" style="font-weight:bold;" target="_blank" title="Click to know more about TAHT">TAHT</a> will do what you want. <br/><br/>Do you want to restrict a user from using a certain program unless he has the password? Or do you want to prevent a user from changing the contents of a document? <br/>Thank you so much<br/>In fact I want a better <a href="https://interviewquestions.tuteehub.com/tag/look-544452" style="font-weight:bold;" target="_blank" title="Click to know more about LOOK">LOOK</a> than that of MSDOS, I need this file to make setting up a certain software conditional to entering a pre-defined password. and a (sorry message ) to promt if wrong password.</p></body></html>
60.

Solve : Is there a "back" command??

Answer» <html><body><p>I was <a href="https://interviewquestions.tuteehub.com/tag/wondering-7723068" style="font-weight:bold;" target="_blank" title="Click to know more about WONDERING">WONDERING</a> if you could be on one <a href="https://interviewquestions.tuteehub.com/tag/screen-25632" style="font-weight:bold;" target="_blank" title="Click to know more about SCREEN">SCREEN</a>, then type in a type of universal command (that of which I'm putting in my templates) but is there such thing as a back command, or a universal "if %input%==universalcommand goto :UNIVERSALCOMMAND". Quote from: tommyroyall on February 24, 2010, 07:48:15 PM</p><blockquote>"Is there such thing as a back command, or a universal "if %input%==universalcommand goto :UNIVERSALCOMMAND"."<br/></blockquote> <br/>All loops by design "goback" to a previous place in the code when conditions are satisfied.  The loop may be a For loop or a goto loop or etc . . .<br/><br/><a href="http://www.yourdictionary.com/computer/loop">http://www.yourdictionary.com/computer/loop</a><br/><br/>( The following is from the above <a href="https://interviewquestions.tuteehub.com/tag/site-244234" style="font-weight:bold;" target="_blank" title="Click to know more about SITE">SITE</a>. )<br/><br/>loop definition - computer <br/><br/>"In programming, a repetition within a program. <br/>Whenever a process must be repeated, a loop is <br/>set up to handle it. A program has a main loop <br/>and a series of <a href="https://interviewquestions.tuteehub.com/tag/minor-548033" style="font-weight:bold;" target="_blank" title="Click to know more about MINOR">MINOR</a> loops, which are nested <br/>within the main loop. <br/>Learning how to set up loops is what programming <br/>technique is all about."<br/><br/></body></html>
61.

Solve : Tokens??

Answer» <html><body><p>After the "for /blah blah <a href="https://interviewquestions.tuteehub.com/tag/tokens-1421690" style="font-weight:bold;" target="_blank" title="Click to know more about TOKENS">TOKENS</a> blah blah blah" command, what would tokens be? Are those like characters in a word or something, or pieces of stored <a href="https://interviewquestions.tuteehub.com/tag/data-25577" style="font-weight:bold;" target="_blank" title="Click to know more about DATA">DATA</a>?All of your queries are not only nebulous in content but contain alot of blah blah blah...<br/>What is your <a href="https://interviewquestions.tuteehub.com/tag/goal-25855" style="font-weight:bold;" target="_blank" title="Click to know more about GOAL">GOAL</a> here ? ? Quote from: tommyroyall on February 24, 2010, 07:40:08 PM</p><blockquote>After the "for /blah blah tokens blah blah blah" command, what would tokens be? Are those like characters in a word or something, or pieces of stored data?<br/></blockquote> <br/>Have you tried the /? switch on FOR <a href="https://interviewquestions.tuteehub.com/tag/yet-1465121" style="font-weight:bold;" target="_blank" title="Click to know more about YET">YET</a>? Quote from: tommyroyall on February 24, 2010, 07:40:08 PM<blockquote>After the "for /blah blah tokens blah blah blah" command, what would tokens be? Are those like characters in a word or something, or pieces of stored data?<br/></blockquote> <br/>Tokens are the words of the input line.   The separator ( <a href="https://interviewquestions.tuteehub.com/tag/delims" style="font-weight:bold;" target="_blank" title="Click to know more about DELIMS">DELIMS</a>) may be a space or a "/" or other separators.<br/><br/>For example:<br/><br/><br/>C:\&gt;type  twodate.bat<br/><br/><br/> Code: <a>[Select]</a>for /f "tokens=1-4 delims=/ " %%d in ("%date%") do echo %%f%%e%%d<br/><strong>Output:</strong><br/><br/>C:\&gt;for /F "tokens=1-4 delims=/ " %d in ("Wed 02/24/2010") do echo %f%e%d<br/><br/><strong>2402Wed</strong><br/><br/>C:\&gt;</body></html>
62.

Solve : %%BLAH or %BLAH%!??!?!??

Answer» <html><body><p>I know that %variables_have_percent_marks% but what %%is_this? is it also a variable?Take a nice long look at for /? the next time you open the command prompt...you may just learn something. <br/><br/>In the mean time, here is what you wanted:<br/>%variables% are used with the <a href="https://interviewquestions.tuteehub.com/tag/set-11758" style="font-weight:bold;" target="_blank" title="Click to know more about SET">SET</a> command are are called variables. Whatever their value is replaces it. <br/>%%a is not an actual variable. It is a token used in for loops. It only substitutes the value while in a for loop. It can't be changed manually, like a regular variable. <br/><br/>For example, both these codes will do the exact same thing, but they are different as you can see.  <br/> Code: <a>[Select]</a>echo off<br/>:loop<br/>set /a num+=1<br/>echo %num%<br/>if %num%==10 goto stop<br/>goto loop<br/>:stop<br/>pause Code: <a>[Select]</a>echo off<br/>for /l %%a in (1,1,10) do echo %%a<br/>pausealso, it's only double-percent <a href="https://interviewquestions.tuteehub.com/tag/signs-236644" style="font-weight:bold;" target="_blank" title="Click to know more about SIGNS">SIGNS</a> when in a batch file. you can type for commands on the command line, but you must use a single percent sign:<br/><br/> Code: <a>[Select]</a>C:\Windows&gt;for /f "tokens=*" %P in ('dir /s /<a href="https://interviewquestions.tuteehub.com/tag/b-236590" style="font-weight:bold;" target="_blank" title="Click to know more about B">B</a>') do echo %P<br/>set a=1&amp;call echo %%a%% Code: <a>[Select]</a>Microsoft Windows <a href="https://interviewquestions.tuteehub.com/tag/xp-747558" style="font-weight:bold;" target="_blank" title="Click to know more about XP">XP</a> [Version 5.1.2600<br/>(C) Copyright 1985-2001 Microsoft Corp<br/><br/>d:\batch&gt;set a=1&amp;call echo %%a%%<br/>%1%<br/><br/>d:\batch&gt;<br/> Quote from: Geek-9pm on February 24, 2010, 11:08:48 PM</p><blockquote> Code: <a>[Select]</a>Microsoft Windows XP [Version 5.1.2600<br/>(C) Copyright 1985-2001 Microsoft Corp<br/><br/>d:\batch&gt;set a=1&amp;call echo %%a%%<br/>%1%<br/><br/>d:\batch&gt;<br/> <br/></blockquote> <br/>my thoughts <a href="https://interviewquestions.tuteehub.com/tag/exactly-977868" style="font-weight:bold;" target="_blank" title="Click to know more about EXACTLY">EXACTLY</a>... not sure what is being said with that...test it in a .bat file Quote from: Prince_ on February 24, 2010, 10:58:14 PM<blockquote>set a=1&amp;call echo %%a%%<br/></blockquote> Quote from: Prince_ on February 25, 2010, 12:52:56 AM<blockquote>test it in a .bat file<br/></blockquote> <br/><br/><br/>C:\&gt;type   a25.bat<br/> Code: <a>[Select]</a>echo off<br/><br/>REM "Test it in a .bat file"<br/><br/>set a=1&amp;call echo %%a%%<br/><strong>Output:</strong><br/><br/>C:\&gt; a25.bat<br/>1<br/><br/>C:\&gt;<br/><br/>  Not worth bananas. Please do not waster the bananas.</body></html>
63.

Solve : %dd% specs?

Answer» <html><body><p>Could I put something like "if %dd%==monday goto :MONDAY" or would it be different?I just checked for you:<br/><br/>?"if %dd%==monday goto :MONDAY"="if %dd%==monday goto :MONDAY"<br/>True<br/><br/>They are the same. Of course really I have no <a href="https://interviewquestions.tuteehub.com/tag/idea-770073" style="font-weight:bold;" target="_blank" title="Click to know more about IDEA">IDEA</a> what your talking about or what %dd% is. Also you don't need to use the Colon in a goto, just for the label.Isn't %dd% to get the day? I've used that before. <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: tommyroyall on February 25, <a href="https://interviewquestions.tuteehub.com/tag/2010-290294" style="font-weight:bold;" target="_blank" title="Click to know more about 2010">2010</a>, 04:51:10 PM</p><blockquote>Isn't %dd% to get the day? I've used that before.<br/></blockquote> <br/><br/>C:\batch&gt;type  tezt.bat<br/> Code: <a>[Select]</a>echo off<br/>FOR /F "TOKENS=1* DELIMS= " %%A IN ('date /t') DO (<br/>SET CDATE=%%B<br/>echo CDATE=%CDATE%<br/>)<br/>pause<br/><br/>FOR /F "TOKENS=1,2 eol=/ DELIMS=/" %%A IN ('echo %CDATE%') DO (<br/>SET mm=%%A<br/>echo mm=%mm%<br/>)<br/>pause<br/><br/>FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO (<br/>SET dd=%%B<br/>echo dd=%dd%<br/>)<br/>FOR /F "TOKENS=2,3 DELIMS=/" %%A IN ('echo %CDATE%') DO (<br/>SET yyyy=%%B<br/>SET date=%mm%%dd%%yyyy%<br/>echo date=%date%<br/>)<br/><strong>Output:</strong><br/><br/>C:\batch&gt;tezt.bat<br/><br/>CDATE=02/25/2010<br/>Press any key to continue . . .<br/>mm=02<br/>Press any key to continue . . .<br/>dd=25<br/>date=02252010<br/><br/>C:\batch&gt; Quote from: tommyroyall on February 24, 2010, 07:37:24 PM<blockquote>Could I put something like "if %dd%==monday goto :MONDAY" or would it be different?<br/></blockquote> <br/><br/>C:\batch&gt;type  tommy.bat<br/> Code: <a>[Select]</a>echo off<br/><br/>set dd=%date:~0,3%<br/>echo dd=%dd%<br/><br/>if %dd%==Mon goto monday<br/>echo Today is not monday<br/>goto eof<br/><br/>:monday<br/><br/>echo Hello Monday<br/>pause<br/><br/>:eof<br/><strong>Output:</strong><br/><br/>C:\batch&gt;tommy.bat<br/>dd=Mon<br/>Hello Monday<br/>Press any key to continue . . .<br/>C:\batch&gt;<br/><br/><strong>Output:</strong><br/><br/>C:\batch&gt;tommy.bat<br/>dd=Thu<br/>Today is not monday<br/><br/>C:\batch&gt;<br/><br/><a href="http://www.dostips.com/DtTipsStringManipulation.php">http://www.dostips.com/DtTipsStringManipulation.php</a><br/></body></html>
64.

Solve : How do I create batch file to run on 1st Sunday of each month??

Answer» <html><body><p>Hi!<br/><br/>I'm very new to batch files.  This is the <a href="https://interviewquestions.tuteehub.com/tag/first-461760" style="font-weight:bold;" target="_blank" title="Click to know more about FIRST">FIRST</a> time I have to write one.<br/><br/>I need to write a batch file that will do 'something' but only on the 1st Sunday of each month and at a specified time, say 3 AM.  <br/><br/>I had the idea of using the Scheduled Tasks manager in Windows to run my batch file each Sunday and at a specified time, then define the 1st Sunday in the batch file (something like, "if SUN and DD =&amp;<a href="https://interviewquestions.tuteehub.com/tag/lt-537906" style="font-weight:bold;" target="_blank" title="Click to know more about LT">LT</a>; 7".  If it is not the 1st Sunday, then just do nothing and exit the batch file.  The only thing is I don't know the syntax to define the 1st Sunday and specific time.  Can someone help me out?<br/><br/>Thank you so much. <br/><br/><br/>BTW this batch file will be run on a Win Server 2003 box.Go to the command prompt and type in:<br/>echo %date%<br/>and tell us EXACTLY what it says. Scheduled Tasks manager provides an option to "Run on the 'first' 'Sunday' of the Month<br/> Quote from: gregflowers on February 25, 2010, 01:32:39 PM</p><blockquote>Scheduled Tasks manager provides an option to "Run on the 'first' 'Sunday' of the Month<br/><br/></blockquote> I was thinking of an all-batch solution, but then it wouldn't run automatically, it just wouldn't do anything if it wasn't the first Sunday. The OP did mention that he was using Windows Task Manager to run his batch . . . Quote from: gregflowers on February 25, 2010, 01:38:09 PM<blockquote>The OP did mention that he was using Windows Task Manager to run his batch . . .<br/></blockquote> I have problems reading lol. Quote from: reefshark on February 25, 2010, 10:52:18 AM<blockquote>I need to write a batch file that will do 'something' but only on the 1st Sunday of each month and at a specified time, say 3 AM.  <br/></blockquote> <br/><br/>Use the /next option below.<br/><br/><br/>C:\&gt;at /?<br/>The AT command schedules commands and programs to run on a computer at<br/>a specified time and date. The Schedule service must be running to use<br/>the AT command.<br/><br/>AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]<br/>AT [\\computername] time [/INTERACTIVE]<br/>    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"<br/><br/>\\computername     Specifies a remote computer. Commands are scheduled on the<br/>                   local computer if this parameter is omitted.<br/>id                 Is an identification number assigned to a scheduled<br/>                   command.<br/>/delete            Cancels a scheduled command. If id is omitted, all the<br/>                   scheduled commands on the computer are canceled.<br/>/yes               Used with cancel all jobs command when no further<br/>                   confirmation is desired.<br/>time               Specifies the time when command is to run.<br/>/interactive       <a href="https://interviewquestions.tuteehub.com/tag/allows-857958" style="font-weight:bold;" target="_blank" title="Click to know more about ALLOWS">ALLOWS</a> the job to interact with the desktop of the user<br/>                   who is logged on at the time the job runs.<br/>/every:date[,...]  Runs the command on each specified day(s) of the week or<br/>                   month. If date is omitted, the current day of the month<br/>                   is assumed.<br/>/next:date[,...]   Runs the specified command on the next occurrence of the<br/>                   day (for example, next <a href="https://interviewquestions.tuteehub.com/tag/thursday-344074" style="font-weight:bold;" target="_blank" title="Click to know more about THURSDAY">THURSDAY</a>).  If date is omitted, the<br/>                   current day of the month is assumed.<br/>"command"          Is the Windows NT command, or batch program to be run.<br/><br/><br/>C:\&gt; Quote from: gregflowers on February 25, 2010, 01:32:39 PM<blockquote>Scheduled Tasks manager provides an option to "Run on the 'first' 'Sunday' of the Month<br/><br/></blockquote> <br/>Duh, I feel real stupid now.  When I was originally setting up the task, I didn't select the correct options to see that I would be able to select the 'first' Sunday of the month.  But since you mentioned it, I went back and saw the option.  Thanks for your help!<br/><br/>Thank you to <a href="https://interviewquestions.tuteehub.com/tag/everyone-25922" style="font-weight:bold;" target="_blank" title="Click to know more about EVERYONE">EVERYONE</a> for replying!</body></html>
65.

Solve : UMM help needed?

Answer» <html><body><p>i am a beginner to the <a href="https://interviewquestions.tuteehub.com/tag/point-239421" style="font-weight:bold;" target="_blank" title="Click to know more about POINT">POINT</a> i dont know any coding at all.<br/>i would like to learn some to make something on DOS if some one could help i would owe you one. so if someone could teach me the <a href="https://interviewquestions.tuteehub.com/tag/basic-15343" style="font-weight:bold;" target="_blank" title="Click to know more about BASIC">BASIC</a> parts and stuff.what do you need to know the basic in every part of the word i wand to make an animation or somethingsee if this helps the animation part<br/>cls<br/>echo loading drivers.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers.. <br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers...<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers.<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers..<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers...<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loaded drivers<br/>ping localhost -n 2 &gt; nul<br/>cls<br/><br/>explanation of each part<br/>cls clears the screen<br/>ping localhost -n 2 &gt; nul is a time delay adjust the 2 for more or less time delay<br/>echo types on the screen<br/>and dint forget echo off at the <a href="https://interviewquestions.tuteehub.com/tag/top-344925" style="font-weight:bold;" target="_blank" title="Click to know more about TOP">TOP</a>(it is not in the above code) thanks i will try somethingand if your using vista add a del nul on there at the end so the whole<br/>code would be<br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>echo off<br/>cls<br/>echo loading drivers.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers.. <br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers...<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers.<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers..<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loading drivers...<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>echo loaded drivers<br/>ping localhost -n 2 &gt; nul<br/>cls<br/>del nul<br/>i dont use vista i use xp<br/><br/>and i started with echo off and atted the .bat at the end so i after an hour of typing and copy and pasting i click it to start playing and it shows up and just turns it off with out it showing the stuff i made in the thing<br/> here is part of it<br/><br/>echo off<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L} O A D  I  N  G  &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}</p><ul><li>A D  I  N  G  &gt;</li></ul><br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}{O][A]D  I  N  G &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A][D]I  N  G  &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D]<em> N  G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D}<em> N  G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D}{I][N] G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls</em></em>if you changed the example can you post the codenot the whole thing but part( the whole thing wont fit)<br/><br/>echo off<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L} O A D  I  N  G  &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping <a href="/cdn-cgi/l/&lt;klux&gt;EMAIL&lt;/klux&gt;-protection">[email protected]</a> off<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L} O A D  I  N  G  &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}<ul><li>A D  I  N  G  &gt;</li></ul><br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}{O][A]D  I  N  G &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A][D]I  N  G  &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D]<em> N  G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D}<em> N  G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D}{I][N] G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping <a href="/cdn-cgi/l/email-protection">[email protected]</a> off<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L} O A D  I  N  G  &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}<ul><li>A D  I  N  G  &gt;</li></ul><br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}{O][A]D  I  N  G &gt;<br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A][D]I  N  G  &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D]<em> N  G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D}<em> N  G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;======================&gt;<br/>echo       &lt; {L}{O}{A}{D}{I][N] G &gt;<br/>echo       &lt;======================&gt;<br/>echo<br/>echo<br/>echo<br/>cls ping localhost -n 2 &gt; nul<br/>echo<br/>echo<br/>echo<br/>echo       &lt;=====================&gt;<br/>echo       &lt; {L}<ul><li>A D  I  N  G  &gt;</li></ul><br/>echo       &lt;=====================&gt;<br/>echo<br/>echo<br/>echo<br/>cls</em></em></em></em>try this<br/> Code: <a>[Select]</a>echo off<br/>echo.<br/>echo.<br/>echo.<br/>echo        =====================<br/>echo         {L} O A D  I  N  G  <br/>echo        =====================<br/>echo.<br/>echo.<br/>echo.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo.<br/>echo.<br/>echo.<br/>echo        =====================<br/>echo         {L} O A D  I  N  G  <br/>echo        =====================<br/>echo.<br/>echo.<br/>echo.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo.<br/>echo.<br/>echo.<br/>echo        =====================<br/>echo         {L}{O][A]D  I  N  G <br/>echo        =====================<br/>echo.<br/>echo.<br/>echo.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo.<br/>echo.<br/>echo.<br/>echo        ======================<br/>echo         {L}{O}{A][D]I  N  G  <br/>echo        ======================<br/>echo.<br/>echo.<br/>echo.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo.<br/>echo.<br/>echo.<br/>echo        ======================<br/>echo         {L}{O}{A}{D] N  G <br/>echo        ======================<br/>echo.<br/>echo.<br/>echo.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo.<br/>echo.<br/>echo.<br/>echo        ======================<br/>echo         {L}{O}{A}{D} N  G <br/>echo        ======================<br/>echo.<br/>echo.<br/>echo.<br/>cls<br/>ping localhost -n 2 &gt; nul<br/>echo.<br/>echo.<br/>echo.<br/>echo        ======================<br/>echo         {L}{O}{A}{D}{I][N] G <br/>echo        ======================<br/>echo.<br/>echo.<br/>echo.<br/>pause<br/>cls<br/>dont use  &lt;,&gt; in echo untill you now a bit more <br/>p.s. dont edit a post to a response a further down post it takes longer to get helpok i wont and i see u have <br/>a . after echo do i need to add that also adot "." right after echo like this echo. make it skip a line difrence<br/><br/>no dot                  with dot<br/>echo is off<br/>the dog is big       the dog is big<br/>echo is off<br/>Adding a dot will prevent it from echoing "echo is off" (or on in some cases), if nothing is sent. In cases like this:<br/><br/>set var=<br/>echo %var%<br/><br/>The output would be<br/><br/>"echo is off"<br/><br/>But if a dot is added:<br/><br/>set var=<br/>echo. %var%<br/><br/>The output is a new line.var???<br/>and thx Quote from: BaoBao on March 07, 2010, 06:06:10 PM<blockquote>var???<br/>and thx<br/></blockquote> Var is just a variable I named. For more information about variables, look at set /? on the command prompt.</body></html>
66.

Solve : MS-DOS error handling in .bat file?

Answer» <html><body><p>I have a small .bat <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> to load a file to a <a href="https://interviewquestions.tuteehub.com/tag/server-11236" style="font-weight:bold;" target="_blank" title="Click to know more about SERVER">SERVER</a>.  I do not know how to handle errors.  I would to <a href="https://interviewquestions.tuteehub.com/tag/validate-724662" style="font-weight:bold;" target="_blank" title="Click to know more about VALIDATE">VALIDATE</a> a successful <a href="https://interviewquestions.tuteehub.com/tag/login-11607" style="font-weight:bold;" target="_blank" title="Click to know more about LOGIN">LOGIN</a>, and a successful put of the file has occurred.  Can someone help in this area of need.<br/>* Script below<br/>user<br/>rb ftptest<br/>put 12345601.inp<br/>quit<br/><br/><br/>Thanks,<br/><br/>Ron</p></body></html>
67.

Solve : How do I check if the parameter %1 exist in a batch file (IF statement)??

Answer» <html><body><p>I tried the following batch file:<br/><br/>ECHO OFF<br/>:start<br/>Echo - %1<br/>shift<br/>IF %1=="" exit<br/>pause<br/>goto start<br/><br/>and run it as shift.bat 1 2 3<br/><br/>After the 3rd parameter, I want the program to exit. However, the IF statement <br/>IF %1=="" exit<br/>is incorrect. I also tried <br/>IF %1=="" echo - Missing<br/>but this was also incorrect...<br/><br/>What is the correct syntax to evaluate if %1 is missing?both sides need to evaluate to something; in your code, once you get to the third parameter, the if <a href="https://interviewquestions.tuteehub.com/tag/becomes-894381" style="font-weight:bold;" target="_blank" title="Click to know more about BECOMES">BECOMES</a><br/> Code: <a>[Select]</a>IF =="" EXIT<br/>which is invalid syntax.<br/><br/>use:<br/> Code: <a>[Select]</a>IF "%1"=="" EXIT<br/>Of course. Need to "define" the %1 as a string.<br/>Thanks! Quote from: viking2 on February 28, 2010, 02:25:28 PM</p><blockquote>Of course. Need to "define" the %1 as a string.<br/>Thanks!<br/></blockquote> well, not really... you could just as easily do<br/><br/> Code: <a>[Select]</a>IF !%1==! EXIT<br/><br/>It's just when it expands so there is nothing on one side, it's not a valid syntax. Quote from: viking2 on February 28, 2010, 01:27:58 PM<blockquote>I tried the following batch file:<br/>What is the correct syntax to evaluate if %1 is missing?<br/></blockquote> <br/><strong>Quotes around "%1"  worked </strong> <br/><br/>C:\batch&gt;type  shift.bat<br/><br/> Code: <a>[Select]</a>ECHO OFF<br/>:start<br/>Echo - %1<br/>shift<br/>IF "%1"=="" exit /<a href="https://interviewquestions.tuteehub.com/tag/b-236590" style="font-weight:bold;" target="_blank" title="Click to know more about B">B</a><br/>pause<br/>goto start<br/><br/><strong>Output:</strong><br/><br/>C:\batch&gt;shift.bat   1 2 3 4<br/>- 1<br/>Press any key to continue . . .<br/>- 2<br/>Press any key to continue . . .<br/>- 3<br/>Press any key to continue . . .<br/>- 4<br/><br/>C:\batch&gt;<br/><br/>p.s.:  use exit /b  to exit the batch and not exit the command <a href="https://interviewquestions.tuteehub.com/tag/prompt-592976" style="font-weight:bold;" target="_blank" title="Click to know more about PROMPT">PROMPT</a> <a href="https://interviewquestions.tuteehub.com/tag/page-25452" style="font-weight:bold;" target="_blank" title="Click to know more about PAGE">PAGE</a>.</body></html>
68.

Solve : Turbo C 3.0 reboots PC (DOS 6.22)?

Answer» <html><body><p>I have an old 486 with DOS 6.22. I <a href="https://interviewquestions.tuteehub.com/tag/decided-2566952" style="font-weight:bold;" target="_blank" title="Click to know more about DECIDED">DECIDED</a> to install Turbo C 3.0. When I run Turbo C, it just cold reboots the comp with no <a href="https://interviewquestions.tuteehub.com/tag/messages-25598" style="font-weight:bold;" target="_blank" title="Click to know more about MESSAGES">MESSAGES</a> or anything. The only way to make it work is by removing HIMEM.SYS. But I <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> HIMEM for my other programs and stuff. So can anyone explain why the comp reboots and how to fix it?I got it working. I added EMM386.EXE NOEMS to my config.sys. It's not perfect <a href="https://interviewquestions.tuteehub.com/tag/though-1417450" style="font-weight:bold;" target="_blank" title="Click to know more about THOUGH">THOUGH</a>. Because of this, now some of my other programs say that they need DPMI. I got CWSDPMI and so it's ok, but it annoys me that now I need extra files.</p></body></html>
69.

Solve : 16 Bit MS DOS Subsystem?

Answer» <html><body><p>When I <a href="https://interviewquestions.tuteehub.com/tag/start-239994" style="font-weight:bold;" target="_blank" title="Click to know more about START">START</a> my computer, I receive this error:            <br/><br/>C:\Progra~1infoaxe/updater.exe<br/>the <a href="https://interviewquestions.tuteehub.com/tag/ntvdm" style="font-weight:bold;" target="_blank" title="Click to know more about NTVDM">NTVDM</a> CPU  has encountered an illegal instruction.<br/><br/>CS:0545  IP:0116 OP:63 68 65 20 54<br/><br/> <a href="https://interviewquestions.tuteehub.com/tag/choose-419254" style="font-weight:bold;" target="_blank" title="Click to know more about CHOOSE">CHOOSE</a> 'Close' to terminate the <a href="https://interviewquestions.tuteehub.com/tag/application-25616" style="font-weight:bold;" target="_blank" title="Click to know more about APPLICATION">APPLICATION</a><br/><br/><br/>  Can anyone tell me what this means and how to fix it? <br/>Thanks in advance.<br/> <br/>I  believe  "C:\Progra~1infoaxe/updater.exe"  is part of the   McAfee Security Suite.<br/>GoTo McAfee  Support.  Mcafee might have a fix for your problem?<br/><br/>or<br/>1) Replace Mcafee  with a better  anti virus.<br/>2) System Restore to day when all was well.<br/>3) <a href="https://interviewquestions.tuteehub.com/tag/run-1192138" style="font-weight:bold;" target="_blank" title="Click to know more about RUN">RUN</a>:  "C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"<br/>( download Malwarebytes' Anti-Malware Here:<br/><a href="https://download.cnet.com/Malwarebytes-Anti-Malware/3000-8022_4-10804572.html">http://download.cnet.com/Malwarebytes-Anti-Malware/3000-8022_4-10804572.html</a><br/>)<br/><br/>Good  Luck</p></body></html>
70.

Solve : Copy DOS Program?

Answer» <html><body><p>I have a DOS program that I run on an <a href="https://interviewquestions.tuteehub.com/tag/old-585313" style="font-weight:bold;" target="_blank" title="Click to know more about OLD">OLD</a> 386 with Windows95. It is called T2Map and it converts TDS RAW data into Maptech FLD files. I have no idea where the installation disk is. I really need to get this program off of the 386 onto <a href="https://interviewquestions.tuteehub.com/tag/another-876628" style="font-weight:bold;" target="_blank" title="Click to know more about ANOTHER">ANOTHER</a> computer (WindowsXP) as it is on its last legs. However, I have no clue how to do this. I am assuming I would need to copy the files that control this program onto a floppy and put them on the other computer. However, I don't know which files to get. Thanks.Do you have a folder on the old <a href="https://interviewquestions.tuteehub.com/tag/failing-2080752" style="font-weight:bold;" target="_blank" title="Click to know more about FAILING">FAILING</a> computer which contains the T2Map program? I should certainly copy everything in that, plus any subfolders. If you replicate evrything you should be OK.<br/>Ok I tried this but now all I get when I try to run the program is a blank command prompt window.Ok I replicated and have tried everything I can <a href="https://interviewquestions.tuteehub.com/tag/think-661001" style="font-weight:bold;" target="_blank" title="Click to know more about THINK">THINK</a> of (which <a href="https://interviewquestions.tuteehub.com/tag/isnt-1052315" style="font-weight:bold;" target="_blank" title="Click to know more about ISNT">ISNT</a> much  ). This is the message I am getting: C:\T2Map\T2MAP.PIF The system file is not suitable for running MS-DOS and Microsoft Windows applications. Choose 'Close' to terminate the application.<br/><br/>Please help.Try running it with Command.com instead of CMD.EXE<br/><br/>Alan<br/></p></body></html>
71.

Solve : not getting anywhere with this?

Answer» <html><body><p>I haven't much in the way of discussion about getting a firewire device to <a href="https://interviewquestions.tuteehub.com/tag/work-20377" style="font-weight:bold;" target="_blank" title="Click to know more about WORK">WORK</a> in dos. That's what I am up against presently. I have tried various <a href="https://interviewquestions.tuteehub.com/tag/codes-248149" style="font-weight:bold;" target="_blank" title="Click to know more about CODES">CODES</a> I got from the net to <a href="https://interviewquestions.tuteehub.com/tag/run-1192138" style="font-weight:bold;" target="_blank" title="Click to know more about RUN">RUN</a> my external firewire hard drive; without success. With DAT.EXE I got the error message that the scsi host adapter could not be <a href="https://interviewquestions.tuteehub.com/tag/found-458144" style="font-weight:bold;" target="_blank" title="Click to know more about FOUND">FOUND</a>. I am using an adaptec controller. My firewire drive is <a href="https://interviewquestions.tuteehub.com/tag/ide-496683" style="font-weight:bold;" target="_blank" title="Click to know more about IDE">IDE</a> while my internal hdd is scsi.</p></body></html>
72.

Solve : Writing Bat Command to pull Ip addresses from a Text file to run a scripted exe?

Answer» <html><body><p>Good Day everyone,<br/><br/>Thank you for taking the time to look at my request.<br/><br/>I currently have a  bat file that has this line. it runs that executable.<br/><br/>RebootAllPOEPorts.exe /r:POE1.txt /o:output/POE1.txt /m<br/><br/>the executable initiates a telnet <a href="https://interviewquestions.tuteehub.com/tag/session-11564" style="font-weight:bold;" target="_blank" title="Click to know more about SESSION">SESSION</a> and runs the POE1.txt file. basically a scripted telnet session.<br/><br/>The POE1.txt file looks like this:<br/><br/>172.16.1.1<br/>WAIT "Login:"<br/>SEND "current password\m"<br/>.... more commands follow<br/><br/>Currently i use this to log into a varying amount of POE's depending on the site and reset all the ports <a href="https://interviewquestions.tuteehub.com/tag/within-732414" style="font-weight:bold;" target="_blank" title="Click to know more about WITHIN">WITHIN</a> that poe. In order for me to achieve this i am using the following bat command when i have 2 switches at a site<br/><br/>RebootAllPOEPorts.exe /r:POE1.txt /o:output/POE1.txt /m<br/>RebootAllPOEPorts.exe /r:POE2.txt /o:output/POE2.txt /m<br/><br/>so it is very redundant and time consuming especially when i have 30+ POE's and i need to create a line and and i need to create a new POEx.txt file to represent each POE since the IP address is different.<br/><br/>What i would <a href="https://interviewquestions.tuteehub.com/tag/really-1178981" style="font-weight:bold;" target="_blank" title="Click to know more about REALLY">REALLY</a> like is the following<br/><br/>Basic Change:<br/><br/>     To have the main bat file prompt the user for the starting IP address and the ending IP address sequentially run the RebootALLPOEPorts.exe command. <br/>     <br/>     the first line of the <a href="https://interviewquestions.tuteehub.com/tag/scripting-11585" style="font-weight:bold;" target="_blank" title="Click to know more about SCRIPTING">SCRIPTING</a> text file the execuble reads is the IP address. That would need to be different for each one.<br/><br/>so in essence it would be somethign like this:<br/><br/>RebootPoE.bat<br/><br/>Ask user to input starting iP address<br/>Ask user to input ending Ip address ( only last octet would change . ie 172.16.1.30)<br/><br/>Run this executable multiple times. once each for each IP address in that range. IP would be in the POEx.txt<br/>RebootAllPOEPorts.exe /r:POEx.txt /o:output/POEx.txt /m<br/><br/>The output file would also need to increment with the repeat of this command so there is a log for each POE interaction.<br/><br/>I guess this needs to be some kind of looping crazy smart bat file. <br/><br/>Please help! i will be monitoring this all day to give more feedback if needed!!not that patient to spend much time reading your <a href="https://interviewquestions.tuteehub.com/tag/question-25051" style="font-weight:bold;" target="_blank" title="Click to know more about QUESTION">QUESTION</a>...<br/>i guess that you are a writer... What's the problem? You say they only vary in the last octet. So there would only be 256 possible files  you need.  Even if each was 4000 byes that should only be a total of one megabyte.<br/>So just make the d256  files, give each a name with the number in it. Like maybe you could call them job000.bat, job001.bat, job.002.bat, ... job254.bat, job255.bat and you would invoke them with a batch file you may call myjob.nat which would look like this:<br/><br/> Code: <a>[Select]</a>call job%1.bat<br/>rem all done!And you would invoke it like this<br/> Code: <a>[Select]</a>Microsoft Windows XP [Version 5.1.2600]<br/>(C) Copyright 1985-2001 Microsoft Corp.<br/><br/>d:\batch&gt;myjob 174<br/>job174.bat<br/>Welcome to Microsoft Telnet Client<br/><br/>rem all done!<br/>d:\batch&gt;Is that what you want?</p></body></html>
73.

Solve : Uninstalling hotfixes/updates?

Answer» <html><body><p>Win XP Pro SP.3 + all updates etc.<br/><br/>For experimental purposes I'd like to delete all hotfixes etc using the $NTUninstallKB..... folders which have been created in the C:\Windows folder.  <br/><br/>If in doing this the system is damaged it doesn't matter, it's a tryout machine only.<br/><br/>Can someone <a href="https://interviewquestions.tuteehub.com/tag/please-601513" style="font-weight:bold;" target="_blank" title="Click to know more about PLEASE">PLEASE</a> <a href="https://interviewquestions.tuteehub.com/tag/point-239421" style="font-weight:bold;" target="_blank" title="Click to know more about POINT">POINT</a> me in the direction of instructions on how to write a batch script which can give the necessary responses to Spuninst.exe which consist of clicking the Next box on two occasions.<br/><br/>I've tried this without success:<br/> Code: <a>[Select]</a><br/>echo off<br/>cls<br/>setlocal<br/><br/>pushd c:\windows\$ntuninstallkb951748$\spuninst\<br/><br/>echo echo. | spuninst.exe<br/>echo.<br/><br/><strong>Notice: This solution is only for the original <a href="https://interviewquestions.tuteehub.com/tag/poster-592364" style="font-weight:bold;" target="_blank" title="Click to know more about POSTER">POSTER</a>. Do not run this on your own machine.</strong><br/><br/>Spuninst has a set of switches (<em>spuninst /?</em>) that run the program in passive or silent mode, and also not to restart after an uninstall.<br/><br/> Code: <a>[Select]</a>echo off<br/>pushd %cd%<br/>for /<a href="https://interviewquestions.tuteehub.com/tag/f-236701" style="font-weight:bold;" target="_blank" title="Click to know more about F">F</a> "tokens=*" %%a in ('dir c:\windows\$nt* /b /s /a:d') do (<br/>  cd %%a<br/>  if exist .\spuninst (<br/>    cd spuninst<br/>    spuninst /passive /norestart<br/>  )<br/>)   <br/>popd   <br/><br/>I didn't do a live <a href="https://interviewquestions.tuteehub.com/tag/test-13460" style="font-weight:bold;" target="_blank" title="Click to know more about TEST">TEST</a> of the code (for obvious reasons), but substituted <em>echo</em> statements at critical points.<br/><br/>Good luck and be careful.  Thank you Sidewinder.   I've found that SpUninst.exe supports some of the shortened Setup.exe switches so will try them as well:<br/><br/> Quote from: KB886185</p><blockquote>The utility supports the following Setup switches:<br/><br/>    * /? : Show the list of installation switches.<br/>    * /u : Use Unattended mode.<br/>    * /f : Force other programs to quit when the computer shuts down.<br/>    * /z : Do not restart when the installation is completed.<br/>    * /q : Use Quiet mode (no user interaction). </blockquote> Back to report that installation and deletion of hotfixes went without a hitch.<br/><br/>Thanks again.</body></html>
74.

Solve : Searching for files within subdirectories?

Answer» <html><body><p>Sorry, this probably has been answered before but,<br/><br/>I'm trying to take a list of files that are potentially in a file, read the file and then search through a folder and all subdirectories for the files in the list.  I know how to read the list, however I do not know how to make it search all subdirectories without mapping each directory within its own nested for loop.<br/><br/>Also then conversely I want to search all files in the directories and subdirectories and have them checked off against the list to make sure there are not any extra files in the folders.<br/><br/>If someone could <a href="https://interviewquestions.tuteehub.com/tag/show-236642" style="font-weight:bold;" target="_blank" title="Click to know more about SHOW">SHOW</a> me the command for subdirectory searching or an example of it I could probably figure out how to make both of these processes work.<br/><br/>EDIT:  Something to take into consideration, these folders may have spaces in them and I do not have the power to rename said folders.  They are given to me to check, I'm not sure if this will be an issue when doing a nested for to check through but figured I'd bring it up now as opposed to after I get a potential answer only to have it blow up due to the space int he folder <a href="https://interviewquestions.tuteehub.com/tag/name-237998" style="font-weight:bold;" target="_blank" title="Click to know more about NAME">NAME</a>.Okay through some reasearch I found out how to use both "tokens=*" which would handle the spaces issue, and then I found the /R switch for the for loop but no matter how I try to use it it's always crashing.  Can someone provide an example similar to this:<br/><br/> Code: <a>[Select]</a>for /F "tokens=*" %%I in (inlist) do (<br/><br/> for /R "tokens=*" %%J in (*) do ( <br/> if %%I==%%J (echo %%I CHECK &gt;&gt; Results.txt)<br/> )<br/> <br/> echo %%I MISSING &gt;&gt; Results.txt<br/>)C:\&gt;dir /s /b *.pdf  &gt;  pdffiles.txt<br/><br/>C:\&gt;<br/><br/><br/>C:\&gt;dir /s *.pdf<br/> <br/> Volume Serial Number is F4A3-D6B3<br/><br/> Directory of C:\bin\doc\gawk\3.1.6\gawk-3.1.6<br/><br/>12/29/2007  02:48 AM         2,058,611 gawk.pdf<br/>               1 File(s)      2,058,611 bytes<br/><br/> Directory of C:\bin\doc\gawk\UnixV7<br/><br/>07/29/2007  07:07 AM            28,217 awk_V7.1.pdf<br/>07/29/2007  05:41 AM            60,796 awk_V7.pdf<br/>               2 File(s)         89,013 bytes<br/><br/> Directory of C:\bin\man\pdf<br/><br/>12/28/2007  03:45 PM           315,094 gawk-man.pdf<br/>               1 File(s)        315,094 bytes<br/><br/> Directory of C:\DELL\Docs\manual<br/><br/>09/10/2007  03:44 PM        13,980,991 eom.pdf<br/>               1 File(s)     13,980,991 bytes<br/>.<br/>.<br/>.Thanks for the reply, but I'm not looking to see subdirectories.  I need to know how to execute commands through all subdirectories.  dir shows what subdirectories are there, but I need to be able to compare the names of all files in sub directories to the name of the file in the list.<br/><br/>This is the full code that I've worked out thus far<br/><br/> Code: <a>[Select]</a>::echo off &gt; debug.txt<br/>color 0A<br/>::The preceding line turns off screen printing and sets the text color to Bright Green.<br/><br/>::Created by Scott Dean<br/><br/>for /F "tokens=*" %%I in (inlist) do (<br/>Call :ResetBool<br/>set filename=%%I<br/><br/> for %%J in (*) do (<br/> set file=%%J<br/> Call :ValidCheck<br/> )<br/> )<br/> Call :Print<br/> Call :MissingCheck<br/>pause<br/>)<br/>GoTo :EOF<br/><br/>:ValidCheck<br/>if %filename%==%file% (Goto :CheckPrint)<br/>GoTo :EOF<br/><br/>:MissingCheck<br/>if %bool%==false (GoTo :MissingPrint)<br/>GoTo :EOF<br/><br/>:CheckPrint<br/>echo %filename% CHECK &gt;&gt; Results.txt<br/>set bool=true<br/>GoTo :EOF<br/><br/>:MissingPrint<br/>echo %filename% MISSING &gt;&gt; Results.txt<br/>GoTo :EOF<br/><br/>:ResetBool<br/>set bool=false<br/>GoTo :EOF<br/><br/>:Print<br/>echo %filename% &gt;&gt; lol.txt<br/>echo %bool% &gt;&gt; rofl.txt<br/>GoTo :EOF<br/>I have one of the files listed in the inlist in the directory and that gives an appropriate response in the Results.txt.  However it seems like nothing after the ValidCheck in the nested loop executes.  I figured it has something to do w/ me sending it to the end of file, but when I remove that it will execute down all of those other regions as well.  I even tried to put new regions within the loops to send it back to specific areas after execution however it bombs before it even does anything if you put regions within the for's.<br/><br/>Thanks, Quote from: Grimbear13 on February 03, 2010, 11:26:23 AM</p><blockquote><br/>"I have one of the files listed in the inlist in the directory and that gives an appropriate response in the Results.txt.  However it seems like nothing after the ValidCheck in the nested loop executes.  I figured it has something to do w/ me sending it to the end of file, but when I remove that it will execute down all of those other regions as well.  I even tried to put new regions within the loops to send it back to specific areas after execution however it bombs before it even does anything if you put regions within the for's."<br/></blockquote> <br/>How did you create the inlist.txt   file?   Will  you post a few of the file names that are in the inlist file?<br/><br/>I tried to run your code but I'm not sure what is in the inlist  file?<br/><br/>ThanksI'm going to attempt to just give the entire package in a .zip.  I have been <a href="https://interviewquestions.tuteehub.com/tag/working-243555" style="font-weight:bold;" target="_blank" title="Click to know more about WORKING">WORKING</a> out of the New Folder thats within there just to make sure that I can get it to do the primary task first (reading the list and verifying that the names in the list match the names of the files).<br/><br/>[Saving space, attachment deleted by admin] Quote from: Grimbear13 on February 03, 2010, 12:35:02 PM<blockquote>I'm going to attempt to just give the entire package in a .zip.  I have been working out of the New Folder thats within there just to make sure that I can get it to do the primary task first (reading the list and verifying that the names in the list match the names of the files).<br/></blockquote> <br/>The zip file worked.  And the batch file ran.<br/>Of course, only one file  was found on my machine.<br/><br/>( I don't understand the need for the color change? But it worked. )<br/><br/><strong>Input:</strong><br/><br/>Review&gt;type inlist<br/><br/>Roof.txt<br/>Ceiling.txt<br/>Ground.txt<br/>Floor.txt<br/>Noob.txt<br/>Beginner.txt<br/>Decent Player.txt<br/><br/><strong>Output:</strong><br/><br/>Review&gt;type Results<br/>ts.txt<br/>Roof.txt CHECK<br/>Ceiling.txt MISSING<br/>Ground.txt MISSING<br/>Floor.txt MISSING<br/>Noob.txt MISSING<br/>Beginner.txt MISSING<br/>Roof.txt CHECK<br/>Ceiling.txt MISSING<br/>Ground.txt MISSING<br/>Floor.txt MISSING<br/>Noob.txt MISSING<br/>Beginner.txt MISSING<br/>Roof.txt CHECK<br/>Ceiling.txt MISSING<br/>Ground.txt MISSING<br/>Floor.txt MISSING<br/>Noob.txt MISSING<br/>Beginner.txt MISSING<br/>Roof.txt CHECK<br/>Ceiling.txt MISSING<br/>Ground.txt MISSING<br/>Floor.txt MISSING<br/>Noob.txt MISSING<br/>Beginner.txt MISSING<br/><br/>C:\Documents and Settings\Bill Richardson\Desktop\QA Review\QA Review&gt;<br/>Rem "color 0A"  was REMed out.<br/>Rem "echo off" was allowed to execute to cut down on volume of output<br/><br/> Code: <a>[Select]</a>echo off<br/>rem  color 0A<br/><br/>for /F "tokens=*" %%I in (inlist) do (<br/>Call :ResetBool<br/>set filename=%%I<br/><br/>        for /R %%K in (.) do (<br/>                for %%J in (*) do (<br/>                set file=%%J<br/>                Call :ValidCheck<br/>                echo HAMSTERS!<br/>)<br/>                )<br/>        Call :Print<br/>)<br/>GoTo :EOF<br/><br/>:ValidCheck<br/>if %filename%==%file% (set bool=true)<br/>GOTO :EOF<br/><br/>:Print<br/>if %bool%==true (echo %filename% CHECK &gt;&gt; Results.txt<br/>)else (echo %filename% MISSING &gt;&gt; Results.txt )<br/>GOTO:EOF<br/><br/>:ResetBool<br/>set bool=false<br/>GoTo :EOF<br/>Grim:<br/><br/>Your code works.  The only change was to change the main for loop to local variables with "setlocal enabledelayedexpansion"<br/>( I also placed all your files from the inlist in a subfolder called "trial" ).  <br/><br/> Code: <a>[Select]</a>echo off<br/><br/>setlocal enabledelayedexpansion<br/>for /F "delims=" %%i in (inlist.txt) do (<br/>rem Call :ResetBool<br/>set filename=%%i<br/>echo filename=!filename!<br/><br/><br/>        for /R %%K in (.) do (<br/>                for %%J in (*) do (<br/>                set file=%%J<br/>                Call :ValidCheck<br/>                echo HAMSTERS!<br/>)<br/>                )<br/>        Call :Print<br/>)<br/>GoTo :EOF<br/><br/>:ValidCheck<br/>if %filename%==%file% (set bool=true)<br/>GOTO :EOF<br/><br/>:Print<br/>if %bool%==true (echo %filename% CHECK &gt;&gt; Results.txt<br/>)else (echo %filename% MISSING &gt;&gt; Results.txt )<br/>GOTO:EOF<br/><br/>:ResetBool<br/>set bool=false<br/>GoTo :EOF<br/><br/><br/><br/>C:\Review\type results.txt<br/>Roof.txt CHECK<br/>Ceiling.txt CHECK<br/>Ground.txt CHECK<br/>Floor.txt CHECK<br/>Noob.txt CHECK<br/>Beginner.txt CHECK<br/>DecentPlayer.txt CHECK<br/><br/><br/>Okay, when I get some free time at work today hopefully I'll get to play around with it a bit haha.  <a href="https://interviewquestions.tuteehub.com/tag/yeah-2343023" style="font-weight:bold;" target="_blank" title="Click to know more about YEAH">YEAH</a> I knew the code worked on files in the directory, my issue was getting into subdirectories.  I'll get back to you when I try your solution thanks for all the responses.<br/><br/>The color change was because that's my favorite color scheme, and the echo off was commented out for debugging (as was the random "echo HAMSTERS!" in the one loop there was issues with execution of certain areas so I would put random outputs to make sure they were being executed...that one just got left it  )<br/><br/>Thanks Again hopefully I'll be able to get back with results.Sorry for the super delayed response, but I just got a chance to try the change you suggested and my code still isn't finding any of the files in the subdirectories.  I tried both my code with your change and your code by itself (which gave a strange error about not being able to find the file at first).  But neither of them correctly reported that the files were there.<br/><br/>Also if you were wondering why there were extra files within the lower subdirectories it's because after I get this first step done I'm going to have it check all file names to what's in the list to ensure there are no extra files either.<br/><br/>Also it error's out on the Decent Players portion because of the space in the name, can you think of a way to remedy this?Figure I'll post my latest code just to verify.  I broke out the nested loop because I'm trying to get it to terminate once it finds a match to save time.  Else for every object it will loop through the entire package and that will take considerable amounts of time with bigger packages.<br/><br/> Code: <a>[Select]</a>echo off<br/>color 0A<br/>::The preceding line turns off screen printing and sets the text color to Bright Green.<br/><br/>::Created by Scott Dean<br/><br/>::Begins to search through the inlist file to get the names of the files.<br/><br/>setlocal enabledelayedexpansion<br/>for /F "tokens=*" %%I in (inlist) do (<br/>::Calls the ResetBool function<br/>Call :ResetBool<br/>::Sets filename equal to the value found from the inlist<br/>set filename=%%I<br/><br/>::Calls the two nested loops.  It is broken out this way because batch files do not<br/>::update variables until a process is terminated(not researched found by trial and error.<br/>::Therefore when if the loops are left to run the variables are never updated and incorrect<br/>::output will be given.<br/> Call :LoopNest<br/>::Calls the Print function based on the bool variable's value will return MISSING or CHECK<br/> Call :Print<br/>)<br/>GoTo :EOF<br/><br/>::This function checks if the filename given from the inlist matches the <a href="https://interviewquestions.tuteehub.com/tag/current-240611" style="font-weight:bold;" target="_blank" title="Click to know more about CURRENT">CURRENT</a> file.<br/>:ValidCheck<br/>if %filename%==%file% (set bool=true)<br/>GOTO :EOF<br/><br/>::This function prints whether the file is missing or not.<br/>:Print<br/>if %bool%==true (echo %filename% CHECK &gt;&gt; Results.txt<br/>)else (echo %filename% MISSING &gt;&gt; Results.txt )<br/>GOTO:EOF<br/><br/>::Resets the value of the bool variable to be defaulted to false.<br/>:ResetBool<br/>set bool=false<br/>GoTo :EOF<br/><br/>::Pair of nested for's called from the first for loop.  These go into the subdirectories<br/>::and call the functions ValidCheck and BoolCheck. (May not go into subdirectories as of 02-08-2010)<br/>:LoopNest<br/>for /R %%K in (.) do (<br/> for %%J in (*) do (<br/> set file=%%J<br/> Call :ValidCheck<br/> Call :BoolCheck<br/> if %bool%==true (GOTO :EOF)<br/> )<br/> if %bool%==true (GOTO :EOF)<br/>)<br/>GOTO :EOF<br/><br/>::An attempt to break the loop cycle if the correct value is found, doesn't seem to work.<br/>:BoolCheck<br/>if %bool%==true (GOTO :EOF)when you have loops it's not really a good idea to use two colons to indicate a comment.By loops are you referring to the regions or within the loops?  I don't know standards for batches and I just find it easier to type :: rather than rem.  Also coming from a C (primarily C#) background I'm more comofortable with the :: beacuse its similar to the // comment.  I think the constant spam of rem in the code makes it harder to read.:: within the body of the loop can cause problems, since : is really a label delimiter.<br/><br/>the only "legitimate" comment is REM, and really that's just an internal command that does nothing.</body></html>
75.

Solve : For loop endline deliminator?

Answer» <html><body><p>This is the current <a href="https://interviewquestions.tuteehub.com/tag/version-1444891" style="font-weight:bold;" target="_blank" title="Click to know more about VERSION">VERSION</a> of the batch I was writing.  However when it's parsing through either the file <a href="https://interviewquestions.tuteehub.com/tag/names-237999" style="font-weight:bold;" target="_blank" title="Click to know more about NAMES">NAMES</a> or the inlist if the file name has a space in it it is breaking it down into multiple objects, using the " " as a delim.  In a for loop is there a way to make it delim at the end of a line as opposed to any white space?<br/><br/> Code: <a>[Select]</a>echo off<br/>color 0A<br/><br/>if exist !MissingFiles.txt del !MissingFiles.txt<br/><br/>setlocal enabledelayedexpansion<br/>for /f "tokens=* delims=" %%i in (inList) do (<br/>  set lit=MISSING<br/><br/>  for /f "tokens=* delims=" %%x in ('dir . /s /b') do (<br/>    if %%i==%%~nx%%~xx set lit=CHECK<br/>  )<br/><br/>  echo %%i - !lit! &gt;&gt; !MissingFiles.txt<br/>  set lit=MISSING<br/>)<br/><br/>if exist !ExtraFiles.txt del !ExtraFiles.txt<br/><br/>setlocal enabledelayedexpansion<br/>for /f "tokens=* delims=" %%j in ('dir . /s /b') do (<br/>  set lit2=EXTRA<br/><br/>  for /f "tokens=* delims=" %%y in (inList) do (<br/>    if %%y==%%~nj%%~xj set lit2=CHECK<br/>  )<br/>  echo %%~nj%%~xj - !lit2! &gt;&gt; !temp.txt<br/>  set lit2=EXTRA<br/>)<br/><br/>find "." !temp.txt | find /i /v ".doc" | find /i /v ".<a href="https://interviewquestions.tuteehub.com/tag/xls-747397" style="font-weight:bold;" target="_blank" title="Click to know more about XLS">XLS</a>" | find /i /v ".rtf" | find /i /v "MissingFiles.txt" &gt;&gt; !ExtraFiles.txt<br/><br/>del !temp.txt<br/><br/>endlocal Quote from: Grimbear13 on March 01, 2010, 09:53:05 AM</p><blockquote> In a for loop is there a way to make it delim at the end of a line as opposed to any white space?<br/></blockquote> <br/>In the for loop remove "tokens=* and delims="  By default the complete input line is read.<br/><br/>for example:<br/><br/><br/>C:\batch&gt;type  lim.bat<br/> Code: <a>[Select]</a>echo off<br/><br/>setlocal enabledelayedexpansion<br/>for /f  %%i in (inList.txt) do (<br/>  set lit=MISSING<br/>echo lit = !lit!<br/>echo %%i<br/>)<br/><strong>Output:</strong><br/><br/>C:\batch&gt; lim.bat<br/>lit = MISSING<br/>Roof.txt<br/>lit = MISSING<br/>Ceiling.txt<br/>lit = MISSING<br/>Ground.txt<br/>lit = MISSING<br/>Floor.txt<br/>lit = MISSING<br/>Noob.txt<br/>lit = MISSING<br/>Beginner.txt<br/>lit = MISSING<br/>DecentPlayer.txt<br/><br/><strong>Input:</strong><br/><br/>C:\batch&gt;type inlist.txt<br/>Roof.txt<br/>Ceiling.txt<br/>Ground.txt<br/>Floor.txt<br/>Noob.txt<br/>Beginner.txt<br/>DecentPlayer.txt<br/><br/><br/>C:\batch&gt;BillGreg, by default, delims is set to space. The program as  given does not work for me in the <a href="https://interviewquestions.tuteehub.com/tag/xp-747558" style="font-weight:bold;" target="_blank" title="Click to know more about XP">XP</a> command line.  <br/> Quote from: Geek-9pm on March 01, 2010, 03:56:22 PM<blockquote>The program as  given does not work for me in the XP command line.  <br/><br/></blockquote> Maybe because for loops you one % sign on the command prompt. Not quite sure. Quote from: Grimbear13 on March 01, 2010, 09:53:05 AM<blockquote> In a for loop is there a way to make it delim at the end of a line as opposed to any white space?<br/></blockquote> <br/>Post #1 is wrong.  Fix with  "delims="<br/><br/><br/>C:\batch&gt;type  lim.bat<br/> Code: <a>[Select]</a>echo off<br/><br/>setlocal enabledelayedexpansion<br/>for  /f "delims=" %%i in (inList.txt) do (<br/>echo %%i<br/>)<br/><strong>Output:</strong><br/>C:\batch&gt;lim.bat<br/>Roof.txt<br/>Ceiling.txt<br/>Ground.txt<br/>Floor.txt<br/>Noob.txt<br/>Beginner.txt<br/>DecentPlayer.txt<br/>January Snowy 02<br/>February Rainy 15<br/>March Sunny 25<br/><br/><br/><strong>Input:</strong><br/><br/>C:\batch&gt;type inlist.txt<br/>Roof.txt<br/>Ceiling.txt<br/>Ground.txt<br/>Floor.txt<br/>Noob.txt<br/>Beginner.txt<br/>DecentPlayer.txt<br/>January Snowy 02<br/>February Rainy 15<br/>March Sunny 25<br/><br/><br/><br/>C:\batch&gt; Quote from: greg on March 01, 2010, 04:23:29 PM<blockquote></blockquote> You're welcome  I'm sorry I got caught up in work yesterday and a collegue pointed out a possible issue.  It wasn't the spaces in the code that were causing the issue.  Whomever was naming the files that I was running this against was using an <a href="https://interviewquestions.tuteehub.com/tag/irregular-2749380" style="font-weight:bold;" target="_blank" title="Click to know more about IRREGULAR">IRREGULAR</a> dash.  Even when copying the name directly it wasn't finding it.  Thank You to everyone who replied.<br/><br/>I thought that this script worked with spaces and I even checked it against an older job I did and it worked.</body></html>
76.

Solve : cut in dos?

Answer» <html><body><p>Is there a way to cut and paste a file other than <br/><br/><a href="https://interviewquestions.tuteehub.com/tag/copy-25621" style="font-weight:bold;" target="_blank" title="Click to know more about COPY">COPY</a> C:\file.ex C:\ex<br/>del C:\ex <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: mat123 on March 03, 2010, 10:23:58 PM</p><blockquote>Is there a way to cut and paste a file other than <br/><br/>copy C:\file.ex C:\ex<br/>del C:\ex<br/></blockquote> <br/>the move <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a>.<br/><br/>Maybe it was a typo, I think he means this:<br/>cut C:\ex<br/>paste C:\file.ex<br/><br/> Quote from: Geek-9pm on March 04, 2010, 12:23:49 AM<blockquote>Maybe it was a typo, I think he means this:<br/>cut C:\ex<br/>paste C:\file.ex<br/><br/><br/></blockquote> <br/>No. He doesn't.<br/><br/>Paste is not a DOS command.<br/><br/> Quote<blockquote>No. He doesn't.<br/>Paste is not a DOS command.</blockquote> But he wants it to be.<br/>Can you make a paste <a href="https://interviewquestions.tuteehub.com/tag/program-246414" style="font-weight:bold;" target="_blank" title="Click to know more about PROGRAM">PROGRAM</a> for him in your spare time? Quote from: Geek-9pm on March 04, 2010, 12:39:35 AM<blockquote>But he wants it to be.<br/>Can you make a paste program for him in your spare time?<br/></blockquote> <br/>he wants a shorter equivalent of <br/> Code: <a>[Select]</a>copy C:\file.ex C:\ex<br/>del C:\ex<br/><br/>the shorter version is using move. Thank you for the move command it works <a href="https://interviewquestions.tuteehub.com/tag/great-2556" style="font-weight:bold;" target="_blank" title="Click to know more about GREAT">GREAT</a>.</body></html>
77.

Solve : xcopy syntax?

Answer» <html><body><p>I have a database folder that contains <a href="https://interviewquestions.tuteehub.com/tag/subfolders-1230986" style="font-weight:bold;" target="_blank" title="Click to know more about SUBFOLDERS">SUBFOLDERS</a> that each contain WORD reports by office name.  I want to create new <a href="https://interviewquestions.tuteehub.com/tag/folders-994110" style="font-weight:bold;" target="_blank" title="Click to know more about FOLDERS">FOLDERS</a> with the <a href="https://interviewquestions.tuteehub.com/tag/particular-1147539" style="font-weight:bold;" target="_blank" title="Click to know more about PARTICULAR">PARTICULAR</a> office name and all of its associated WORD reports using xcopy.  How can I accomplish this?  The hierarchy would be something <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> folder1 &gt; subfolder &gt; <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a> &gt; newfolder &gt; all same office files.  WinXP using cmd command.<br/><br/>Sure would appreciate any help I can get!</p></body></html>
78.

Solve : creating m3u playlist with batch?

Answer» <html><body><p>Hello, I'm new here and would like to request help on my playlist. I have search but gotten <a href="https://interviewquestions.tuteehub.com/tag/irrelevantaeur-1051705" style="font-weight:bold;" target="_blank" title="Click to know more about IRRELEVANT">IRRELEVANT</a> topic and thus the creation of this topic.<br/><br/>Scenario:<br/>I found and compiled working batch to <a href="https://interviewquestions.tuteehub.com/tag/create-427332" style="font-weight:bold;" target="_blank" title="Click to know more about CREATE">CREATE</a> m3u playlist and find that it saves in ANSI which means my non-english songs will end up some thing like this ".mp3". How do I get the batch to save my playlist in UTF-8 format which does accept those characters?<br/><br/>My current batch code:<br/> Code: <a>[Select]</a><a href="https://interviewquestions.tuteehub.com/tag/echo-11626" style="font-weight:bold;" target="_blank" title="Click to know more about ECHO">ECHO</a> OFF<br/>SET currentfolder="%cd%"<br/>CD ..<br/>SET upperfolder="%cd%"<br/>IF %upperfolder:~-2,-1%==\ SET upperfolder=%upperfolder:\=%<br/>CALL SET folder=%%currentfolder:%upperfolder:"=%\=%%<br/>CD %folder%<br/>TITLE Generating Playlist for %folder%<br/>ECHO.<br/>ECHO Start time: %time:~0,-3%<br/>ECHO Please wait...<br/>FOR /F "tokens=*" %%A IN ('dir /s /b *.mp3,*.wma,*.<a href="https://interviewquestions.tuteehub.com/tag/flac-462551" style="font-weight:bold;" target="_blank" title="Click to know more about FLAC">FLAC</a>') DO CALL :loop "%%~A"<br/>GOTO end<br/><br/>:loop<br/>SET file="%~1"<br/>CALL SET file2="%%file:*%currentfolder:"=%\=%%"<br/>SET file2=%file2:~0,-1%<br/>setlocal enabledelayedexpansion<br/>&gt;&gt;"%folder:"=%.m3u" ECHO !file2:"=!<br/>GOTO :EOF<br/><br/>:end<br/>ECHO End time: %time:~0,-3%<br/>ECHO <br/>PAUSE<br/><br/>Thanks in advance</p></body></html>
79.

Solve : Create line based on filename or text?

Answer» <html><body><p>I have one .txt file and one .bat file:<br/><br/>VARIABLE.TXT<br/>with one <a href="https://interviewquestions.tuteehub.com/tag/line-239358" style="font-weight:bold;" target="_blank" title="Click to know more about LINE">LINE</a>:<br/> Code: <a>[Select]</a>variabletext<br/>CREATEFILE.BAT<br/><br/>I want CREATEFILE.BAT to create a file with a filename based on the content (variabletext) of VARIABLE.TXT<br/><br/>Does anyone know if this is possible and what command to set in CREATEFILE.BAT?<br/>Many <a href="https://interviewquestions.tuteehub.com/tag/thanks-665909" style="font-weight:bold;" target="_blank" title="Click to know more about THANKS">THANKS</a> in <a href="https://interviewquestions.tuteehub.com/tag/advance-850602" style="font-weight:bold;" target="_blank" title="Click to know more about ADVANCE">ADVANCE</a>!<br/><br/>David<br/>Look at<br/>set /?<br/>at the command prompt for more information.<br/><br/>Set /p contents=echo %contents%<br/><br/>NOTE: The above will only work with the FIRST line. If you want to work with all lines, that's a whole different story.<br/>C:\&gt;type createfile.bat<br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>for /f "delims=" %%i in (variable.txt)  do (<br/>echo %%i<br/>set contents=%%i<br/>echo contents=!contents!<br/>echo newfile &gt; !contents!.txt<br/>dir "!contents!.txt"<br/>)<br/><strong>Output:</strong><br/><br/>C:\&gt;createfile.bat<br/>mynewfile<br/>contents=mynewfile<br/> Volume in drive C has no label.<br/> Volume Serial Number is F4A3-D6B3<br/><br/> <a href="https://interviewquestions.tuteehub.com/tag/directory-11615" style="font-weight:bold;" target="_blank" title="Click to know more about DIRECTORY">DIRECTORY</a> of C:\<br/><br/>03/03/2010  05:58 PM                10 mynewfile.txt<br/>               1 File(s)             10 bytes<br/>               0 Dir(s)  299,179,556,864 bytes free<br/>C:\&gt;greg,<br/><br/>Your example worked like a charm. You guys really helped me out.<br/>I appreciate it very much!<br/><br/>David</p></body></html>
80.

Solve : Using batch to insert picture in email body?

Answer» <html><body><p>Is there a way to <a href="https://interviewquestions.tuteehub.com/tag/write-746491" style="font-weight:bold;" target="_blank" title="Click to know more about WRITE">WRITE</a> a batch <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> that <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> be automatically executed, as a part of my signature, so that it will insert a picture in the body of my <a href="https://interviewquestions.tuteehub.com/tag/email-11311" style="font-weight:bold;" target="_blank" title="Click to know more about EMAIL">EMAIL</a> prior to sending? I've not found another way to <a href="https://interviewquestions.tuteehub.com/tag/accomplish-846960" style="font-weight:bold;" target="_blank" title="Click to know more about ACCOMPLISH">ACCOMPLISH</a> it, other than to manually insert it each time.<br/>Thanks in advance.<br/> Why would you want to do this in batch and what e-mail client are you using ? ?</p></body></html>
81.

Solve : menu driven batch in dos?

Answer» <html><body><p>Hi,<br/><br/>I'm completely new to MS-DOS.<br/><br/>I have a Bootable USB drive with MS-DOS 6.22 on it.  My goal is to create a batch file that can be used in a menu-driven way.  I'm able to boot into the USB drive and have DOS running.<br/><br/>here is my code:<br/><br/>ECHO off<br/>cls<br/>:start<br/>ECHO.<br/>ECHO 1. Hello 1<br/>ECHO 2. Hello 2<br/>ECHO 'Q' to exit<br/>ECHO.<br/>set choice=<br/><strong>set /p choice=Enter choice: </strong><br/>if not '%choice%'=='' set choice=%choice:~0,1%<br/>if '%choice%'=='1' goto HELLO1<br/>if '%choice%'=='2' goto HELLO2<br/>ECHO "%choice%" is not valid please try again<br/>ECHO.<br/>goto start<br/>:HELLO1<br/>ECHO HI<br/>goto end<br/>:HELLO2<br/>ECHO HOLA<br/>goto end<br/>:end<br/><br/>The <a href="https://interviewquestions.tuteehub.com/tag/line-239358" style="font-weight:bold;" target="_blank" title="Click to know more about LINE">LINE</a> in bold is my problem.  When i run this batch, it never stops to wait for input, but proceeds to continue through the script.<br/><br/>is there any way for this to work?  please help!<br/><br/>I forgot to mention, this script works fine in Windows XP cmd.exe<br/>C:\batch&gt;type menu.bat<br/> Code: <a>[Select]</a>Echo off<br/><br/>:Start<br/>cls<br/>echo TITLE MAIN MENU<br/>ECHO 1) Sub_MenuA<br/>ECHO 2) Sub_MenuB<br/>ECHO 3) Internet<br/>ECHO 4) Quit<br/>ECHO.<br/>ECHO.<br/><br/>SET /p Option=Choice:<br/>if "%Option%"=="1" GOTO Sub_MenuA<br/>if "%Option%"=="2" GOTO Sub_MenuB<br/>if "%Option%"=="3" GOTO Internet<br/>if "%Option%"=="4" GOTO EOF<br/>Goto Start<br/><br/>:Sub_MenuA<br/>echo Sub_MenuA<br/>pause<br/>Goto Start<br/>:Sub_MenuB<br/>echo Sub_MenuB<br/>pause<br/>Goto Start<br/>:Internet<br/>echo Internet<br/>"c:\program files\internet explorer\iexplore.exe" http://www.google.com/<br/>Pause<br/>Goto Start<br/>:EOF<strong>Output:</strong><br/><br/><br/>C:\batch&gt; menu.bat<br/><br/>TITLE MAIN MENU<br/>1) Sub_MenuA<br/>2) Sub_MenuB<br/>3) Internet<br/>4) Quit<br/><br/><br/>Choice: 3<br/>Internet<br/>Press any key to continue . . .Thanks greg for the reply.<br/><br/>The problem I'm having is this: "SET /p Option=Choice:"<br/><br/>A little bit about my environment: I created a bootable USB drive with MSDOS 6.22.  I boot my system up and made sure my BIOS boots from the USB drive.<br/><br/>Once i'm at the command line, I try running my menu.bat, and it becomes an infinite loop, with the menu scrolling on my screen.  The reason is because it won't stop at "SET /p Option=Choice:" to wait for user input, but proceeds to continue through until it hits "Goto Start" and loops....forever.<br/><br/>is there a way to do this in a bootable USB environment where it will wait for user input?<br/>If you are booting to DOS 6.22, the <strong>/p </strong>switch is not valid on the <strong>set</strong> statement. <br/><br/>Back in the day, there were a couple of programs (<strong>answer.com</strong> and <strong>input.com</strong>) which would prompt for information and set an environment variable to the response. You might try Google for a download. Be sure to scan the programs with your AntiVirus program.<br/><br/>Good luck.  Quote from: gonevcrazy on March 04, 2010, 12:23:12 PM</p><blockquote><br/>here is my code:<br/><br/></blockquote> <br/>C:\batch&gt;type  crazymenu.bat<br/> Code: <a>[Select]</a>ECHO off<br/>cls<br/>:start<br/>ECHO.<br/>ECHO 1. Hello 1<br/>ECHO 2. Hello 2<br/>ECHO 'Q' to exit<br/>ECHO.<br/><br/>set /p choice=Enter choice:<br/>rem if not '%choice%'=='' set choice=%choice:~0,1%<br/>if "%choice%"=="1" goto HELLO1<br/>if "%choice%"=="2" goto HELLO2<br/>if "%choice%"=="Q" goto :end<br/>ECHO "%choice%" is not valid please try again<br/>ECHO.<br/>goto start<br/>:HELLO1<br/>ECHO HI ( in Hello1 )<br/>goto start<br/>:HELLO2<br/>ECHO HOLA ( in Hello2)<br/>goto start<br/>:end<br/>C:\batch&gt; crazymenu.bat<br/><br/><strong>Output:</strong><br/><br/>1. Hello 1<br/>2. Hello 2<br/>'Q' to exit<br/><br/>Enter choice: 1<br/>HI ( in Hello1 )<br/><br/>1. Hello 1<br/>2. Hello 2<br/>'Q' to exit<br/><br/>Enter choice: 2<br/>HOLA ( in Hello2)<br/><br/>1. Hello 1<br/>2. Hello 2<br/>'Q' to exit<br/><br/>Enter choice: q<br/>"q" is not valid please try again<br/><br/><br/>1. Hello 1<br/>2. Hello 2<br/>'Q' to exit<br/><br/>Enter choice: Q<br/>C:\batch&gt; Quote from: Sidewinder on March 04, 2010, 02:06:09 PM<blockquote>If you are booting to DOS 6.22, the <strong>/p </strong>switch is not valid on the <strong>set</strong> statement. <br/><br/>Back in the day, there were a couple of programs (<strong>answer.com</strong> and <strong>input.com</strong>) which would prompt for information and set an environment variable to the response. You might try Google for a download. Be sure to scan the programs with your AntiVirus program.<br/><br/>Good luck.  <br/></blockquote> <br/>exactly the problem i'm having.  I tried looking both of those up and haven't found any solutions...&lt;&gt;<br/><br/>Another issue i'm having is whenever I've successfully booted off my USB drive into DOS, i always get asked for the current date and time.  Below is an image of what I'm talking about:<br/><br/><br/><br/>How do i get rid of this? Quote from: greg on March 04, 2010, 02:14:04 PM<blockquote></blockquote> Greg, repeating your code won't work! You will know this if you ACTUALLY LOOK AT THE POSTS MADE BY PEOPLE OTHER THAN YOURSELF!<br/> Quote from: Sidewinder on March 04, 2010, 02:06:09 PM<blockquote>If you are booting to DOS 6.22, the <strong>/p </strong>switch is not valid on the <strong>set</strong> statement. <br/><br/>Back in the day, there were a couple of programs (<strong>answer.com</strong> and <strong>input.com</strong>) which would prompt for information and set an environment variable to the response. You might try Google for a download. Be sure to scan the programs with your AntiVirus program.<br/><br/>Good luck.  <br/></blockquote> Quote from: gonevcrazy on March 04, 2010, 04:11:26 PM<blockquote>Another issue i'm having is whenever I've successfully booted off my USB drive into DOS, i always get asked for the current date and time. <br/>How do i get rid of this? <br/></blockquote> <br/>When DOS boots up, I'm sure you know it looks for Config.sys and autoexec.bat.<br/><br/>If DOS cannot find an autoexec.bat, it gets suspicious, and starts to doubt itself, so it asks you if it knows the correct time.<br/><br/>short answer: create an autoexec.bat file.<br/><br/><br/>Anyway, regarding the original question, pure DOS doesn't have a method of accepting user input built in; however, you can fake it.<br/><br/>if you make a batch like this:<br/><br/> Code: <a>[Select]</a>echo Batch Menu Selector<br/>echo Enter  your choice:<br/>echo.<br/>echo 1. Start Windows<br/>echo 2. Return to DOS<br/><br/>and then, for each choice, you create a batch file- 1.bat, 2.bat, etc. so when they enter their choice, it starts that batch file.<br/><br/>To segregate this stuff from the rest of the system, you could even put it in it's own folder, say, C:\menu :<br/><br/>so C:\menu would contain menu.bat, 1.bat, 2.bat, etc for each choice.<br/><br/>Then, if you want the menu to start automatically, you do so via autoexec.bat, by adding this to the end of the file:<br/><br/> Code: <a>[Select]</a>cd \menu<br/>menu<br/>Must be brain freeze. <br/><br/>DOS 6.22 came with a utility called <strong>choice</strong>. It only accepts a single character, but that's all you really need for this situation. Type <strong>choice /?</strong> at the command prompt for details.<br/><br/>Date and time: check the autoexec.bat file (on the USB drive) you're using and see if those two commands are included. If so that's where the prompts are coming from. How old is this machine? The battery may be dead. Modern OSes can get the date/time from a time server...DOS is not a modern OS. <br/><br/>Good luck.  <a href="http://www.shiningstar.net/geek/html/multiconfig.html">http://www.shiningstar.net/geek/html/multiconfig.html</a> Quote from: Helpmeh on March 04, 2010, 04:35:45 PM<blockquote> You will know this if you actually look at the posts made by people other than yourself.<br/></blockquote> <br/>Thanks for the tip "Helpme"<br/><br/>I have now looked at the complete thread for a solution by "Helpme" and cannot find it.  Did "Helpme" post the solution in another thread?<br/><br/>Did the solution by Sidewinder work? (answer.com and input.com)? Quote from: Sidewinder on March 04, 2010, 05:04:11 PM<blockquote>Must be brain freeze. <br/><br/>DOS 6.22 came with a utility called <strong>choice</strong>. It only accepts a single character, but that's all you really need for this situation. Type <strong>choice /?</strong> at the command prompt for details.<br/><br/></blockquote> <br/>forgot about that myself as well.<br/><br/>so it can be done in a single batch file... I don't know if I <a href="https://interviewquestions.tuteehub.com/tag/remember-621937" style="font-weight:bold;" target="_blank" title="Click to know more about REMEMBER">REMEMBER</a> choice syntax perfectly, but here goes:<br/><br/><br/> Code: <a>[Select]</a>:showmenu<br/>cls<br/>echo Batch Menu<br/>echo Please enter a choice<br/>echo.<br/>echo A. Choice Number 1<br/>echo B. Choice Number 2<br/>echo C. Choice Number 3<br/>echo.<br/>choice /c:ABC<br/>if ERRORLEVEL 3 GOTO CHOICEC<br/>if ERRORLEVEL 2 GOTO CHOICEB<br/>if ERRORLEVEL 1 GOTO CHOICEA<br/>goto showmenu<br/>:CHOICEA<br/>echo this would be choice A<br/>pause<br/>:CHOICEB<br/>echo this would be choice B<br/>pause<br/>:CHOICEC<br/>echo this would be choice C<br/>pause<br/>Thanks for the replies...I ended up <a href="https://interviewquestions.tuteehub.com/tag/reformatting-7710114" style="font-weight:bold;" target="_blank" title="Click to know more about REFORMATTING">REFORMATTING</a> my USB dirive and put windows 98SE bootdisk on it and the date issue went away.<br/><br/>As for the my original question...still no dice.  "Choice /?" comes back with "Bad File or Command".  I'm thinking during my creation of boot disk (I used HP Disk Storage Format Tool along with Windows98SE.img from bootdisk.com) that it only installs command.exe and some other files, enough to get it up and running, but none of the bells and whistles.<br/><br/>BC_Programmer: thanks...pretty hairy workaround...I'll give it a shot Quote from: gonevcrazy on March 04, 2010, 05:10:06 PM<blockquote>Thanks for the replies...I ended up reformatting my USB dirive and put windows 98SE bootdisk on it and the date issue went away.<br/><br/>As for the my original question...still no dice.  "Choice /?" comes back with "Bad File or Command".  I'm thinking during my creation of boot disk (I used HP Disk Storage Format Tool along with Windows98SE.img from bootdisk.com) that it only installs command.exe and some other files, enough to get it up and running, but none of the bells and whistles.<br/><br/>BC_Programmer: thanks...pretty hairy workaround...I'll give it a shot<br/></blockquote> <br/>Oh, wait a <a href="https://interviewquestions.tuteehub.com/tag/minute-767068" style="font-weight:bold;" target="_blank" title="Click to know more about MINUTE">MINUTE</a> here...<br/><br/>the Windows98 Boot disk is not a actual DOS installation, so it doesn't contain All of the necessary DOS files. for example, in my virtual Machine running DOS 6.22, my DOS folder is slightly <a href="https://interviewquestions.tuteehub.com/tag/larger-1067345" style="font-weight:bold;" target="_blank" title="Click to know more about LARGER">LARGER</a> then 5MB, which wouldn't fit on a floppy disk. the boot disk just contains the "important" stuff.<br/><br/> Quote from: BC_Programmer on March 04, 2010, 05:16:35 PM<blockquote>Oh, wait a minute here...<br/><br/>the Windows98 Boot disk is not a actual DOS installation, so it doesn't contain All of the necessary DOS files. for example, in my virtual Machine running DOS 6.22, my DOS folder is slightly larger then 5MB, which wouldn't fit on a floppy disk. the boot disk just contains the "important" stuff.<br/><br/><br/></blockquote> <br/>Yah it's beginning to dawn on me that my goal can't be reached via booting off the USB drive due to the fact that it's only used to boot and doesn't contain any of the extra tools like a full DOS 6.22 would have.   <br/><br/>fyi before WIN98SE boot, I used DOS6.22 boot from bootdisk.com to construct my USB drive.<br/><br/>I guess my follow-up question would be could I copy/paste those files (i.e. CHOICE.EXE or FDISK.EXE, for sake of example) onto my USB drive and run 'em like I would a command?</body></html>
82.

Solve : DOS Job Streams randomly "freezes" during execution?

Answer» <html><body><p>What would cause DOS batch job streams (that have been running successfully for ages) to randomly "freeze" between job steps or called subroutines or to totally skip over one or more commands??  <br/>This is happening on our <a href="https://interviewquestions.tuteehub.com/tag/xp-747558" style="font-weight:bold;" target="_blank" title="Click to know more about XP">XP</a> server, when running various batch backup, update or reporting processes.  Sometimes at the beginning of the job <a href="https://interviewquestions.tuteehub.com/tag/stream-11292" style="font-weight:bold;" target="_blank" title="Click to know more about STREAM">STREAM</a>, other times <a href="https://interviewquestions.tuteehub.com/tag/midway-1096255" style="font-weight:bold;" target="_blank" title="Click to know more about MIDWAY">MIDWAY</a> through a complex series of job steps.  When the job is restarted, it inevitably runs to a good conclusion. <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: R_Michael on March 04, 2010, 10:04:07 AM</p><blockquote>What would cause DOS batch job streams (that have been running successfully for ages) to randomly "freeze" between job steps or called subroutines or to totally skip over one or more commands??  <br/></blockquote> <br/>Malware eating up your RAM?  Processes running that did not <a href="https://interviewquestions.tuteehub.com/tag/shut-643388" style="font-weight:bold;" target="_blank" title="Click to know more about SHUT">SHUT</a> down on  time?  Clean the machine more often.  Temp files might be too large?<br/><br/>Good Luck Quote from: R_Michael on March 04, 2010, 10:04:07 AM<blockquote>What would cause DOS batch job streams (that have been running successfully for ages) to randomly "freeze" between job steps or called subroutines or to totally skip over one or more commands??  <br/>This is happening on our XP server, when running various batch backup, update or reporting processes.  Sometimes at the beginning of the job stream, other times midway through a complex series of job steps.  When the job is restarted, it inevitably runs to a good conclusion.<br/></blockquote> Are you seeing any errors in the original run?</body></html>
83.

Solve : Is possible to direct access MS-DOS from Win7??

Answer» <html><body><p>Hi!<br/><br/>I have installed on my computer Windows 7 Ultimate and MS-DOS 7.10.<br/>I can choose at boot which I'll start.<br/><br/>My <a href="https://interviewquestions.tuteehub.com/tag/q-236607" style="font-weight:bold;" target="_blank" title="Click to know more about Q">Q</a> is simple:<br/><br/>IS POSSIBLE TO DIRECT ACCESS MS-DOS FROM WINDOWS 7?<br/><br/>Thanks for every help.<br/><br/>MiroNo.Windows 7 is not built on a dos <a href="https://interviewquestions.tuteehub.com/tag/layer-238823" style="font-weight:bold;" target="_blank" title="Click to know more about LAYER">LAYER</a>, so there is no dos on your system at the moment. Is that what you are asking?Try <a href="https://interviewquestions.tuteehub.com/tag/vmware-723903" style="font-weight:bold;" target="_blank" title="Click to know more about VMWARE">VMWARE</a> playerWindows 7 will see the FAT volume that DOS is (<a href="https://interviewquestions.tuteehub.com/tag/necessarily-7276297" style="font-weight:bold;" target="_blank" title="Click to know more about NECESSARILY">NECESSARILY</a>) installed on, if that is what the OP is asking. As for executing DOS prpgrams, no go. 16 bit support is phased out in Windows 7. DOSbox or one of the other virtual apps is the <a href="https://interviewquestions.tuteehub.com/tag/answer-15557" style="font-weight:bold;" target="_blank" title="Click to know more about ANSWER">ANSWER</a> in that case.<br/><br/><br/></p></body></html>
84.

Solve : store xml markup as a var...?

Answer» <html><body><p>Hey,<br/><br/>I am not very experience with Batch scripting.<br/><br/>What I <a href="https://interviewquestions.tuteehub.com/tag/want-1448756" style="font-weight:bold;" target="_blank" title="Click to know more about WANT">WANT</a> to do is store  a xml file, (which is a result of a export from netsh) and store it as a variable.<br/><br/>I want to create the xml file on another computers %temp% folder and run netsh import, then delete the file.<br/><br/>This hasn't been working for me. I've <a href="https://interviewquestions.tuteehub.com/tag/highlighted-2110490" style="font-weight:bold;" target="_blank" title="Click to know more about HIGHLIGHTED">HIGHLIGHTED</a> the xml.<br/><br/> Quote</p><blockquote>echo off<br/>var xmlcontect= <strong><em>&lt;?xml version="1.0"?&gt;<br/>&lt;WLANProfile xmlns="<a href="https://www.microsoft.com/networking/WLAN/profile/v1">http://www.microsoft.com/networking/WLAN/profile/v1</a>"&gt;<br/>   &lt;name&gt;<a href="https://interviewquestions.tuteehub.com/tag/netgear" style="font-weight:bold;" target="_blank" title="Click to know more about NETGEAR">NETGEAR</a>&lt;/name&gt;<br/>   &lt;SSIDConfig&gt;<br/>      &lt;SSID&gt;<br/>         &lt;hex&gt;4E455447454152&lt;/hex&gt;<br/>         &lt;name&gt;NETGEAR&lt;/name&gt;<br/>      &lt;/SSID&gt;<br/>      &lt;nonBroadcast&gt;false&lt;/nonBroadcast&gt;<br/>   &lt;/SSIDConfig&gt;<br/>   &lt;connectionType&gt;<a href="https://interviewquestions.tuteehub.com/tag/ess-446734" style="font-weight:bold;" target="_blank" title="Click to know more about ESS">ESS</a>&lt;/connectionType&gt;<br/>   &lt;connectionMode&gt;auto&lt;/connectionMode&gt;<br/>   &lt;autoSwitch&gt;<a href="https://interviewquestions.tuteehub.com/tag/true-249005" style="font-weight:bold;" target="_blank" title="Click to know more about TRUE">TRUE</a>&lt;/autoSwitch&gt;<br/>   &lt;MSM&gt;<br/>      &lt;security&gt;<br/>         &lt;authEncryption&gt;<br/>            &lt;authentication&gt;shared&lt;/authentication&gt;<br/>            &lt;encryption&gt;WEP&lt;/encryption&gt;<br/>            &lt;useOneX&gt;false&lt;/useOneX&gt;<br/>         &lt;/authEncryption&gt;<br/>         &lt;sharedKey&gt;<br/>            &lt;keyType&gt;networkKey&lt;/keyType&gt;<br/>            &lt;protected&gt;true&lt;/protected&gt;<br/>            &lt;keyMaterial&gt;01000000D08C9DDF0115D1118C7A00C04FC297E B01000000A9CCD0C3AF3D9B408C3844D92C63BD 278000000002088000000003660000A80000001 0000000EB34D699AFE53210DA74B177A8F16C77 0000000004800000A0000000100000001281B80 A3F56BE1B8FF0104FB320C7908000000F4120C6 EE4A560461400000876D1BA154CFF7117A5587D 43EC154AC3DAA81B7B&lt;/keyMaterial&gt;<br/>         &lt;/sharedKey&gt;<br/>      &lt;/security&gt;<br/>   &lt;/MSM&gt;<br/>&lt;/WLANProfile&gt; </em></strong>&gt;&gt; %TEMP%\Wireless Network Connection-NETGEAR.xml<br/><br/><br/>netsh wlan add profile filename=”%TEMP%\Wireless Network Connection-NETGEAR.xml”<br/><br/>del /f %TEMP%\Wireless Network Connection-NETGEAR.xml<br/><br/></blockquote> Code: <a>[Select]</a>echo off<br/>more /e +6 "%~f0"&gt;"%TEMP%\Wireless Network Connection-NETGEAR.xml"<br/>netsh wlan add profile filename=”%TEMP%\Wireless Network Connection-NETGEAR.xml”<br/>del /f "%TEMP%\Wireless Network Connection-NETGEAR.xml"<br/>goto :eof<br/><br/>&lt;?xml version="1.0"?&gt;<br/>&lt;WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"&gt;<br/>   &lt;name&gt;NETGEAR&lt;/name&gt;<br/>   &lt;SSIDConfig&gt;<br/>      &lt;SSID&gt;<br/>         &lt;hex&gt;4E455447454152&lt;/hex&gt;<br/>         &lt;name&gt;NETGEAR&lt;/name&gt;<br/>      &lt;/SSID&gt;<br/>      &lt;nonBroadcast&gt;false&lt;/nonBroadcast&gt;<br/>   &lt;/SSIDConfig&gt;<br/>   &lt;connectionType&gt;ESS&lt;/connectionType&gt;<br/>   &lt;connectionMode&gt;auto&lt;/connectionMode&gt;<br/>   &lt;autoSwitch&gt;true&lt;/autoSwitch&gt;<br/>   &lt;MSM&gt;<br/>      &lt;security&gt;<br/>         &lt;authEncryption&gt;<br/>            &lt;authentication&gt;shared&lt;/authentication&gt;<br/>            &lt;encryption&gt;WEP&lt;/encryption&gt;<br/>            &lt;useOneX&gt;false&lt;/useOneX&gt;<br/>         &lt;/authEncryption&gt;<br/>         &lt;sharedKey&gt;<br/>            &lt;keyType&gt;networkKey&lt;/keyType&gt;<br/>            &lt;protected&gt;true&lt;/protected&gt;<br/>            &lt;keyMaterial&gt;01000000D08C9DDF0115D1118C7A00C04FC297E B01000000A9CCD0C3AF3D9B408C3844D92C63BD 278000000002088000000003660000A80000001 0000000EB34D699AFE53210DA74B177A8F16C77 0000000004800000A0000000100000001281B80 A3F56BE1B8FF0104FB320C7908000000F4120C6 EE4A560461400000876D1BA154CFF7117A5587D 43EC154AC3DAA81B7B&lt;/keyMaterial&gt;<br/>         &lt;/sharedKey&gt;<br/>      &lt;/security&gt;<br/>   &lt;/MSM&gt;<br/>&lt;/WLANProfile&gt;</body></html>
85.

Solve : DOS script to read a text file?

Answer» <html><body><p>Hi<br/><br/>I need a batch file to read the 1st line in a text and save that as another text file. <br/><br/>For eg. I have the 1st line in the text as abcd :1234<br/><br/>I need to read from 7th character as 1234 and store it in a variable and use this as name for another text file 1234.txt<br/><br/>I am using  for/f statement and i am not able to extract the 7th character. <br/><br/>Please help Try <a href="https://interviewquestions.tuteehub.com/tag/looking-1079184" style="font-weight:bold;" target="_blank" title="Click to know more about LOOKING">LOOKING</a> at <br/>set /?<br/>on the command prompt for more information on getting specific characters of variables.<br/><br/><br/><br/>This code would extract the 7th character of a string.<br/>set variable=%original:~6,1% Quote from: dos_help on March 02, 2010, 05:02:12 PM</p><blockquote>For eg. I have the 1st line in the text as abcd :1234<br/><br/>I need to read from 7th character as 1234 and store it in a variable <br/>I am using  for /f statement and I am not able to extract from the 7th character. <br/></blockquote> <br/><br/><br/>C:\&gt;type seven.bat<br/><br/> Code: <a>[Select]</a>echo off<br/><br/>setlocal enabledelayedexpansion<br/>for /f "delims=" %%i in  (seven.txt) do (<br/>echo %%i<br/>set seven=%%i<br/>set seven=!seven:~6,4!<br/>echo seven = !seven!<br/>echo seven &gt; !seven!.txt<br/>dir !seven!.txt<br/>)<br/><strong>Output:</strong><br/><br/>C:\&gt; seven.bat<br/>abcd :1234<br/>seven = 1234<br/> Volume in drive C has no label.<br/> Volume Serial Number is F4A3-D6B3<br/><br/> Directory of C:\<br/><br/>03/02/2010  07:24 PM                 8 1234.txt<br/>               1 File(s)              8 bytes<br/>               0 Dir(s)  299,228,622,848 bytes free<br/><br/>C:\&gt;<br/><br/><strong>Input:</strong><br/><br/>C:\&gt;type seven.txt<br/>abcd :1234<br/><br/>C:\&gt;<br/><br/>reference:<br/><a href="http://www.dostips.com/DtTipsStringManipulation.php#Snippets.RightString">http://www.dostips.com/DtTipsStringManipulation.php#Snippets.RightString</a><br/><br/> Quote from: dos_help on March 02, 2010, 05:02:12 PM<blockquote>I am using  for/f statement and i am not able to extract the 7th character. <br/><br/>Please help <br/></blockquote> use for loop with variable %%a, set delims=":" ,  tokens=1,2 , then get %%b inside the for loop Quote from: dos_help on March 02, 2010, 05:02:12 PM<blockquote>I need a batch file to read the 1st line in a text and save that as another text file. <br/></blockquote> <br/>C:\&gt;type  ghost32.bat<br/><br/> Code: <a>[Select]</a>echo off<br/><br/>setlocal enabledelayedexpansion<br/>for /f "tokens=1,2 delims=:" %%a in  (seven.txt) do (<br/>echo %%a  %%b<br/>set seven=%%b<br/>echo seven = !seven!<br/>echo seven &gt; "!seven!.txt"<br/>dir "!seven!.txt"<br/>)<br/>rem use for loop with variable %%a, set delims=":" ,  tokens=1,2 ,<br/>rem then get %%b inside the for loop<br/><br/><strong>Output:</strong><br/><br/>C:\&gt; ghost32.bat<br/>abcd   1234<br/>seven = 1234<br/> Volume in drive C has no label.<br/> Volume Serial Number is F4A3-D6B3<br/><br/> Directory of C:\<br/><br/>03/02/2010  08:35 PM                 8 <strong>1234  .txt</strong><br/>               1 File(s)              8 bytes<br/>               C:\&gt; Quote from: dos_help on March 02, 2010, 05:02:12 PM<blockquote>I need a batch file to read the 1st line in a text and save that as another text file. <br/></blockquote> <br/><br/>C:\&gt;type  sed32.bat<br/><br/> Code: <a>[Select]</a>echo off<br/>sed s/"abcd :1234"/1234/g seven.txt  1&gt; seven7.txt<br/><br/>set /p seven=&lt;seven7.txt<br/>echo seven=%seven%<br/>type seven7.txt<br/><br/>echo Hello &gt;  %seven%.txt<br/><br/>dir "%seven%.txt"<br/><strong>Output:</strong><br/><br/><br/>C:\&gt;sed32.bat<br/>seven=1234<br/>1234<br/> Volume in drive C has no label.<br/> Volume Serial Number is F4A3-D6B3<br/><br/> Directory of C:\<br/><br/>03/02/2010  08:35 PM                 8 <strong>1234  .txt</strong><br/>               1 File(s)              8 bytes<br/>               0 Dir(s)  299,224,727,552 bytes free<br/><br/>C:\&gt;this looks so familar, greg = bill ? Quote from: ghostdog74 on March 02, 2010, 09:07:46 PM<blockquote>this looks so familar, greg = bill ?<br/></blockquote> <br/>he goes by <a href="https://interviewquestions.tuteehub.com/tag/many-554478" style="font-weight:bold;" target="_blank" title="Click to know more about MANY">MANY</a> names, apparently. Quote from: BC_Programmer on March 02, 2010, 09:24:38 PM<blockquote>he goes by many names, apparently.<br/></blockquote> i wonder why he has so many names. did he get banned everytime? Quote from: dos_help on March 02, 2010, 05:02:12 PM<blockquote>I need a batch file to read the 1st line in a text and save that as another text file. <br/></blockquote> <br/>I'm sorry your thread has veered of topic.<br/><br/>I hope you have enough information to solve your problem.<br/><br/>Off topic posts should use <a href="https://interviewquestions.tuteehub.com/tag/private-11896" style="font-weight:bold;" target="_blank" title="Click to know more about PRIVATE">PRIVATE</a> mail.<br/><br/>Good luck Quote from: ghostdog74 on March 02, 2010, 09:31:19 PM<blockquote>i wonder why he has so many names. did he get banned everytime?<br/></blockquote> I think so. He's used so many accounts so far, there's no real difference here. Quote from: Helpmeh on March 03, 2010, 03:47:47 PM<blockquote> He's used so many accounts so far, there's no real difference here.<br/></blockquote> <br/>Off  topic comments should be sent by private mail.<br/><br/>p.s.:   BillRichardson's account is still <a href="https://interviewquestions.tuteehub.com/tag/active-367234" style="font-weight:bold;" target="_blank" title="Click to know more about ACTIVE">ACTIVE</a>.<br/><br/>  Summary - BillRichardson  Picture/Text <br/>Name:  BillRichardson <br/>Posts:  194 (2.694 per day) <br/>Position:  Intermediate <br/>Thanked:  15  <br/>Date Registered:  December 21, 2009, 08:19:08 AM <br/><br/><br/>--------------------------------------------------------------------------------<br/> <br/>There <a href="https://interviewquestions.tuteehub.com/tag/appears-881937" style="font-weight:bold;" target="_blank" title="Click to know more about APPEARS">APPEARS</a> to be no reason for a ban.</body></html>
86.

Solve : Using Batch file to QUERY registry data?

Answer» <html><body><p>Hi there,<br/><br/>I've never used a batch file to query a registry entry, So I believe my problem is there!<br/><br/>What I am trying to do is:<br/><br/>1 Look for a registry setting, if found, move to 5, if not, move on<br/>2 Look for another registry setting, if found, move to 6, if not, move on<br/>3 Look for another registry setting, if NOT found, move to 7, if not, move on to 8<br/>4 Look for another registry setting, if found, move to 9<br/>5 run specific uninstaller, when finished, go to 8<br/>6 run specific uninstaller, when finished, go to 8<br/>7 Install specific version of software, go to 8<br/>8 Restart machine<br/>9 Exit<br/><br/>This will be run from the startup folder and will cycle till complete, then delete itself.<br/><br/>Here is the code<br/> Code: <a>[Select]</a>ECHO OFF<br/><br/><br/>IF EXIST REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 5.58 GOTO ONE ELSE<br/>IF EXIST REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 8.0 GOTO TWO ELSE<br/>IF NOT EXIST REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 10.0 GOTO THREE<br/>IF EXIST REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 10.0 GOTO FIVE ELSE<br/><br/>:ONE<br/>START /WAIT ".\5.53\CmnUnins.exe"<br/>GOTO FOUR<br/><br/>:TWO <br/>START /WAIT ".\8.0\CmnUnins.exe"<br/>GOTO FOUR<br/><br/>:THREE<br/>START /WAIT ".\10.0\msiexec /a /forcerestart Osce10.msi"<br/>EXIT<br/><br/>:FOUR<br/>START C:\Windows\RUNDLL.EXE user.exe,exitwindowsexec<br/>EXIT<br/><br/>:FIVE<br/>; Need to add in a <a href="https://interviewquestions.tuteehub.com/tag/del-947443" style="font-weight:bold;" target="_blank" title="Click to know more about DEL">DEL</a> command for the file in the Startup menu<br/>EXIT<br/>To Test the process, I Changed the first part to:<br/> Code: <a>[Select]</a>IF NOT EXIST REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 5.58 GOTO ONE ELSE<br/>and <br/> Code: <a>[Select]</a>:ONE<br/>ECHO IT WORKS<br/>PAUSE EXIT<br/><br/><br/>But it gives me an <a href="https://interviewquestions.tuteehub.com/tag/error-25548" style="font-weight:bold;" target="_blank" title="Click to know more about ERROR">ERROR</a><br/> Code: <a>[Select]</a>Invalid Parameter(s)<br/>QUERY { PROCESS | SESSION | TERMSERVER | USER }<br/>Invalid Parameter(s)<br/>QUERY { PROCESS | SESSION | TERMSERVER | USER }<br/>Is this to do with an incorrect Reg Query? or is it to do with my user rights (Admin)?<br/><br/>Anyone able to help?<br/><br/>(If I post this on any other forums, I will place links here!)<br/><br/>BirdI'm reasonably certain you cannot use an existence test for whether a registry entry <a href="https://interviewquestions.tuteehub.com/tag/exists-979838" style="font-weight:bold;" target="_blank" title="Click to know more about EXISTS">EXISTS</a> or not.<br/><br/>Another approach would be to test the <em>errorleve</em>l.<br/><br/> Code: <a>[Select]</a>ECHO OFF<br/><br/>REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 5.58<br/>if not errorlevel 1 goto one<br/>REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 8.0 <br/>if not errorlevel 1 GOTO TWO <br/>REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 10.0 <br/>if errorlevel 1 GOTO THREE<br/>REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer /t REG_SZ /d 10.0 <br/>if not errorlevel 1 GOTO FIVE  <br/><br/>:ONE<br/>START /WAIT ".\5.53\CmnUnins.exe"<br/>GOTO FOUR<br/><br/>:TWO <br/>START /WAIT ".\8.0\CmnUnins.exe"<br/>GOTO FOUR<br/><br/>:THREE<br/>START /WAIT ".\10.0\msiexec /a /forcerestart Osce10.msi"<br/>EXIT<br/><br/>:FOUR<br/>START C:\Windows\RUNDLL.EXE user.exe,exitwindowsexec<br/>EXIT<br/><br/>:FIVE<br/>; Need to add in a DEL command for the file in the Startup menu<br/>EXIT<br/><br/>Good luck.  Now it comes up with the error:<br/><br/> Code: <a>[Select]</a>Error: Too many command line parameters<br/>BLYAT!<br/><br/>Any clues anyone?Where are you getting all those <strong>reg query</strong> switches from? According to <strong>reg query /?</strong>, the only switches available are /v, /ve and /s.<br/><br/>This line <strong>START /WAIT ".\10.0\msiexec /a /forcerestart Osce10.msi"</strong> should be <strong>START /WAIT ".\10.0\msiexec /a Osce10.msi  /forcerestart"</strong><br/><br/>You might also consider turning on the /passive switch for msiexec. As long as you're writing a batch file, you may not want to be bothered with those pesky interactive prompts.<br/><br/>Try using the /? switch for command line help. There is a wealth of <a href="https://interviewquestions.tuteehub.com/tag/information-238790" style="font-weight:bold;" target="_blank" title="Click to know more about INFORMATION">INFORMATION</a> awaiting you.<br/><br/> Sidewinder,<br/><br/>The switches are from various other boards - and I have used them before - but here they are not working for me now - no idea if they are version specific, or to do with the expanded syntax that can be installed from the server CDs!!??!!<br/><br/>What I am trying (and failing!! GRRR!) to do is basically to find out which version of a program is installed - in this case Trend's Office Scan Client - , then use the correct uninstaller to remove it from the target PC, restart the PC and recheck - if it finds no key, install v10 and finally delete the files from the startup folder.<br/><br/>If you can suggest another way of doing this - I'd be most grateful!I haven't got those keys on my system, but assuming you typed out the correct keys, you may need to do something like this:<br/><br/> Code: <a>[Select]</a>echo off<br/>for /f "skip=4 tokens=1-3*" %%i in ('REG QUERY HKLM\Software\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc /v ProgramVer') do (<br/>  set pgmVer=%%k<br/>)<br/>echo %pgmVer%<br/><br/>The %%k token will have the version number, the value of which can be persisted by setting a variable to the value of the %%k temporary token.<br/><br/>Hope this helps.  Quote from: Sidewinder on March 02, 2010, 01:56:20 PM</p><blockquote>The %%k token will have the version number, the value of which can be persisted by setting a variable to the value of the %%k temporary token.</blockquote> <br/>Your going way past my level here! :-) Can you explain a bit further though, as I really would like to understand how to go that next step and setup the variable  -  would I use 'IF / ELSE'? Code: <a>[Select]</a>echo off<br/><br/>reg query hklm\software\trendmicro\pc-cillinntcorp\currentversion\misc /v programver<br/>if errorlevel 1 goto three<br/><br/>for /f "tokens=3" %%i in ('reg query hklm\software\trendmicro\pc-cillinntcorp\currentversion\misc /v programver') do (<br/>  if %%i equ 5.58 goto one<br/>  if %%i equ 8.0  goto two<br/>  if %%i equ 10.0 goto five<br/>  goto three<br/>)<br/><br/>:one<br/>start /wait ".\5.53\cmnunins.exe"<br/>goto four<br/><br/>:two <br/>start /wait ".\8.0\cmnunins.exe"<br/>goto four<br/><br/>:three<br/>start /wait ".\10.0\msiexec /a osce10.msi /forcerestart"<br/>exit<br/><br/>:four<br/>start c:\windows\rundll.exe user.exe,exitwindowsexec<br/>exit<br/><br/>:five<br/>:: need to add in a del command for the file in the startup menu<br/>exit<br/><br/>Based on your original code, I came up with this. I added an extra <strong>reg query</strong> so the batch file would not error out before it got to the <strong>for</strong> instruction. You might want to change the target of the <strong>goto</strong>.<br/><br/>If you run the <strong>reg query</strong> from the prompt, you'll notice that the version is in the third chunk of data on the last line. I simply skipped the other lines (including the blanks) and extracted the version to do the compares. Run  <strong>for /?</strong> at the prompt for a detailed explanation.<br/><br/>The <a href="https://interviewquestions.tuteehub.com/tag/directory-11615" style="font-weight:bold;" target="_blank" title="Click to know more about DIRECTORY">DIRECTORY</a> in :one (5.53) does not match the <strong>if</strong> statement (5.58). Is there a reason for this?<br/><br/>After uninstalling an older version, why are you skipping over :three and not installing the latest and greatest version? Just curious.  <br/><br/>  Quote from: Sidewinder on March 02, 2010, 11:36:21 AM<blockquote>Where are you getting all those <strong>reg query</strong> switches from? According to <strong>reg query /?</strong>, the only switches available are /v, /ve and /s.<br/></blockquote> <br/>The switches he is using were added starting with Windows Vista:<br/><br/> Quote<blockquote>REG QUERY KeyName [/v [ValueName] | /ve] [/s]<br/>          [/f Data [/k] [/d] [/c] [/e]] [/t Type] [/z] [/se Separator]<br/><br/>  KeyName  [\\Machine\]FullKey<br/>           Machine - Name of remote machine, omitting defaults to the<br/>                     current machine. Only HKLM and HKU are available on<br/>                     remote machines<br/>           FullKey - in the form of ROOTKEY\SubKey name<br/>                ROOTKEY - [ HKLM | HKCU | HKCR | HKU | HKCC ]<br/>                SubKey  - The full name of a registry key under the<br/>                          selected ROOTKEY<br/><br/>  /v       Queries for a specific registry key values.<br/>           If omitted, all values for the key are queried.<br/><br/>           Argument to this switch can be optional only when specified<br/>           along with /f switch. This specifies to search in valuenames only.<br/><br/>  /ve      Queries for the default value or empty value name (Default).<br/><br/>  /s       Queries all subkeys and values recursively (like dir /s).<br/><br/>  /se      Specifies the separator (length of 1 character only) in<br/>           data string for REG_MULTI_SZ. Defaults to "\0" as the separator.<br/><br/>  /f       Specifies the data or pattern to search for.<br/>           Use double quotes if a string contains spaces. Default is "*".<br/><br/>  /k       Specifies to search in key names only.<br/><br/>  /d       Specifies the search in data only.<br/><br/>  /c       Specifies that the search is case sensitive.<br/>           The default search is case insensitive.<br/><br/>  /e       Specifies to return only exact matches.<br/>           By default all the matches are returned.<br/><br/>  /t       Specifies registry value data type.<br/>           Valid types are:<br/>             REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ,<br/>             REG_DWORD, REG_BINARY, REG_NONE<br/>           Defaults to all types.<br/><br/>  /z       Verbose: Shows the numeric equivalent for the type of the valuename.<br/></blockquote> <br/>However, they are listing their OS as XP, which probably explains the error message regarding Too many parameters they got in their original code.<br/><br/><br/><br/></body></html>
87.

Solve : Can't run dos from Hdd??

Answer» <html><body><p>Ok so a few weeks ago i pulled out my dads <a href="https://interviewquestions.tuteehub.com/tag/old-585313" style="font-weight:bold;" target="_blank" title="Click to know more about OLD">OLD</a> compaq presario 433. I turned it on and it said <br/>missing operating sys. so i tried to install dos. the a drive didn't read. i replaced the drive and <a href="https://interviewquestions.tuteehub.com/tag/installed-499454" style="font-weight:bold;" target="_blank" title="Click to know more about INSTALLED">INSTALLED</a> dos 6.22. after installation the computer restarted and said missing os again? why. So using a floppy hdd for dos  meaning i have a floppy as my hdd. i put that in and it worked so i changed the dir. from A:\ to C:\ <br/>the hdd seems to have all sys files why won't it work?if you used the Fdisk command to make the partition you need a partition activeso i sould delete partition make a new one and install again?Yes. Use the FDISK program from MSDOS from the floppy.<br/>Make a single partition. Not too big. Don't forget to make it active.<br/>Don't try to make a partition above 2GB.<br/>Then reboot from floppy and do:<br/>format c:/s<br/>After that you can boot from the C: drive.<br/>he doesn't have to remake it if it is already under 2 GB just make it active. Quote from: mat123 on March 07, 2010, 07:00:51 AM</p><blockquote>he doesn't have to remake it if it is already under 2 GB just make it active.<br/></blockquote> Not true.how is it not true?The FDISK program in WIndows <a href="https://interviewquestions.tuteehub.com/tag/98-malyana-ka-rinae-samajhata-para-hasatakashhara-236807" style="font-weight:bold;" target="_blank" title="Click to know more about 98">98</a> differs from earlier versions. Did he say he used the actual FDISK for MSDOS and that no other program was used to create partitions?<br/>The 2GB pr less partition must be the first on the drive and the drive must be partitioned by a program that conforms to the MS-DOS limitations about <a href="https://interviewquestions.tuteehub.com/tag/large-1066424" style="font-weight:bold;" target="_blank" title="Click to know more about LARGE">LARGE</a> drives. The BIOS should also conform to the MS DOS limitation.<br/><br/> Quote<blockquote>  (b) 2 GB (gigabytes) includes a limit of 1024 cylinders per drive<br/>       imposed by the standard AT ROM BIOS interrupt 13 protocol.<br/></blockquote> <a href="https://support.microsoft.com/kb/69912">http://support.microsoft.com/kb/69912</a><br/><br/>In short, you end of with a drive that can not be of much piratical use for other Operating systems. Better to just use an old 1.5 GB drive for DOS.<br/><br/><em>Now if I am wrong about his please correct me. I am depending on memory, which is not getting very old, Version 72..</em><br/><br/><br/><br/>that makes since I'm familiar from 98 upThanks a lot guys every-thing works! Anyway just saying my hdd is only 540mg but just to know is it possible to make a hdd bigger when creating a new partition? Because the only thing i'm going to use this computer for is old dos games for the work better in original dos rather then win 98I've created partitions with Windows 2000 and XP and it worked fine to install DOS 6.22....<br/><br/>Windows 98's FDISK only creates partitions that cannot be used with DOS when you create one larger then 2GB.<br/><br/>And the only reason is because that is beyond the limit of FAT, not because of some inherent flaw in the way it was partitioned.<br/><br/>You don't even need to say N to the "Enable Large disk support for drives &gt;2GB?" prompt. as long as you make your drives &lt;2GB you can use them with DOS, it doesn't matter what OS you create the partitions with or what your format them with- you can use FDISK, you can use Windows XP's Disk management with the drive attached in an enclosure; you could use gparted, if you wanted to. as long as the drive &lt; 2GB DOS can format it. (not counting SCSI drives)<br/><br/>Actually, there is a  single exception- some older NT OS's can format FAT drives up to 4GB using 64K clusters. these have problems being used in Any other OS, including DOS, Windows 95, 98, and ME. this "feature" was removed starting with Windows 2000.<br/><br/><br/><br/>BC is ignoring the 1024 issue. Just because it has not bit you yet does not mean it will never bite. <em>We are talking about using older versions of DOS that do not have the 1024 thing fixed.</em> Or the BIOS does not get the needed support for DOS. <br/><br/>Maybe BC was born after that period  of PC history.The context here is about old PCs and old Operating systems. There was a transition period where the OS and the BIOS did not fully understand each other when large hard drives with more that 1024 cylinders became popular. In some cases the only effective remedy was to pin the dive so that it had a much smaller capacity.<br/><br/>And at one time this problem was also in Linux, so it is not all a Microsoft thing.<br/><br/><em>These comments do not apply to newer PCs and newer OS.</em><br/> Quote<blockquote>BC is ignoring the 1024 issue. Just because it has not bit you yet does not mean it will never bite. We are talking about using older versions of DOS that do not have the 1024 thing fixed. Or the BIOS does not get the needed support for DOS. <br/></blockquote> <br/>No I'm not. I actually saw the OP's OS selection:<br/> Quote<blockquote>installed dos 6.22<br/></blockquote> <br/><br/>Additionally, the "1024 issue" was purely an issue relating to the BIOS, or more precisely, INT 13H. And, even more relevant, is it simply prevented you from using the full size of the drive.<br/><br/>It didn't stop you from using disk <a href="https://interviewquestions.tuteehub.com/tag/space-239477" style="font-weight:bold;" target="_blank" title="Click to know more about SPACE">SPACE</a> within the first 8.5GB, regardless of who allocated it.  If you create a 2GB partition and a 78GB partition on one disk, you can safely install DOS on the 2GB partition and windows 2000 or XP or whatever on the 78GB partition, and freely boot between them. You will be able to access the 2GB partition from the windows installation but you will not be able to access the Windows partition from the DOS install.<br/><br/>Also, we don't have to worry about the 1024 cylinder limit at all to begin with, since the BIOS of the compaq presario 433 is limited to 220MB and will only use the first 220MB of any disk you install anyway.<br/><br/></body></html>
88.

Solve : How to disable protection of longfilename in MD-DOS 7.10??

Answer» <html><body><p>Hi!<br/><br/>I have problem with protection of longfilename support in MS-DOS 7.10.<br/><br/>I'm using application which sometimes outputs "System <a href="https://interviewquestions.tuteehub.com/tag/halted-7686401" style="font-weight:bold;" target="_blank" title="Click to know more about HALTED">HALTED</a>... look at LOCK /?... Press Ctrl+Alt+Del to reboot..."<br/>- and this is reason why I <a href="https://interviewquestions.tuteehub.com/tag/must-1702064" style="font-weight:bold;" target="_blank" title="Click to know more about MUST">MUST</a> to restart computer.<br/><br/>I tried LOCK command help, output is:<br/>LOCK [drive:] to enable direct disk access...<br/><a href="https://interviewquestions.tuteehub.com/tag/also-373387" style="font-weight:bold;" target="_blank" title="Click to know more about ALSO">ALSO</a> UNLOCK help:<br/>UNLOCK [drive:] to disable direct disk access<br/><br/>So, can anybody help me with this problem?<br/><br/>Thanks for every help.<br/><br/>Mirotype at the prompt <br/>LOCK C:\<br/>or<br/>LOCK C:<br/>where C:\ C: is your drive letterThanks.<br/><br/>It works.<br/><br/>I <a href="https://interviewquestions.tuteehub.com/tag/add-361838" style="font-weight:bold;" target="_blank" title="Click to know more about ADD">ADD</a> to AUTOEXEC.BAT line:<br/>LOCK C:\<br/>...but<br/>when system starts <a href="https://interviewquestions.tuteehub.com/tag/everytime-2623177" style="font-weight:bold;" target="_blank" title="Click to know more about EVERYTIME">EVERYTIME</a> asks me that I really want to do this Y/N...<br/><br/>Can it be done automatically without this question?<br/><br/>Thanks for every help.<br/><br/>Mirotry this<br/><br/> Code: <a>[Select]</a>echo y | LOCK C:\Thank you very much, it works properly.<br/><br/>Miro</p></body></html>
89.

Solve : Data Manipulation?

Answer» <html><body><p>I need this in DOS only:<br/><br/>I have a file which contains a list of paths with filenames, how do I retrieve everything up to the last backslash, and the filename into separate variables?<br/><br/>\\UBIX\RPTOUT\EXT\file001.txt<br/>\\UBIX\FIN\payments.csv<br/>\\UBIX\INT\EXT\ioweyou_bal_02242010.csv<br/>\\UBIX\commisiom_sum_YTD_20100224.pdf<br/><br/><br/>so I want VAR1 have the path<br/>and want VAR2 have the filenameHere's one method:  (where Trial.txt is the file containing input data)<br/><br/> Code: <a>[Select]</a>echo off<br/>cls<br/>setlocal enabledelayedexpansion<br/><br/>for /<a href="https://interviewquestions.tuteehub.com/tag/f-236701" style="font-weight:bold;" target="_blank" title="Click to know more about F">F</a> "delims=*" %%1 in (trial.txt) do (<br/>    set var1=%%~dp1<br/>    set var2=%%~n1<br/>)<br/>echo.&amp;echo.&amp;echo.&amp;echo.<br/>echo    Example of output is:  Var1=%var1%  Var2=%var2%<br/><br/> Quote from: Dusty on February 24, 2010, 03:05:09 PM</p><blockquote><br/> Code: <a>[Select]</a>    set var2=%%~n1<br/><br/></blockquote> <br/>%%~nx1 maybe?<br/> Quote from: S.Trout<blockquote>%%~nx1 maybe?</blockquote> <br/>Yes, maybe and perhaps, but the OP asked Quote from: OP<blockquote>how do I retrieve <strong>everything up to the last backslash</strong>, and the <strong>filename</strong> into separate variables?...   I want VAR1 have the path<br/>and want VAR2 have the <strong>filename</strong></blockquote> so that's what was provided.   <br/><br/>If the filename.extension was wanted as Var2 I'm sure the OP would have writ that in his/her specifications seeing as how he/she lists his/her experience level as Expert and as an expert would know how that a spec has to be correct.   But then I'm just a Beginner and so am probably wrong - again.<br/><br/>Mein English readinks tells me zat der extenshun ist nicht part of der filename.<br/><br/>Thanks for dropping in DDV.<br/><br/>a filename without the extension is called the basename. I imagine they meant they wanted the filename (basename + extension) Code: <a>[Select]</a>Set objFS = CreateObject("Scripting.FileSystemObject")<br/>Set objArgs = WScript.Arguments<br/>strFile = objArgs(0)<br/>Set objFile = objFS.OpenTextFile(strFile)<br/>Do Until objFile.AtEndOfLine<br/> strLine=objFile.ReadLine<br/> s = Split(strLine,"\")<br/> filename=s(UBound(s))<br/> s(UBound(s)) = "" <br/> WScript.Echo filename &amp; " "&amp; Join(s,"\")<br/>Loop<br/> Quote from: et_phonehome_2 on February 24, 2010, 10:43:42 AM<blockquote>"So I want VAR1 have the path<br/>And want VAR2 have the filename"<br/></blockquote> <br/>( see dusty, reply 1 this thread. )<br/><br/>C:\&gt;type  dusty.bat<br/><br/> Code: <a>[Select]</a>echo off<br/>rem cls<br/>setlocal enabledelayedexpansion<br/><br/>for /f "delims=*" %%1 in (trial.txt) do (<br/>    set var1=%%~dp1<br/>    set var2=%%~n1<br/>)<br/>echo.&amp;echo.&amp;echo.&amp;echo.<br/>echo    Example of output is:  Var1=%var1%  Var2=%var2%<br/><br/>C:\&gt;type trial.txt<br/><br/>C:\WINDOWS\system32\rstrui.exe<br/>C:\&gt;<br/><br/><strong>Output:</strong><br/>C:\&gt;dusty.bat<br/><br/>   Example of output is:  <strong>Var1=C:\WINDOWS\system32\  Var2=rstrui</strong><br/><br/>C:\&gt; Quote from: et_phonehome_2 on February 24, 2010, 10:43:42 AM<blockquote>"So I want VAR1 have the path<br/>And want VAR2 have the filename."<br/></blockquote> <br/><br/>C:\batch&gt;type dusty.bat<br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/><br/>for /f  %%1 in (trial.txt) do (<br/>    set var1=%%~dp1<br/>    set var2=%%~nx1<br/>echo.&amp;echo.&amp;echo.&amp;echo.<br/>echo Var1=!var1!  Var2=!var2!)<br/><strong>Input:</strong><br/>C:\batch&gt;type trial.txt<br/><br/>C:\WINDOWS\system32\rstrui.exe<br/>C:\WINDOWS\system32\notepad.exe<br/>C:\batch&gt;<br/><br/><strong>Output:</strong><br/>C:\batch&gt;dusty.bat<br/><br/>Var1=C:\WINDOWS\system32\  Var2=rstrui.exe<br/>Var1=C:\WINDOWS\system32\  Var2=notepad.exe<br/><br/>C:\batch&gt; Quote from: Dusty on February 25, 2010, 01:28:14 AM<blockquote>Yes, maybe and perhaps, but the OP asked  so that's what was provided.   <br/><br/>If the filename.extension was wanted as Var2 I'm sure the OP would have writ that in his/her specifications seeing as how he/she lists his/her experience level as Expert and as an expert would know how that a spec has to be correct.   But then I'm just a Beginner and so am probably wrong - again.<br/><br/>Mein English readinks tells me zat der extenshun ist nicht part of der filename.<br/><br/>Thanks for dropping in DDV.<br/><br/><br/></blockquote> <br/>Technically, the extension is not part of the filename, but most people seem to think of them as one thing. Also, the OP mentioned he wanted to split the full path + name string into 2 <a href="https://interviewquestions.tuteehub.com/tag/parts-239415" style="font-weight:bold;" target="_blank" title="Click to know more about PARTS">PARTS</a>, not three, so I assumed he wanted the extension kept.<br/><br/> Quote<blockquote>Thanks for dropping in DDV.</blockquote> <br/>Is that intended to be sarcasm?<br/><br/> Quote from: Dusty on February 25, 2010, 01:28:14 AM<blockquote><br/>"Mein English readinks tells me zat der extenshun ist nicht part of der filename."<br/></blockquote> <br/><br/>"Mein Englisch erzählt mir, dass der extention nicht Teil vom Dateinamen ist"<br/><br/><a href="http://www.freetranslation.com/">http://www.freetranslation.com/</a><br/> Quote from: BC_Programmer on February 25, 2010, 01:54:29 AM<blockquote>a filename without the extension is called the basename. I imagine they meant they wanted the filename (basename + extension)<br/></blockquote> <br/>BC_P thank you.  In For/? MS states that:<br/> Quote<blockquote><br/>    %~nI        - expands %I to a <strong>file name</strong> only<br/>    <br/></blockquote> not a basename so it seems that file name and extension are to be treated as separate entities.  The var is expanded without an extension. <br/><br/> Quote from: Salmon Trout on February 25, 2010, 11:57:07 AM<blockquote>Is that intended to be sarcasm?<br/></blockquote>   <br/>Most certainly not.<br/><br/>On re-reading the OP's post I realize that the request was for a solution "in DOS only" although the DOS version was not mentioned and I gave a possible solution based on the XP/NT command shell so probably got that wrong.  Apologies to the OP.<br/><br/><br/>In my opinion, <em>basename.ext</em> is a filename, despite what the FOR help says. <br/><br/> Quote<blockquote>The exact definition, giving the criteria for deciding what part of the file name is its extension, belongs to the rules of the specific filesystem used; usually the extension is the substring which follows the last occurrence, if any, of the dot character. </blockquote> <br/><a href="https://en.wikipedia.org/wiki/Filename_extension">http://en.wikipedia.org/wiki/Filename_extension</a><br/><br/> Quote<blockquote>Many operating systems, including MS-DOS, <a href="https://interviewquestions.tuteehub.com/tag/microsoft-12847" style="font-weight:bold;" target="_blank" title="Click to know more about MICROSOFT">MICROSOFT</a> Windows, and VMS systems, allow a filename extension that consists of one or more characters following the last period in the filename, thus dividing the filename into two parts: the basename (the <a href="https://interviewquestions.tuteehub.com/tag/primary-1165403" style="font-weight:bold;" target="_blank" title="Click to know more about PRIMARY">PRIMARY</a> filename) and the extension (usually indicating the file type associated with a certain file format). On these systems the extension is considered part of the filename, and on systems which allow (for example) an eight character basename followed by a three character extension, a filename with an extension of "" or "   " (nothing, or three spaces) will still be 11 characters long (since the "." is supplied, but not considered as part of the name, by the OS). On Unix-like  systems, files will often have an extension (for example prog.c, denoting the C-language source code of a program called "prog"); but since the extension is not considered a separate part of the filename, a file on a Unix system which allows 14-character filenames, and with a filename which uses "."  as an "extension separator" or "delimiter", could possibly have a filename such as a.longxtension</blockquote> <br/><a href="https://en.wikipedia.org/wiki/Filename">http://en.wikipedia.org/wiki/Filename</a><br/><br/><br/><br/><br/>How do we split hairs? Quote from: Dusty on February 25, 2010, 01:27:11 PM<blockquote>On re-reading the OP's post I realize that the request was for a solution "in DOS only" although the DOS version was not mentioned and I gave a possible solution based on the XP/NT command shell so probably got that wrong.  Apologies to the OP.</blockquote> <br/>This looks distinctly un DOS-like<br/><br/> Quote<blockquote>\\UBIX\INT\EXT\ioweyou_bal_02242010.csv</blockquote> <br/>So I expect the OP has <a href="https://interviewquestions.tuteehub.com/tag/made-1082584" style="font-weight:bold;" target="_blank" title="Click to know more about MADE">MADE</a> the tiresomely frequent error of calling Windows NT family command script language "DOS".<br/> Quote from: greg on February 25, 2010, 01:47:08 PM<blockquote>How do we split hairs?<br/></blockquote> <br/>With Occam's razor.<br/></body></html>
90.

Solve : cd key bat file not working?

Answer» <html><body><p>I'm making a bat file that needs a <a href="https://interviewquestions.tuteehub.com/tag/cd-236847" style="font-weight:bold;" target="_blank" title="Click to know more about CD">CD</a> key to start installation of a program that I made  but it doesn't accept the key I made with the code and with any key it gives this error "missing operator". The code for the bat file is<br/> Code: <a>[Select]</a>echo off<br/>rem xxxxx-xx-xxx-x<br/>rem xxxxx-xx-xxx-3<br/>rem xxxxx-xx-112-3<br/>rem xxxxx-22-112-3<br/>rem 03256-22-112-3<br/>rem 03256/22-112/3=12<br/>cls<br/>echo.<br/>echo.<br/>echo.<br/>echo welcome %USERNAME% to random <a href="https://interviewquestions.tuteehub.com/tag/desktop-949558" style="font-weight:bold;" target="_blank" title="Click to know more about DESKTOP">DESKTOP</a> wallpaper installer by Matthew fosdick<br/>pause<br/>cls<br/>echo.<br/>echo.<br/>echo.<br/>echo you will need 9 photos, you CD key, this CD, and aprox. 12.3 MB Hard disk space.<br/>pause<br/>cls<br/>:CD<br/>echo.<br/>echo.<br/>echo.<br/>echo please enter the first 6 digits of your CD key. EX. 123456-xx-xxx-x<br/>set /<a href="https://interviewquestions.tuteehub.com/tag/p-236832" style="font-weight:bold;" target="_blank" title="Click to know more about P">P</a> key1=key:<br/>cls<br/>echo Thank you. please enter the next 2 digits of your CD key. EX. xxxxxx-78-xxx-x<br/>set /p key2=key:<br/>cls<br/>echo Thank you. please enter the next 3 digits of your CD key. EX. xxxxxx-xx-901-x<br/>set /p key3=key:<br/>cls<br/>echo Thank you. please enter the last digits of your CD key. EX. xxxxxx-xx-xxx-2<br/>set /p key4=key:<br/>cls<br/>echo Thank you. We will check your key in the moment.<br/>pause<br/>set /a c="%key1%/%key2%'<br/>set /a d="%c%-%key3%<br/>set /a e="%d%/%key4%<br/>if "%e%"=="12" goto con<br/>goto CD<br/><br/>:con<br/>echo Thank you. we will begin installation in a moment<br/>pause<br/>What key are you attempting to use?the key is at the top of the bat file<br/>it is 03256-22-112-3<br/>Try removing the leading 0. So the first number would be 3256 instead of 03256.iI dont get a missing operator error any more but pause command at the end is not working.Sometimes the /a switch of the set command can confuse numbers with leading zeros with something else that requires more operators.Here's your problem-<br/><br/> Code: <a>[Select]</a>set /a c="%key1%/%key2%'<br/>set /a d="%c%-%key3%<br/>set /a e="%d%/%key4%<br/>1. The missing operator message is caused by those quotes which should either not be there (preferably) or at least match them start and end if you insist on having them (why?)<br/>2. A leading zero causes set /a to read the number as an octal value.<br/>3. See below <br/><br/> Code: <a>[Select]</a>echo off<br/>rem correct key is 03256-22-112-3<br/>rem therefore...<br/>set key1=03256<br/>set key2=22<br/>set key3=112<br/>set key4=3<br/><br/>rem neutralize any leading zeroes for each key<br/><br/>rem key1 has 5 digits so add 100000 (by prepending a 1)<br/>set key1string=1%key1%<br/>rem now take it away again with set /a<br/>set /a key1=%key1string%-100000<br/><br/>rem key2 has 2 digits so add 100 (by prepending a 1)<br/>set key2string=1%key2%<br/>rem now take it away again with set /a<br/>set /a key2=%key2string%-100<br/><br/>rem key3 has 3 digits so add 1000 (by prepending a 1)<br/>set key3string=1%key3%<br/>rem now take it away again with set /a<br/>set /a key3=%key3string%-1000<br/><br/>rem key4 has 1 digits so add 10 (by prepending a 1)<br/>set key4string=1%key4%<br/>rem now take it away again with set /a<br/>set /a key4=%key4string%-10<br/><br/>echo Numerical values:<br/>echo key1=%key1%<br/>echo key2=%key2%<br/>echo key3=%key3%<br/>echo key4=%key4%<br/><br/>set /a c=%key1%/%key2%<br/>echo Arithmetic operation (1) %key1%/%key2%=%c%<br/><br/>set /a d=%c%-%key3%<br/>echo Arithmetic operation (2) %c%-%key3%=%d%<br/><br/>set /a e=%d%/%key4%<br/>echo Arithmetic operation (3) %d%/%key4%=%e%<br/><br/>if "%e%"=="12" echo Correct!<br/><br/><br/> Code: <a>[Select]</a>Numerical values:<br/>key1=3256<br/>key2=22<br/>key3=112<br/>key4=3<br/>Arithmetic operation (1) 3256/22=148<br/>Arithmetic operation (2) 148-112=36<br/>Arithmetic operation (3) 36/3=12<br/>Correct!thank you it works great<br/>does it need modification if the first <a href="https://interviewquestions.tuteehub.com/tag/group-245646" style="font-weight:bold;" target="_blank" title="Click to know more about GROUP">GROUP</a> has 6 digits ex 123456 Quote from: mat123 on March 06, 2010, 02:54:46 PM</p><blockquote>does it need modification if the first group has 6 digits ex 123456<br/></blockquote> <br/>It should be obvious that the answer is "yes". I thought I had provided enough clues in the <a href="https://interviewquestions.tuteehub.com/tag/rems-3789721" style="font-weight:bold;" target="_blank" title="Click to know more about REMS">REMS</a>. Study them.<br/>i have a new problem any other key other than the 03256 key doesn't work ex 22428-89-156-8<br/>22428/89=252<br/>252-156=96<br/>96/8=12Are you sure?<br/><br/> Code: <a>[Select]</a>Numerical values:<br/>key1=22428<br/>key2=89<br/>key3=156<br/>key4=8<br/>Arithmetic operation (1) 22428/89=252<br/>Arithmetic operation (2) 252-156=96<br/>Arithmetic operation (3) 96/8=12<br/>Correct!it works now must have been something with my computer<br/>and is there any programing errors in this code for the key generator<br/><br/>echo off<br/>:A<br/>cls<br/>Set /a key2=(%Random% %%89)+10<br/>Set /a key3=(%Random% %%899)+100<br/>Set /a key4=(%Random% %%9)+1<br/><br/>set /a e="12"*"%key4%"<br/>set /a d="%e%"+"%key3%"<br/>set /a key1="%d%"*"%key2%"<br/>echo your key is %key1%-%key2%-%key3%-%key4%<br/>pause<br/>goto a<br/>well, it produces keys...<br/><br/>why are you using those quote marks?<br/>oops read the page for the set command wrong</body></html>
91.

Solve : %1-12 problems?

Answer» <html><body><p>I'm having one file start another file with check parameters to prevent the second file from being opened with out  running the first but <a href="https://interviewquestions.tuteehub.com/tag/even-976335" style="font-weight:bold;" target="_blank" title="Click to know more about EVEN">EVEN</a> when i run the the first the second still comes up withe the same error message<br/>the start command Code: <a>[Select]</a>start test2.bat %CD% %key1% 1234 %key2% 5678 %key3% 9012 %key4% 3456 i like cheese<br/>check code Code: <a>[Select]</a>IF not "%3"=="1234" goto error1<br/>IF not "%5"=="5678" goto error1<br/>IF not "%7"=="9012" goto error1<br/>IF not "%9"=="3456" goto error1<br/>IF not "%10"=="1" goto error1<br/>IF not "%11"=="like" goto error1<br/>IF not "%<a href="https://interviewquestions.tuteehub.com/tag/12-241884" style="font-weight:bold;" target="_blank" title="Click to know more about 12">12</a>"=="cheese" goto error1<br/> In test2.bat:<br/><br/>test2.bat=%0<br/>%cd%=%1<br/>%key1%=%2<br/>1234=%3<br/>%key2%=%4<br/>5678=%5<br/>%key3%=%6<br/>9012=%7<br/>3456=%8<br/>i=%9<br/>-----<br/>like=%10<br/>cheese=%11<br/><br/>I don't know if anything below ----- can actually work.i guess i have to get rid of i like cheese  Well, you can always see if it works.You can only use <a href="https://interviewquestions.tuteehub.com/tag/single-644669" style="font-weight:bold;" target="_blank" title="Click to know more about SINGLE">SINGLE</a> digits for passed parameters and %0 is reserved so you just have %1 to %9 to play with. But you have the SHIFT command.<br/></p></body></html>
92.

Solve : A simple Windows Task?

Answer» <html><body><br/>Hello<br/><br/>Ive <a href="https://interviewquestions.tuteehub.com/tag/made-1082584" style="font-weight:bold;" target="_blank" title="Click to know more about MADE">MADE</a> a little batch file with the following content<br/><br/>ECHO OFF<br/>"C:\Programmi\Windows Media Player\wmplayer.exe" "c:\windows\clock.avi"<br/><br/>It s on an Italian Windows system.<br/>When I run it seperately, it <a href="https://interviewquestions.tuteehub.com/tag/runs-246860" style="font-weight:bold;" target="_blank" title="Click to know more about RUNS">RUNS</a> fine.<br/>However, when the .bat is added as  a task, it will not execute at the specified<br/>time I <a href="https://interviewquestions.tuteehub.com/tag/set-11758" style="font-weight:bold;" target="_blank" title="Click to know more about SET">SET</a> it to; nothing happens.<br/>Ive set the correct admin password..<br/><br/>Any ideas?<br/>Try <a href="https://interviewquestions.tuteehub.com/tag/adding-849193" style="font-weight:bold;" target="_blank" title="Click to know more about ADDING">ADDING</a> <a href="https://interviewquestions.tuteehub.com/tag/start-239994" style="font-weight:bold;" target="_blank" title="Click to know more about START">START</a> before the path. <br/><br/>Start PATH [arguments]Thanks man. Start fixed it.</body></html>
93.

Solve : FTP File Transfer?

Answer» <html><body><br/> Hi to all<br/><br/>    i want make one batch file that connect to the ftp like 192.168.100.99 with username &amp; password <br/>    &amp; then i transfer one text file <a href="https://interviewquestions.tuteehub.com/tag/form-240719" style="font-weight:bold;" target="_blank" title="Click to know more about FORM">FORM</a> client %temp% to ftp folder.  Code: <a>[Select]</a>C:\&gt;ftp -h<br/><br/>Transfers files to and from a computer running an FTP server service<br/>(sometimes called a daemon). Ftp can be used interactively.<br/><br/>FTP [-v] [-d] [-i] [-n] [-<a href="https://interviewquestions.tuteehub.com/tag/g-11801" style="font-weight:bold;" target="_blank" title="Click to know more about G">G</a>] [-s:filename] [-a] [-w:windowsize] [-A] [host]<br/><br/>  -v             Suppresses display of remote server responses.<br/>  -n             Suppresses auto-login upon initial connection.<br/>  -i             Turns off interactive prompting during multiple file<br/>                 transfers.<br/>  -d             Enables debugging.<br/>  -g             Disables filename globbing (see GLOB command).<br/>  -s:filename    Specifies a text file <a href="https://interviewquestions.tuteehub.com/tag/containing-2035611" style="font-weight:bold;" target="_blank" title="Click to know more about CONTAINING">CONTAINING</a> FTP commands; the<br/>                 commands will automatically run after FTP starts.<br/>  -a             Use any local interface when binding data connection.<br/>  -A             login as anonymous.<br/>  -w:buffersize  Overrides the <a href="https://interviewquestions.tuteehub.com/tag/default-244456" style="font-weight:bold;" target="_blank" title="Click to know more about DEFAULT">DEFAULT</a> transfer buffer <a href="https://interviewquestions.tuteehub.com/tag/size-246425" style="font-weight:bold;" target="_blank" title="Click to know more about SIZE">SIZE</a> of 4096.<br/>  host           Specifies the host name or IP address of the remote<br/>                 host to connect to.<br/><br/>Notes:<br/>  - mget and mput commands take y/n/q for yes/no/quit.<br/>  - Use Control-C to abort commands.</body></html>
94.

Solve : A very simple DOS question... yet extremely complex!?

Answer» <html><body><p>Hi all,<br/><br/>Does <a href="https://interviewquestions.tuteehub.com/tag/anyone-380251" style="font-weight:bold;" target="_blank" title="Click to know more about ANYONE">ANYONE</a> know how from command prompt could I enable/disable the microphone, line-in, etc.. as a recording device. This is naturally <a href="https://interviewquestions.tuteehub.com/tag/done-958312" style="font-weight:bold;" target="_blank" title="Click to know more about DONE">DONE</a> from control panel, but my application dictates that it must be done in command prompt preferably, or any other language...You could create a vb script to do what you need and then call it from the command line - I dont believe this is feasible <a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> 'pure' batch commands Quote from: gpl on <a href="https://interviewquestions.tuteehub.com/tag/march-243170" style="font-weight:bold;" target="_blank" title="Click to know more about MARCH">MARCH</a> 10, 2010, 08:35:18 AM</p><blockquote>You could create a vb script to do what you need and then call it from the command line - I dont believe this is feasible using 'pure' batch commands<br/></blockquote> <br/>I concur, maybe some form of a custom Command-Line utility compatible with batch file automation would work, but anything <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> that would be playing with registry and driver stuff and I just don't trust most people to play with my drivers, yet alone crummy command-line executables.</body></html>
95.

Solve : Real DOS TSR programming question?

Answer» <html><body><p>From Turbo C in DOS, how can I execute an <a href="https://interviewquestions.tuteehub.com/tag/external-981194" style="font-weight:bold;" target="_blank" title="Click to know more about EXTERNAL">EXTERNAL</a> program without using any <a href="https://interviewquestions.tuteehub.com/tag/interrupts-17581" style="font-weight:bold;" target="_blank" title="Click to know more about INTERRUPTS">INTERRUPTS</a>? I am making a <a href="https://interviewquestions.tuteehub.com/tag/screen-25632" style="font-weight:bold;" target="_blank" title="Click to know more about SCREEN">SCREEN</a> saver TSR which has to execute an external <a href="https://interviewquestions.tuteehub.com/tag/exe-447113" style="font-weight:bold;" target="_blank" title="Click to know more about EXE">EXE</a> as the screen saver.</p></body></html>
96.

Solve : Batch not completed, what can be wrong??

Answer» <html><body><p>Hello!<br/><br/>I got this excellent code from Sidewinder a long time ago, I did change paths and user to %username%, but that is all. I have been testing it now but it will not work properly so I wonder if someone can see if there is something <a href="https://interviewquestions.tuteehub.com/tag/wrong-1462035" style="font-weight:bold;" target="_blank" title="Click to know more about WRONG">WRONG</a> in the code? The problem is that it does not process all the files in the folder, it leaves <a href="https://interviewquestions.tuteehub.com/tag/2-236987" style="font-weight:bold;" target="_blank" title="Click to know more about 2">2</a> to 3 files unprocessed (depending of how many files in the folder) for unknown reasons. Any hints what can be wrong?<br/>Thanks<br/><br/> Code: <a>[Select]</a>¨<br/>echo off<br/>setlocal<br/><br/>&gt; C:\"Documents and <a href="https://interviewquestions.tuteehub.com/tag/settings-771535" style="font-weight:bold;" target="_blank" title="Click to know more about SETTINGS">SETTINGS</a>"\%username%\"Local Settings"\Temp\TAB.DAT echo !table<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo !version 300<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo !charset WindowsLatin1<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo.<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo Definition Table<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo  Type NATIVE Charset "WindowsLatin1"<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo  Fields 1<br/>&gt;&gt; C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo    Vägnamn Char (32);<br/><br/>set /a rutter=0<br/><br/> for /f "tokens=1-3 delims=e." %%i In ('dir /o:-n /a:-d /<a href="https://interviewquestions.tuteehub.com/tag/b-236590" style="font-weight:bold;" target="_blank" title="Click to know more about B">B</a> D:\Maps\Rutter\%username%') do (<br/> set rutter=%%j+1<br/> goto out<br/> )<br/><br/>:out<br/> set /a count=0<br/><br/> for /f "tokens=* delims=." %%<a href="https://interviewquestions.tuteehub.com/tag/v-238055" style="font-weight:bold;" target="_blank" title="Click to know more about V">V</a> in ('dir /a:-d /b C:\"Documents and Settings"\%username%\"Local Settings"\Temp\~Map*.*') do (<br/> call :group "%%v"<br/> )<br/> del C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.dat<br/><br/>:group<br/> call set /a count=%%count%%+1<br/> if %count% GTR 4 (<br/> set /a count=1<br/> call set /a rutter=%%rutter%%+1<br/> )<br/> if %count% EQU 4 (<br/> copy C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.dat D:\Maps\Rutter\%username%\Rutt%rutter%.TAB &gt; nul<br/> )<br/> for /f "tokens=1-2 delims=." %%w in ("%1") do (<br/> copy C:\"Documents and Settings"\%username%\"Local Settings"\Temp\"%1" D:\Maps\Rutter\%username%\Rutt%rutter%.%%x &gt; nul<br/> )<br/></p></body></html>
97.

Solve : Install program to drive other than C?

Answer» <html><body><p>Hi<br/><br/>I wonder if someone could help me.<br/><br/>I have an installation disc that automatically loads to the C: drive.<br/><br/>I am using an external USB CD drive.<br/><br/>Is there a command that would tell the installer to install to a specific drive?<br/><br/>BLB<br/>Hello, and welcome to the CH <a href="https://interviewquestions.tuteehub.com/tag/forum-25637" style="font-weight:bold;" target="_blank" title="Click to know more about FORUM">FORUM</a>.  <br/>New programs normally install to the system drive. It may help if you explain to us why you need to install to a different drive.<br/>Many programs have to install at least some of their files to the system drive. However, it is possible to have a folder on the D.: drive and install most of the program in that folder. <a href="https://interviewquestions.tuteehub.com/tag/even-976335" style="font-weight:bold;" target="_blank" title="Click to know more about EVEN">EVEN</a> so, there will be some files that have to go in the system directory on the system drive.<br/><br/><br/> <br/> Quote from: Geek-9pm on March 09, 2010, 01:02:29 PM</p><blockquote>Hello, and welcome to the CH forum.  <br/>New programs normally install to the system drive. It may help if you explain to us why you need to install to a different drive.<br/>Many programs have to install at least some of their files to the system drive. However, it is possible to have a folder on the D.: drive and install most of the program in that folder. Even so, there will be some files that have to go in the system directory on the system drive.<br/></blockquote> It doesn't matter why, and any program can be installed to any drive the user chooses. <br/><br/>(edited spelling)Ok thanks for the replies and the welcome.<br/><br/>The program is actually MS Office Pro 2007.<br/><br/>Its set to autorun, and automatically installs to C:( system) Drive.<br/><br/>I'm experimenting with setting up a pc with OS on 1st partition, apps on 2nd partition etc.<br/><br/>Any help appreciated Quote from: Biglittlebear on March 09, 2010, 01:32:48 PM<blockquote>...Its set to autorun, and automatically installs to C:( system) Drive.<br/>I'm experimenting with setting up a pc with OS on 1st partition, apps on 2nd partition etc...</blockquote> If you only have one operating system, I would suggest the following partitioning scheme:<br/>C:  OS &amp; Programs<br/>D:  Data<br/>E:  Downloads<br/>F:  <a href="https://interviewquestions.tuteehub.com/tag/windows-22662" style="font-weight:bold;" target="_blank" title="Click to know more about WINDOWS">WINDOWS</a> Paging File (Swap File), <a href="https://interviewquestions.tuteehub.com/tag/ie-496825" style="font-weight:bold;" target="_blank" title="Click to know more about IE">IE</a> Temporary Files, Windows Temp Files.<br/><br/>Other than "C", <a href="https://interviewquestions.tuteehub.com/tag/choose-419254" style="font-weight:bold;" target="_blank" title="Click to know more about CHOOSE">CHOOSE</a> any drive letter you like for the remaining.<br/><br/>BTW, why is this thread posted in DOS Forum?Thanks for the reply.<br/><br/>Why in this section ........I was looking for the Dos command as above.<br/><br/>But I'll try your suggested HDD layout.<br/><br/>BLB<br/> Quote from: Biglittlebear on March 09, 2010, 02:15:32 PM<blockquote>Why in this section ........I was looking for the Dos command as above.<br/><br/></blockquote> Just FYI, I understood that which is why I didn't offer any suggestion in my post above. Not sure if that can be done. Quote<blockquote>It doesn't matter why, and any program can be installed to any drive the user chooses. </blockquote> <br/>Allan, that is a very broad statement. Would you like to qualify that ? Violators who read this might take what you said to the extreme.<br/><br/>Why does matter.Qualify what? Any app can be installed on any drive the user chooses - what's needs to be qualified? And why this user wants to do it is none of my business.</body></html>
98.

Solve : SET /P command usage inside for loop?

Answer» <html><body><p>Hi,<br/><br/>Can anyone please <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a> me how to get input from user inside a for loop? An example would help me much better.<br/><br/>That is using SET /<a href="https://interviewquestions.tuteehub.com/tag/p-236832" style="font-weight:bold;" target="_blank" title="Click to know more about P">P</a> command inside a for loop. Based on user input, I want to perform some operation. But the script has to prompt for user input <a href="https://interviewquestions.tuteehub.com/tag/everytime-2623177" style="font-weight:bold;" target="_blank" title="Click to know more about EVERYTIME">EVERYTIME</a> the loops runs.<br/><br/>Thanks in advance..<br/><br/> Quote from: <a href="https://interviewquestions.tuteehub.com/tag/thiru-707808" style="font-weight:bold;" target="_blank" title="Click to know more about THIRU">THIRU</a> on March 09, 2010, 03:43:25 PM</p><blockquote><br/>That is using SET /P command inside a for loop. Based on user input, I want to perform some operation. But the script has to prompt for user input everytime the loops runs.<br/></blockquote> <br/><br/>C:\batch&gt;type Thriu.bat<br/> Code: <a>[Select]</a><a href="https://interviewquestions.tuteehub.com/tag/echo-11626" style="font-weight:bold;" target="_blank" title="Click to know more about ECHO">ECHO</a> off<br/>setlocal enabledelayedexpansion<br/>for /f "delims=" %%i in (thriu.txt) do (<br/>echo %%i<br/>Echo Enter:<br/>set /p variable=<br/>echo variable = !variable!<br/>)<br/><strong>Output:</strong><br/><br/>C:\batch&gt;Thriu.bat<br/>Hello<br/>Enter:<br/>one<br/>variable = one<br/>World<br/>Enter:<br/>two<br/>variable = two<br/>This<br/>Enter:<br/>three<br/>variable = three<br/>is<br/>Enter:<br/>four<br/>variable = four<br/>a<br/>Enter:<br/>five<br/>variable = five<br/>batch<br/>Enter:<br/>six<br/>variable = six<br/>file<br/>Enter:<br/>seven<br/>variable = seven<br/><br/><strong>Input:</strong><br/><br/>C:\batch&gt;type  thriu.txt<br/>Hello<br/>World<br/>This<br/>is<br/>a<br/>batch<br/>file<br/><br/>C:\batch&gt; Quote from: Thiru on March 09, 2010, 03:43:25 PM<blockquote>That is using SET /P command inside a for loop. Based on user input, I want to perform some operation. But the script has to prompt for user input everytime the loops runs.<br/></blockquote> <br/><br/>C:\batch&gt;type  never.bat<br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>for /L %%i in (1,1,%1) do (<br/><br/>set /p variable=Enter:<br/>echo variable = !variable!<br/>)<br/>echo Bye<br/><strong>Output:</strong><br/><br/>C:\batch&gt;never.bat 8<br/>Enter:1<br/>variable = 1<br/>Enter:2<br/>variable = 2<br/>Enter:3<br/>variable = 3<br/>Enter:4<br/>variable = 4<br/>Enter:5<br/>variable = 5<br/>Enter:6<br/>variable = 6<br/>Enter:7<br/>variable = 7<br/>Enter:8<br/>variable = 8<br/>Bye<br/><br/>C:\batch&gt;<br/><br/>reference:<br/><br/><a href="https://www.roysac.com/blog/2009/10/some-handy-ms-dos-batch-tricks-infinite.html">http://www.roysac.com/blog/2009/10/some-handy-ms-dos-batch-tricks-infinite.html</a><br/> Quote from: Thiru on March 09, 2010, 03:43:25 PM<blockquote>That is using SET /P command inside a for loop. Based on user input, I want to perform some operation. But the script has to prompt for user input everytime the loops runs.<br/></blockquote> <br/><br/>C:\batch&gt;type nevertest.bat<br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>for /L %%i in (1,1,1000) do (<br/><br/>set /p variable=Enter:<br/>echo variable = !variable!<br/>echo To Quit, Enter: q<br/>if !variable!==q  goto  end<br/>)<br/>:end<br/>echo Bye<br/><strong>Output:</strong><br/><br/>C:\batch&gt; nevertest.bat<br/>Enter:one<br/>variable = one<br/>To Quit, Enter: q<br/>Enter:two<br/>variable = two<br/>To Quit, Enter: q<br/>Enter:7<br/>variable = 7<br/>To Quit, Enter: q<br/>Enter:q<br/>variable = q<br/>To Quit, Enter: q<br/>Bye<br/><br/>C:\batch&gt;</body></html>
99.

Solve : Delete Files After X Days?

Answer» <html><body><p>I understand this has been covered a lot but i <a href="https://interviewquestions.tuteehub.com/tag/seem-7258342" style="font-weight:bold;" target="_blank" title="Click to know more about SEEM">SEEM</a> to be running into a brick wall each time i try this. What I would like to do is:<br/><br/>1.  remove files (<a href="https://interviewquestions.tuteehub.com/tag/images-238776" style="font-weight:bold;" target="_blank" title="Click to know more about IMAGES">IMAGES</a>) that are x days old. (modified)  "e:\path\path"<br/>2.  skip all conformation boxes like "are you sure"<br/><br/>I'm running windows server 2008, is there any automated programs out there like Easy Batch Builder? Or whats my solution.<br/><br/>Thanks,  <br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>Forfiles -<a href="https://interviewquestions.tuteehub.com/tag/p-236832" style="font-weight:bold;" target="_blank" title="Click to know more about P">P</a> e:\path\path -s -m *.* -d -14 -c "cmd /c del /q path<br/>this seems to work in XP and Windows 7 but not in Windows Server 2008so i got it  on my own  <br/><br/>helps if you have the path right. Quote from: bolson7117 on <a href="https://interviewquestions.tuteehub.com/tag/february-460109" style="font-weight:bold;" target="_blank" title="Click to know more about FEBRUARY">FEBRUARY</a> 26, 2010, 10:08:36 AM</p><blockquote> Code: <a>[Select]</a>Forfiles -p e:\path\path -s -m *.* -d -14 -c "cmd /c del /q path<br/>this seems to work in XP and Windows 7 but not in Windows Server 2008<br/></blockquote> <br/>My I ask......<br/>How to delete the files that is one year old......<br/>Well what i mean is, I want to delete the files that is one year old.<br/>Where to change the script?<br/>Is it the "-14" ?Try that. There may also be a -y switch, so you could try -y 1</body></html>
100.

Solve : greater than less than?

Answer» <html><body><p>how can i do greater than, <a href="https://interviewquestions.tuteehub.com/tag/less-536996" style="font-weight:bold;" target="_blank" title="Click to know more about LESS">LESS</a> than statementsLook at if /? at the <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a> prompt. <br/><br/>If %<a href="https://interviewquestions.tuteehub.com/tag/variable-772077" style="font-weight:bold;" target="_blank" title="Click to know more about VARIABLE">VARIABLE</a>% GTR 10 echo OVER 10<br/>If %variable% GEQ 10 echo GREATER OR <a href="https://interviewquestions.tuteehub.com/tag/equal-446400" style="font-weight:bold;" target="_blank" title="Click to know more about EQUAL">EQUAL</a> TO 10<br/>If %variable% LSS 10 echo LESS THAN 10<br/>If %variable% LEQ 10 echo LESS OR EQUAL TO 10<br/><br/>thank you</p></body></html>