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.

8951.

Solve : undocumented commands?

Answer» <html><body><p>these are the ones i know about in vista..<br/><br/>;a^&gt; (AT COMMAND)<br/>;h^&gt; /? (HTML HELPER , LOAD HTML <a href="https://interviewquestions.tuteehub.com/tag/page-25452" style="font-weight:bold;" target="_blank" title="Click to know more about PAGE">PAGE</a> IN DOCUMENTS)<br/>;<a href="https://interviewquestions.tuteehub.com/tag/f-236701" style="font-weight:bold;" target="_blank" title="Click to know more about F">F</a>^&gt; (FC COMMAND)<br/>;s^&gt; (SC COMMAND)<br/>;w^&gt; (MMC)<br/><br/>;1^&gt; (Unsure , continues to number <a href="https://interviewquestions.tuteehub.com/tag/9-miliyn-237742" style="font-weight:bold;" target="_blank" title="Click to know more about 9">9</a>)<br/>;@^&gt; (unsure)<br/><br/>; (use a ; instead of a space , dir;/a:;/b)<br/>, (use a , instead of a space)<br/><br/>type ul*.cmd (type all cmd files that start with ul, continues ? <a href="https://interviewquestions.tuteehub.com/tag/ect-445110" style="font-weight:bold;" target="_blank" title="Click to know more about ECT">ECT</a>)<br/>type ul?*.cmd (type all three letter cmd files that start with ul)<br/><br/>type |more (adding a pipe and more will cause type to <a href="https://interviewquestions.tuteehub.com/tag/pause-1149128" style="font-weight:bold;" target="_blank" title="Click to know more about PAUSE">PAUSE</a>)<br/><br/>what else is their?<br/><br/>google before asking.<br/><br/><a href="https://www.google.com/search?hl=en&amp;q=vista+cmd+commands&amp;btnG=Google+Search">http://www.google.com/search?hl=en&amp;q=vista+cmd+commands&amp;btnG=Google+Search</a></p></body></html>
8952.

Solve : accessing a direcory whose name is digits only?

Answer» <html><body><p>i <a href="https://interviewquestions.tuteehub.com/tag/use-241643" style="font-weight:bold;" target="_blank" title="Click to know more about USE">USE</a> the COMMAND in windows server 2003 (not the cmd, the COMMAND)<br/>that means i can't just put "" around the folder name or access it normally, i have to code it like dos does (the 8 byte thing).<br/>so with a normal long file i do the first 6 <a href="https://interviewquestions.tuteehub.com/tag/letters-244583" style="font-weight:bold;" target="_blank" title="Click to know more about LETTERS">LETTERS</a> then ~1 (or 2 and so on)<br/>but when its a digit only name (like 5963564)<br/>it is coded differently, something involving letters too, and i couldn't figure it out, is there anyone who knows how to acces it?<br/>thanks.Im not familiar with windows server ... is there no way you can use long <a href="https://interviewquestions.tuteehub.com/tag/filenames-987951" style="font-weight:bold;" target="_blank" title="Click to know more about FILENAMES">FILENAMES</a> ? I have just tested command out on my xp system and it reports them faithfully.<br/><br/>What does dir show you for the names ??<br/><br/>Graham<br/><br/>if 5963564 is the file/folder in question its because thats a <a href="https://interviewquestions.tuteehub.com/tag/7-240263" style="font-weight:bold;" target="_blank" title="Click to know more about 7">7</a> digit number. 596356~1<br/><br/>if dir /x doesent show a name read this [url][http://technet2.microsoft.com/windowsserver/en/library/61cd1970-5254-47c2-96d4-a66c780446381033.mspx?mfr=true/url]<br/><br/>instead of "" have you tryed '' ? <br/><br/><br/><br/>I have had this issue and I just tried using:<br/><br/>dir<br/>dir ...<br/>dir,<br/>dir.<br/>dir ..<br/><br/>The other vey helpful command is "CALL" . That is all<br/><br/><br/><br/>Byedos nerd, I hope you don't <a href="https://interviewquestions.tuteehub.com/tag/mind-1096965" style="font-weight:bold;" target="_blank" title="Click to know more about MIND">MIND</a> if I ask you a question:<br/><br/>Are you crazy?<br/><br/></p></body></html>
8953.

Solve : Are these task possible in(or with) batch files?

Answer» <html><body><br/>can you run a batch file once radomly in one hour timespan? <br/>can the batch file go lookup and parse an xml file in a network share? <br/>can the same batch file be minimized in the taskbar at all time (i.e like other applications)? <br/>can the batch file show an alert message if the xml file contain certain word(little alert like msn messenger show friends come online)? <br/>and if someone click the alert, another application is launched?<br/><br/>what language or technology do you suppose I use to achieve all these in the quickest and easiest possible way. I tried flash but couldn't minimize icon in taskbar. Any pointer. <br/><br/>Sincerely1. can you run a batch file once radomly in one hour timespan? <br/><br/>If the file was being ran randomly it wouldn't be running each hour. Maybe I don't understand the question. But you could run a batch file every hour.<br/><br/>2. can the batch file go lookup and parse an xml file in a network share? <br/><br/>Depends on how or what your parsing. Could be possible. But for the most part this is not what batch files are for.<br/><br/>3. can the same batch file be minimized in the taskbar at all time (i.e like other applications)? <br/><br/>Yes.<br/><br/>4. can the batch file show an alert message if the xml file contain certain word(little alert like msn messenger show friends come online)? <br/>and if someone click the alert, another application is launched?<br/><br/>Again batch files are not really meant for parsing data. It may be possible, but not likely. As far as sending an alert or other message it would all really depend if the alert could be <a href="https://interviewquestions.tuteehub.com/tag/done-958312" style="font-weight:bold;" target="_blank" title="Click to know more about DONE">DONE</a> through a command prompt. However, more than likely not possible with a batch file unless you had another program running from the command line that interfaced with MSN.<br/><br/>what language or technology do you suppose I use to achieve all these in the quickest and easiest possible way. I tried flash but couldn't minimize icon in taskbar. Any pointer. <br/><br/>I'd suggest a more advanced programming language. For <a href="https://interviewquestions.tuteehub.com/tag/something-25913" style="font-weight:bold;" target="_blank" title="Click to know more about SOMETHING">SOMETHING</a> like what you mentioned above I'd suggest a Perl script. For this to work though you'd need to <a href="https://interviewquestions.tuteehub.com/tag/get-11812" style="font-weight:bold;" target="_blank" title="Click to know more about GET">GET</a> the free Perl interpreter for Windows. However, Perl is one of the best if not the best for parsing text and could handle more advanced situations such as sending alerts.<br/><br/>Thank you kindly. By randomly in an hour I meant to say, <a href="https://interviewquestions.tuteehub.com/tag/random-11853" style="font-weight:bold;" target="_blank" title="Click to know more about RANDOM">RANDOM</a> interval without going over an hour, just like dices, random occurance but never over 6. <br/><br/>Anyway, I don't know how to do these tasks in Perl (just yet). To show Alerts I probably need to do Perl GUI stuff? Anyway thanks again.In NT (NT/2K/XP/Vista) batch you could at each hour (ie when clock says HH:00) produce 6 random numbers between 1 and 59, then <a href="https://interviewquestions.tuteehub.com/tag/schedule-246555" style="font-weight:bold;" target="_blank" title="Click to know more about SCHEDULE">SCHEDULE</a> a batch to run at hh:MM where each MM is one of the numbers thus produced.<br/><br/></body></html>
8954.

Solve : Time plus 1?

Answer» <html><body><p>I have <a href="https://interviewquestions.tuteehub.com/tag/xp-747558" style="font-weight:bold;" target="_blank" title="Click to know more about XP">XP</a> to let you know <br/><br/>I need to know how to use an AT command to set a <a href="https://interviewquestions.tuteehub.com/tag/task-243523" style="font-weight:bold;" target="_blank" title="Click to know more about TASK">TASK</a> <a href="https://interviewquestions.tuteehub.com/tag/1-236780" style="font-weight:bold;" target="_blank" title="Click to know more about 1">1</a> <a href="https://interviewquestions.tuteehub.com/tag/min-239383" style="font-weight:bold;" target="_blank" title="Click to know more about MIN">MIN</a> from when the batch is executed. I've <a href="https://interviewquestions.tuteehub.com/tag/tried-7272297" style="font-weight:bold;" target="_blank" title="Click to know more about TRIED">TRIED</a> but no luck <br/><br/>So, say the batch was executed at 11:27. I need it to set a task for 11:28 the same day.<br/><br/>-Thankscode for calculating future time here<br/><br/><a href="https://groups.google.co.uk/group/alt.msdos.batch.nt/browse_frm/thread/5bade11f66dc315f/bddf772ddc305a72?hl=en&amp;lnk=gst&amp;q=five+minutes+in+future#bddf772ddc305a72">http://groups.google.co.uk/group/alt.msdos.batch.nt/browse_frm/thread/5bade11f66dc315f/bddf772ddc305a72?hl=en&amp;lnk=gst&amp;q=five+minutes+in+future#bddf772ddc305a72</a><br/><br/></p></body></html>
8955.

Solve : How to get onto a command prompt when your admin won't give pass to access it.?

Answer» <html><body><p>How to get onto a <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 when your admin won't give pass to access it? my administrator has locked command prompt on all users except for his. He won't give anyone it. The only way<br/>is to some how use the computer to do it. <br/>Please helpYour administrator obviously has very good reasons to lock access to the Command Prompt. Try <a href="https://interviewquestions.tuteehub.com/tag/discussing-7267676" style="font-weight:bold;" target="_blank" title="Click to know more about DISCUSSING">DISCUSSING</a> your need with him.<br/><br/>You already posted your query <strong>here..</strong><br/><br/>Double <a href="https://interviewquestions.tuteehub.com/tag/post-2638" style="font-weight:bold;" target="_blank" title="Click to know more about POST">POST</a>. Topic Closed.<br/>See your other thread for replies.<br/>Thanx.</p></body></html>
8956.

Solve : FIND A FILE?

Answer» <html><body><p>Hi <br/>I am looking for a script whic can check one file in the directory <br/>and that particular file need to compare with current time and <br/>if it's 20 mimutes less than current time the this script need to send an email <br/><br/>for example <br/>current time in windows -- 12:30 <br/><br/>in my c:\ dir i have the following files <br/><br/>test1.txt 12:00 <br/>sap.txt 12:10 <br/>reco.txt 12:30 <br/><br/><br/>this script need to chek for sap.txt file this file is less than 20mins to the current time <br/>then this script need to send email <br/><br/>rdsfor /f "tokens=1*" %%a in ('time /t') do set a=%%a &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>;&lt;-- current time<br/>set b=%a:~0,2%:%a:~3,2% &lt;&lt;-- current time without extra *censored*<br/>set /a c=%b%-20 &lt;&lt;-time minus minutes<br/>set d="%c:~0,2%:%a:~3,2% PM" &lt;-- set back to normal format<br/>dir *.txt /a &gt;&gt;%temp%\2 &amp; CLS &lt;-- searches for .txt files in current directory<br/>for /f "tokens=1*" %%a in ('findstr %d% %temp%\2') do echo %%a&gt;&gt;%temp%\3 find files with times 20 minutes ago <br/>for /f "tokens=1*" %%a in ('type %temp%\d') do SEND YOUR EMAIL &lt;--- use program or command to send email with email beeing %%a<br/><br/><strong>for /f "tokens=1*" %%a in ('time /t') do set a=%%a <br/>set b=%a:~0,2%:%a:~3,2% <br/>set /a c=%b%-20 <br/>set d="%c:~0,2%:%a:~3,2% PM" <br/>dir *.txt /a &gt;&gt;%temp%\2 &amp; CLS <br/>for /f "tokens=1*" %%a in ('findstr %d% %temp%\2') do echo %%a&gt;&gt;%temp%\3 <br/>for /f "tokens=1*" %%a in ('type %temp%\d') do SEND YOUR EMAIL</strong><br/><br/>comparing time/date is tricky in batch. here's a vbscript<br/><br/>Code: <a>[Select]</a>Set objFSO = CreateObject("Scripting.FileSystemObject")<br/>Set objFolder = objFSO.GetFolder("C:\temp")<br/>n=Now<br/>For Each myFiles In objFolder.Files<br/> If objFSO.GetExtensionName(myFiles) = "txt" Then<br/> If DateDiff("n",myFiles.DateLastModified,n) &lt;= 20 Then 'less than 20 minnutes<br/> WScript.Echo myFiles<br/> End If <br/> End If <br/>Next<br/>usaage: <br/>Code: <a>[Select]</a>@echo off<br/>cscript /nologo myscript.vbs &gt; newfile<br/>rem send email<br/>blat newfile -to &lt;<a href="/cdn-cgi/l/email-protection">[emailprotected]</a>&gt; -server &lt;server&gt; ........<br/>Quote from: Diablo416 on October 11, 2007, 02:52:15 PM</p><blockquote>set /a c=%b%-20 &lt;&lt;-time minus minutes<br/></blockquote>might fail if file time is say, 11:59am and current time is say, 12:01 ? correct me if i am wrongyea i see what you mean<br/><br/>i dunno if this will <a href="https://interviewquestions.tuteehub.com/tag/work-20377" style="font-weight:bold;" target="_blank" title="Click to know more about WORK">WORK</a><br/><br/>@ECHO OFF<br/>:DIM1<br/>for /f "tokens=1*" %a in ('time /t') do set a=%a <br/>set b=%a:~0,2%:%a:~3,2%<br/><strong>set f1=%b:~0,1%<br/>set f2=%b:~1,1%<br/>set f3=%b:~3,1%<br/>set f4=%b:~4,1%<br/>if '%f3%' == '7' set f3=1<br/>if '%f3%' == '8' set f3=2<br/>if '%f3%' == '9' set f3=3<br/>if '%f1%' == '2' set f1=1<br/>if '%f1%' == '3' set f1=1<br/>if '%f1%' == '4' set f1=1<br/>if '%f1%' == '<a href="https://interviewquestions.tuteehub.com/tag/5-237653" style="font-weight:bold;" target="_blank" title="Click to know more about 5">5</a>' set f1=1<br/>if '%f1%' == '6' set f1=1<br/>if '%f1%' == '7' set f1=1<br/>if '%f1%' == '8' set f1=1<br/>if '%f1%' == '9' set f1=1</strong><br/>set /a c=%b%-20 <br/><strong>set d="%c:~0,2%:%a:~3,2%"</strong> <br/>dir *.txt /a &gt;&gt;%temp%\2 &amp; CLS <br/>for /f "tokens=1*" %%a in ('findstr %d% %temp%\2') do echo %%a&gt;&gt;%temp%\3 <br/>for /f "tokens=1*" %%a in ('type %temp%\d') do SEND YOUR EMAIL<br/>:DIM2you would have to use cacl's as a command. CACL"s is a command that lets you view and modify <br/>files of your choice. Quote from: dos nerd on October 13, 2007, 11:15:27 PM<blockquote>you would have to use cacl's as a command. CACL"s is a command that lets you view and modify <br/>files of your choice. <br/></blockquote><br/>dos nerd, <a href="https://interviewquestions.tuteehub.com/tag/could-410026" style="font-weight:bold;" target="_blank" title="Click to know more about COULD">COULD</a> you please ONLY post when BOTH these things are true:-<br/><br/>a. You understand the question<br/><br/>b. You know the answer<br/><br/>(You're getting noticed.)<br/><br/>Dear All<br/>Thanks for your support<br/>I am testing the script , if any problem i let you know<br/>tks<br/>rds<br/>reposDear All<br/>I try all the scripts it is not working , i i did not try the vb script due to i dont have vb install in my machine<br/><br/>pls let me know which script i need to try for thisQuote from: raj_repos on October 17, 2007, 09:36:32 PM<blockquote>Dear All<br/>I try all the scripts it is not working , i i did not try the vb script due to i dont have vb install in my machine<br/><br/>pls let me know which script i need to try for this<br/></blockquote>which OS you using, vb <a href="https://interviewquestions.tuteehub.com/tag/aeuraeuraeuraeurcomes-1474428" style="font-weight:bold;" target="_blank" title="Click to know more about COMES">COMES</a> native with Windows. Unless you are using pure DOSHI<br/>I am using windows xp<br/>rdsany update pls<br/>rds<br/><br/></body></html>
8957.

Solve : Getting Path in DOS Command For syntax?

Answer» <html><body><p>In the following code:<br/><br/>for /f "tokens=1-6,* delims=/ " %%i in ('dir /s /a-d /-c %DefPath% ^|find "/"') do call :CheckAndPurge %%i %%<a href="https://interviewquestions.tuteehub.com/tag/j-236599" style="font-weight:bold;" target="_blank" title="Click to know more about J">J</a> %%k %%l %%m %%n <strong>%%o </strong> <br/><br/>IE there is a Batch Folder on C: C:\Batch and there are two folders with the Testbatch_A &amp; Test Batch_B which <a href="https://interviewquestions.tuteehub.com/tag/contain-409810" style="font-weight:bold;" target="_blank" title="Click to know more about CONTAIN">CONTAIN</a> the same file.<br/><br/>How do I get the complete <a href="https://interviewquestions.tuteehub.com/tag/path-11833" style="font-weight:bold;" target="_blank" title="Click to know more about PATH">PATH</a> of the file for the <strong>%%o</strong> parameter? Right now I am getting the filename only ie test.txt, but since I am using the /s in the DIR command 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> the Full path including Drive included in the filename. IE C:\batch\TestBatch_A\test.txt<br/><br/>Any ideas?<br/><br/>Thanks!<br/><br/>BAs you can see if you were to type your dir command (dir /s /a-d /-c) it does not list the directory with the file name. It will simply tell you each Directory of at the top of the file listings. The dir command has no option to not only display each file but each file with its path.<br/><br/>If you're wanting to do something like that the only command that comes to my mind that will list the file with the full directory of the file is the attrib command.<br/><br/>Hope this helps.Thanks for the <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a>,<br/><br/>There are some modifiers that can be used according to Microsoft. I haven't had any luck with getting the syntax correct. Here is the link see modifier section.<br/><br/><a href="https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/for.mspx">http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/for.mspx</a><br/><br/><br/>Variable with modifier Description <br/>%~I<br/>Expands %I which removes any surrounding quotation marks ("").<br/><br/>%~fI<br/>Expands %I to a fully qualified path name.<br/><br/>%~dI<br/>Expands %I to a drive letter only.<br/><br/>%~pI<br/>Expands %I to a path only.<br/><br/>%~nI<br/>Expands %I to a file name only.<br/><br/>%~xI<br/>Expands %I to a file extension only.<br/><br/>%~sI<br/>Expands path to contain short names only.<br/><br/>%~aI<br/>Expands %I to the file attributes of file.<br/><br/>%~tI<br/>Expands %I to the date and time of file.<br/><br/>%~zI<br/>Expands %I to the size of file.<br/><br/>%~$PATH:I<br/>Searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, this modifier expands to the empty string.<br/><br/>Any help would be appreciated.<br/><br/>Byoung<br/><br/></p></body></html>
8958.

Solve : Question re: FOR loop?

Answer» <html><body><p>I'm trying to use a FOR loop to parse 4 comma-delimited values, some of which may be null values. The syntax I'm using isn't interpretting the null values as I'd like. Any suggestions? (I need to do this in a batch file.)<br/><br/><br/>Here's my current code:<br/><br/>@echo off<br/>setlocal enabledelayedexpansion<br/><br/>Set Count=0<br/>For /F "tokens=1,2,3,4* delims=," %%A in (TestInput.csv) Do (<br/>Set Var1=%%A<br/>Set Var2=%%B<br/>Set Var3=%%C<br/>Set Var4=%%D<br/>Set /A Count+=1<br/><br/>echo Var1=!Var1!<br/>echo Var2=!Var2!<br/>echo Var3=!Var3!<br/>echo Var4=!Var4!<br/>echo Count=!Count!<br/>echo.<br/><br/>)<br/><br/><br/>Here's what I have in TestInput.csv:<br/><br/>Line1Token1,,,Line1Token4<br/>Line2Token1,,,Line2Token4<br/><br/><br/>Here's my current output:<br/><br/>Var1=Line1Token1<br/>Var2=Line1Token4<br/>Var3=<br/>Var4=<br/>Count=1<br/><br/>Var1=Line2Token1<br/>Var2=Line2Token4<br/>Var3=<br/>Var4=<br/>Count=2<br/><br/><br/>What I want returned is:<br/><br/>Var1=Line1Token1<br/>Var2=<br/>Var3=<br/>Var4=Line1Token4<br/>Count=1<br/><br/>Var1=Line2Token1<br/>Var2=<br/>Var3=<br/>Var4=Line2Token4<br/>Count=2<br/>I tried everything I could think of and couldn't get a null value to be imported from the testinput.csv into the bat file. However, I was able to get the output to be very similar to how you want the output to work and may possibly work.<br/><br/>A space where you want your null values will be treated as a character and skip. So the testinput.csv would look like:<br/><br/>Line1Token1, , ,Line1Token4<br/>Line2Token1, , ,Line2Token4<br/><br/>Would this work for what you're trying to do?Thanks for trying this out and for the suggestion. Unfortunately, I think we're pretty much stuck with the existing format of the input file. If I find out otherwise, at that point we may be able to put "NULL" or some other dummy text string in for each of the fields that's now empty, or the space that you suggested.<br/><br/>In doing some more research, I saw a reference elsewhere on the web referring to the behavior of FOR in ignoring null values between delimiters as "a misfeature, wart, or bug". After giving that opinion, it <a href="https://interviewquestions.tuteehub.com/tag/goes-1732621" style="font-weight:bold;" target="_blank" title="Click to know more about GOES">GOES</a> on to suggest that maybe the use of the term "token" implies "that only logical elements are of interest, that is, the line is parsed into symantic units rather than split into <a href="https://interviewquestions.tuteehub.com/tag/literal-543126" style="font-weight:bold;" target="_blank" title="Click to know more about LITERAL">LITERAL</a> fields (the latter [being] more useful to batch programmers)."<br/><br/>I may have another way around this that I'm <a href="https://interviewquestions.tuteehub.com/tag/confirming-7282617" style="font-weight:bold;" target="_blank" title="Click to know more about CONFIRMING">CONFIRMING</a> with co-workers. The third item is always expected to be NULL, and the 4th item is expected to contain one of three possible text strings. Based on the 4th item's value, I believe I can determine whether the first or second item should be populated (with the other being NULL).<br/><br/>If the above holds true, I can still use a FOR loop to read in each line. Var1 and Var2 would always be populated. I'd probably limit the tokens to 3 and use the * in the FOR tokens list to pull any remaining text into Var3 -- and stop with an error if anything is found there. (I'd no longer use Var4.) Then, based on the value of Var2, I'd determine how to use the value in Var1, eventually storing all values away in a new set of <a href="https://interviewquestions.tuteehub.com/tag/variables-11302" style="font-weight:bold;" target="_blank" title="Click to know more about VARIABLES">VARIABLES</a> for further processing.<br/><br/>Not want I wanted, but unless someone else comes up with another suggestion, looks like it may work.Quote from: ranman65 on October 18, 2007, 03:32:26 PM</p><blockquote>but unless someone else comes up with another suggestion<br/></blockquote>use a better language than batch for parsing files.</body></html>
8959.

Solve : BAT file and problem with parameters?

Answer» <html><body><p>Hello<br/>i want to start database <a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> .bat file.<br/>in windows i made shortcut and in the <a href="https://interviewquestions.tuteehub.com/tag/adress-2401829" style="font-weight:bold;" target="_blank" title="Click to know more about ADRESS">ADRESS</a> i puted <a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a>:\database\start -CACHE -USER<br/>some parameters. in windows shortcut it works and database starts, but from but file <a href="https://interviewquestions.tuteehub.com/tag/doesnt-957774" style="font-weight:bold;" target="_blank" title="Click to know more about DOESNT">DOESNT</a>, from cmd as well not. do u know what is the problem?<br/>i tried to put the parametrs in " " but nothing changesd :/<br/>thanks lot for reply<br/>Unfortunately I couldn't fully understand the description of your problem. However, what if at the CMD or in the batch file you <a href="https://interviewquestions.tuteehub.com/tag/startedb-1949268" style="font-weight:bold;" target="_blank" title="Click to know more about STARTED">STARTED</a> the database with the START command.<br/><br/>For example try the below command at the prompt:<br/><br/>start "c:\database\start -CACHE -USER"</p></body></html>
8960.

Solve : Command to know the file system size?

Answer» <html><body><p>Hi,<br/>How to <a href="https://interviewquestions.tuteehub.com/tag/find-11616" style="font-weight:bold;" target="_blank" title="Click to know more about FIND">FIND</a> out the total size of a file system <a href="https://interviewquestions.tuteehub.com/tag/aeuroewithout-1475023" style="font-weight:bold;" target="_blank" title="Click to know more about WITHOUT">WITHOUT</a> <a href="https://interviewquestions.tuteehub.com/tag/properties-11511" style="font-weight:bold;" target="_blank" title="Click to know more about PROPERTIES">PROPERTIES</a>.<br/>e.g I would like to know the size of d:\&amp;<a href="https://interviewquestions.tuteehub.com/tag/gt-249387" style="font-weight:bold;" target="_blank" title="Click to know more about GT">GT</a>;<br/>I have tried d:\&gt;dir /c /s<br/>But there is mismatch of value <a href="https://interviewquestions.tuteehub.com/tag/thru-3829405" style="font-weight:bold;" target="_blank" title="Click to know more about THRU">THRU</a> properties and above command.<br/><br/>Regards,<br/>Suresh.here's a vbscript<br/>Code: <a>[Select]</a>On Error Resume Next <br/>Set objFSO = CreateObject("Scripting.FileSystemObject")<br/>Set colDrives = objFSO.Drives<br/>For Each objDrive in colDrives<br/> Wscript.Echo "Available space: " &amp; objDrive.AvailableSpace<br/> Wscript.Echo "Drive letter: " &amp; objDrive.DriveLetter<br/> Wscript.Echo "Free space: " &amp; objDrive.FreeSpace<br/> Wscript.Echo "Total size: " &amp; objDrive.TotalSize<br/>Next<br/>usage: cscript myCheckDiskScript.vbsI'm looking for DOS command.</p></body></html>
8961.

Solve : commands?

Answer» <html><body><p>how do u send message to computer?If the computers are in the same room, you can write the message on a piece of paper and fold it up as a little paper airplane. Then you just throw it in the direction of the computer you want to send a message to.<br/><br/>If the computer is in a different room or you don't want to use a lot of paper, then maybe you should give us some details on what precisely you want to do. Knowing what operating systems the computers run would also be helpful.wow ! since when can you change the system in to "paper airplanes".. it must function with that <a href="https://interviewquestions.tuteehub.com/tag/new-1114486" style="font-weight:bold;" target="_blank" title="Click to know more about NEW">NEW</a> <a href="/cdn-cgi/l/email-protection">[emailprotected]</a>$$ protocall ive been hearing about.....<br/><br/>go ahead. rag on me.<br/><br/>as far as the question goes... "how do you send (a) message to (the) computer?"<br/><br/>this is so vauge i <a href="https://interviewquestions.tuteehub.com/tag/hardly-2105639" style="font-weight:bold;" target="_blank" title="Click to know more about HARDLY">HARDLY</a> know where to start... considering it is in the dos section of the forums i assume you either A: want to type a command telling the computer to do something at the dos command prompt or B: want your computer to display a message on the <a href="https://interviewquestions.tuteehub.com/tag/moniter-2841299" style="font-weight:bold;" target="_blank" title="Click to know more about MONITER">MONITER</a> from the dos command prompt<br/><br/>for option A. just go to the cmd prompt and type a command and press enter<br/>for option B. maybe you are trying to use the ECHO command <br/><br/><br/>an example of the ECHO command<br/>the command is in red &amp; the output is in blue<br/><br/>C:\Documents and Settings\duke&gt;echo this is the message i would like to display<br/>this is the message i would like to display<br/><br/><br/>Welcome to the CH forums SlimWheelie.<br/><br/>Your query is a little vague and you do not state which operating system you are using. Assuming that you mean how to display an onscreen message while at the command prompt (or from a <a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a>) you can:<br/><br/>echo this is the message to display<br/><br/>'this is the message to display' will show on the screen.<br/><br/>Post back with further query if above is not applicable.<br/><br/>If you want to send a message to the computer in the same PC you are using you would have to create<br/>a batch file and then write<br/>@echo off<br/>pause<br/>echo Hello this is a test batch file. <br/>dir c:\windows<br/><br/>After you write all that save it to all files or if you don't have that save it in a folder<br/>you want. Exit off everything and find the file that you saved the batch file on. Once that is done <br/>You would <a href="https://interviewquestions.tuteehub.com/tag/see-630247" style="font-weight:bold;" target="_blank" title="Click to know more about SEE">SEE</a> an icon with a gear, press on that and then it will come up with command pprompt saying hello. It will ask you to pree a key do that and then you have done it.<br/><br/> From ??</p></body></html>
8962.

Solve : full screen?

Answer» <html><body><p>I know you can <a href="https://interviewquestions.tuteehub.com/tag/make-249948" style="font-weight:bold;" target="_blank" title="Click to know more about MAKE">MAKE</a> the DOS <a href="https://interviewquestions.tuteehub.com/tag/prompt-592976" style="font-weight:bold;" target="_blank" title="Click to know more about PROMPT">PROMPT</a> full <a href="https://interviewquestions.tuteehub.com/tag/screen-25632" style="font-weight:bold;" target="_blank" title="Click to know more about SCREEN">SCREEN</a> by pressing alt+enter, but is it possible to do it in a batch file?Welcome to the <a href="https://interviewquestions.tuteehub.com/tag/ch-241780" style="font-weight:bold;" target="_blank" title="Click to know more about CH">CH</a> forums.<br/><br/>You could open the Command Shell by <a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> a desktop shortcut and edit the shortcut to always open in full screen.<br/><br/></p></body></html>
8963.

Solve : Add a batch file (.bat) at windows startup??

Answer» <html><body><p>i want to add a batch file when windows start....i mean that batch file will run every <a href="https://interviewquestions.tuteehub.com/tag/time-19467" style="font-weight:bold;" target="_blank" title="Click to know more about TIME">TIME</a> windows start......i do not want to use scheduled task by windows....is there any way to <a href="https://interviewquestions.tuteehub.com/tag/perform-1150848" style="font-weight:bold;" target="_blank" title="Click to know more about PERFORM">PERFORM</a> this job with dos command.<br/><br/>thankYouWhy do you wish to use a Dos command?<br/><br/>You haven't said what your operating system is, my crystal ball <a href="https://interviewquestions.tuteehub.com/tag/thinks-3209439" style="font-weight:bold;" target="_blank" title="Click to know more about THINKS">THINKS</a> it's XP so you could add a shortcut to your Startup folder (<a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a>:\Documents and Settings\Username\Start Menu\Programs\Startup).<br/><br/></p></body></html>
8964.

Solve : question on creating a batch file?

Answer» <html><body><p>dos nerd, why are you writing a nonsensical meaningless misleading answer to a thread that died 4 months ago?<br/>dos nerd, could you please ONLY <a href="https://interviewquestions.tuteehub.com/tag/post-2638" style="font-weight:bold;" target="_blank" title="Click to know more about POST">POST</a> when BOTH these <a href="https://interviewquestions.tuteehub.com/tag/things-25910" style="font-weight:bold;" target="_blank" title="Click to know more about THINGS">THINGS</a> are <a href="https://interviewquestions.tuteehub.com/tag/true-249005" style="font-weight:bold;" target="_blank" title="Click to know more about TRUE">TRUE</a>:-<br/><br/>a. You understand the question<br/><br/>b. You know the answer<br/><br/>(You're getting noticed.)<br/><br/>Try to give more information and be a bit mor specific.<br/>If this even is a proper qquestionQuote from: dos nerd on October 16, 2007, 02:40:47 AM</p><blockquote>Try to give more information and be a bit mor specific.<br/>If this even is a proper qquestion<br/></blockquote><br/>What?... As contrex said...<br/><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: contrex on October <a href="https://interviewquestions.tuteehub.com/tag/14-240255" style="font-weight:bold;" target="_blank" title="Click to know more about 14">14</a>, 2007, 12:36:17 AM<blockquote>dos nerd, why are you writing a nonsensical meaningless misleading answer to a thread that died 4 months ago?<br/><br/></blockquote>dos nerd, (Hi everybody from Barcelona!) You are wasting everybody´s time with your nonsense.<br/><br/>Eres pendejo.<br/><br/><br/></body></html>
8965.

Solve : How to return to the original drive/path??

Answer» <html><body><p>I'd like to be able to return to the user's current drive/<a href="https://interviewquestions.tuteehub.com/tag/path-11833" style="font-weight:bold;" target="_blank" title="Click to know more about PATH">PATH</a> before my batch file ends. I couldn't find a <a href="https://interviewquestions.tuteehub.com/tag/system-238321" style="font-weight:bold;" target="_blank" title="Click to know more about SYSTEM">SYSTEM</a> variable which does this, so is this done by <a href="https://interviewquestions.tuteehub.com/tag/setting-241130" style="font-weight:bold;" target="_blank" title="Click to know more about SETTING">SETTING</a> two <a href="https://interviewquestions.tuteehub.com/tag/vars-723191" style="font-weight:bold;" target="_blank" title="Click to know more about VARS">VARS</a> for the drive and path? How would this be done?<br/><br/>Basically, the batch file changes the drive &amp; path near its beginning, but before <a href="https://interviewquestions.tuteehub.com/tag/closing-919708" style="font-weight:bold;" target="_blank" title="Click to know more about CLOSING">CLOSING</a>, I'd like it to set them back.<br/><br/>ThanksCheck the PushD and PopD commands<br/>GrahamThanks Graham. That worked.</p></body></html>
8966.

Solve : Not a .lnk shortcut? Old DOS question?

Answer» <html><body><p>I have a shortcut from the <a href="https://interviewquestions.tuteehub.com/tag/typing-1434978" style="font-weight:bold;" target="_blank" title="Click to know more about TYPING">TYPING</a> program "Timed Writing". It is not a normal shortcut as it is 3kb instead of 1kb. It also can't be deleted via command line using the extension ".<a href="https://interviewquestions.tuteehub.com/tag/lnk-1076484" style="font-weight:bold;" target="_blank" title="Click to know more about LNK">LNK</a>" as normal shortcuts. And under description, it says "Shortcut to MS-DOS program" not just shortcut.<br/><br/>If anyone knows what the extension for this shortcut is, please let me know.<br/>When you right <a href="https://interviewquestions.tuteehub.com/tag/click-918865" style="font-weight:bold;" target="_blank" title="Click to know more about CLICK">CLICK</a> on that shortcut, then Properties, what does it say under "Shortcut" tab, "Target" line, and "Start in" line?I think ".pif" is the extension<br/><br/>let me give explanation about How to view File Extension...<br/>at the windows explorer, <br/> [1]. click Tools menu on menu bar<br/> [2]. choose <a href="https://interviewquestions.tuteehub.com/tag/folder-246959" style="font-weight:bold;" target="_blank" title="Click to know more about FOLDER">FOLDER</a> Options<br/> [3]. navigate to "view" tab<br/> [4]. uncheck the "Hide Extention for......." checkbox<br/><br/><br/></p></body></html>
8967.

Solve : Substrings of tokens?

Answer» <html><body><p>I am trying to use DOS to filter lines from one file to another.<br/><br/>I have the <a href="https://interviewquestions.tuteehub.com/tag/list-11333" style="font-weight:bold;" target="_blank" title="Click to know more about LIST">LIST</a> of registered <a href="https://interviewquestions.tuteehub.com/tag/dlls-432197" style="font-weight:bold;" target="_blank" title="Click to know more about DLLS">DLLS</a> from a system in the file Regfiles_sys1.txt in this format:<br/><br/>junk1.dll {0000000} C:\Program Files\jnk\Junk1.dll [Junk 1.0 Type Library] <br/>junk2.dll {0000000} D:\Program Files\jnk\Junk2.dll [Junk 2.0 Type Library] <br/>junk3.dll {0000000} C:\Program Files\jnk\Junk3.dll [Junk 3.0 Type Library] <br/>one.dll {0000000} D:\Program Files\jnk\one.dll [one Type Library] <br/><br/>I only want the c:\ records in the new output file.<br/><br/>This is my <a href="https://interviewquestions.tuteehub.com/tag/code-25512" style="font-weight:bold;" target="_blank" title="Click to know more about CODE">CODE</a> snippet so far which does not <a href="https://interviewquestions.tuteehub.com/tag/work-20377" style="font-weight:bold;" target="_blank" title="Click to know more about WORK">WORK</a>:<br/><br/>for /F "usebackq" %%i in (`dir /b regfiles_*.txt`) do (call :No_D %%~ni)<br/>goto :EOF<br/><br/>:No_D<br/>if {%1}=={} goto :EOF<br/>if exist %1.tmp del %1.tmp<br/><br/>for /F "tokens=1,2* delims=}" %%i in (%1.txt) do (<br/>if /i "%%j:~0,3%" NEQ " d:" (echo %%i}%%j&gt;&gt;%1.tmp)<br/>)<br/>goto :EOF<br/><br/><br/>^John<br/>P.S. I do not know how to use the delay translate (!) or if it will help here.Quote from: Herkimer on October <a href="https://interviewquestions.tuteehub.com/tag/16-241901" style="font-weight:bold;" target="_blank" title="Click to know more about 16">16</a>, 2007, 08:14:58 AM</p><blockquote>I only want the c:\ records in the new output file.<br/></blockquote><br/>Code: <a>[Select]</a>findstr /I "c:\\" file &gt; newfile<br/>Thank you.<br/>It works but my actual problem is a little more comlpex.<br/><br/>I could Pipe a few of these together to do more tuning I guess.<br/><br/>I was hoping for a more programmatic option so it could be customized to the situation.</body></html>
8968.

Solve : how to search for a folder in dos?

Answer» <html><body><p>Hi experts,<br/><br/>How to search for <a href="https://interviewquestions.tuteehub.com/tag/folder-246959" style="font-weight:bold;" target="_blank" title="Click to know more about FOLDER">FOLDER</a> in dos?how to write a <a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a> <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> for this?the situation is like this<br/>if i <a href="https://interviewquestions.tuteehub.com/tag/give-468520" style="font-weight:bold;" target="_blank" title="Click to know more about GIVE">GIVE</a> a folder name it should search and give the <a href="https://interviewquestions.tuteehub.com/tag/full-1001178" style="font-weight:bold;" target="_blank" title="Click to know more about FULL">FULL</a> path.<br/>I have a batch file for searching files but am not able to get the folder path i<br/>f i give a folder name.<br/>please advise me<br/><br/>waiting for a lead....<br/><br/>Rgds,<br/>PrajithMaybe something like this:<br/><br/>Quote</p><blockquote>@echo off<br/><br/>set /p FILE="What is the file/folder name? "<br/>cls<br/><br/>for /f "delims=" %%i in ('dir "C:\%FILE%" /b /s') do echo %%~fi | more<br/>echo.<br/>pause</blockquote><br/>??Have to use <br/>dir<br/>dir ...<br/>or assocset a=%cd:~0,1%<br/>dir %a%:*.* /a:d /b /s</body></html>
8969.

Solve : Tiling running processes (Windows)?

Answer» <html><body><p>Does anyone know how to write 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 will cause windows to tile the running windows?You could try 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> command, like <a href="http://www.commandline.co.uk/cmdow/">CMDOW</a>i <a href="https://interviewquestions.tuteehub.com/tag/already-1974237" style="font-weight:bold;" target="_blank" title="Click to know more about ALREADY">ALREADY</a> <a href="https://interviewquestions.tuteehub.com/tag/posted-2944562" style="font-weight:bold;" target="_blank" title="Click to know more about POSTED">POSTED</a> this but admin <a href="https://interviewquestions.tuteehub.com/tag/deleted-947557" style="font-weight:bold;" target="_blank" title="Click to know more about DELETED">DELETED</a> my posts looks like<br/><br/><br/>just make a file called yourfile.js , <br/><br/>save this inside of it <br/><br/><strong>(new ActiveXObject("Shell.Application")). TileVertically() </strong> <br/><br/>and double click it ,<br/></p></body></html>
8970.

Solve : how do i enable passing 'yes' option?

Answer» <html><body><p>me from INDIA...i dnt think i need any angelina jolly or brad <a href="https://interviewquestions.tuteehub.com/tag/pitt-600870" style="font-weight:bold;" target="_blank" title="Click to know more about PITT">PITT</a> to identify INDIA...<br/>can u relate to INDIA in any way? or do i need to say that?<br/>nice chatting wid u...Not all commands can get input from the pipe. You might want to try redirection by creating a response file and redirecting the file back to the command as <a href="https://interviewquestions.tuteehub.com/tag/console-240226" style="font-weight:bold;" target="_blank" title="Click to know more about CONSOLE">CONSOLE</a> input.<br/><br/>Code: <a>[Select]</a>echo Y &amp;<a href="https://interviewquestions.tuteehub.com/tag/gt-249387" style="font-weight:bold;" target="_blank" title="Click to know more about GT">GT</a>; response.txt<br/>&lt; response.txt net stop "IIS Admin Service" <br/>&lt; response.txt net stop "FTP Publishing Service" <br/>&lt; response.txt net stop "Simple Mail Transfer Protocol (SMTP)" <br/>&lt; response.txt net stop "World <a href="https://interviewquestions.tuteehub.com/tag/wide-732346" style="font-weight:bold;" target="_blank" title="Click to know more about WIDE">WIDE</a> Web Publishing Service" <br/><br/>&lt; response.txt net start "IIS Admin Service"<br/>&lt; response.txt net start "Simple Mail Transfer Protocol (SMTP)"<br/>&lt; response.txt net start "World Wide Web Publishing Service"<br/>&lt; response.txt net start "FTP Publishing Service"<br/>del response.txt<br/><br/>Depending how the <em>net</em> command <a href="https://interviewquestions.tuteehub.com/tag/handles-1015317" style="font-weight:bold;" target="_blank" title="Click to know more about HANDLES">HANDLES</a> prompts for input, this may actually work. Side that works, og me did not think of that.</p></body></html>
8971.

Solve : restarting IIS service using batch script?

Answer» <html><body><p>I need to restart IIS Admin Service using batch script.(this csript will be run as a job where no manual <a href="https://interviewquestions.tuteehub.com/tag/intervention-239346" style="font-weight:bold;" target="_blank" title="Click to know more about INTERVENTION">INTERVENTION</a> is needed)<br/>I <a href="https://interviewquestions.tuteehub.com/tag/use-241643" style="font-weight:bold;" target="_blank" title="Click to know more about USE">USE</a> the commands "netstop IIS Admin Service " and "netstart IIS Admin service"<br/><br/>But the issues here is on executing "netstop IIS Admin Service" I am prompted to manually enter 'y/n' whether I want to <a href="https://interviewquestions.tuteehub.com/tag/stop-1228105" style="font-weight:bold;" target="_blank" title="Click to know more about STOP">STOP</a> this service. Now I need script/command where this <a href="https://interviewquestions.tuteehub.com/tag/parameter-244658" style="font-weight:bold;" target="_blank" title="Click to know more about PARAMETER">PARAMETER</a> 'y' would be passed through the command/ script itself, rather than manually entering the same.<br/><br/>Can anybody plz help me out??There are two <a href="https://interviewquestions.tuteehub.com/tag/ways-25480" style="font-weight:bold;" target="_blank" title="Click to know more about WAYS">WAYS</a> you can stop and restart IIS: from a DOS command line or from Windows. <br/><br/>from a DOS command line<br/><br/> To stop IIS, at the DOS command prompt, type, <br/>iisreset /stop<br/> To restart it, type <br/>iisreset /start<br/><br/><br/>Then execute the batch</p></body></html>
8972.

Solve : MSDOS 6.2.2 disks?

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> Everyone,<br/>I have an old computer that runs on dos 6.2.2 and I need to re-install the O/S. Does anyone have the 3 disks that you can email me or know of a website that I can download the disks? I would appreciate it very much. Thanks a lot in advance.<br/><br/>SapphireQuote from: sapphireml on October 15, 2007, 08:41:11 AM<blockquote>Hi Everyone,<br/>I have an old computer that runs on dos 6.2.2 and I need to re-install the O/S. Does anyone have the 3 disks that you can email me or know of a website that I can download the disks?<br/></blockquote><br/>MS-DOS 6.22 was never released by Microsoft, therefore it cannot legally be <a href="https://interviewquestions.tuteehub.com/tag/shared-1204803" style="font-weight:bold;" target="_blank" title="Click to know more about SHARED">SHARED</a> via email or website.<br/><br/>Here is one place, with several options for you to purchase it:<br/><a href="https://cgi.ebay.com/Ms-Dos-6-22-Original_W0QQitemZ120171737347QQihZ002QQcategoryZ11685QQssPageNameZWDVWQQrdZ1QQcmdZViewItem"> Link</a><br/><br/><a href="https://cgi.ebay.com/MS-DOS-6-22-With-Enhanced-Tools-Unopened-in-Shrinkwrap_W0QQitemZ150171707046QQihZ005QQcategoryZ11685QQssPageNameZWDVWQQrdZ1QQcmdZViewItem">Another link</a><br/><br/>Maybe someone else will post some other ideas for you, ... <a href="https://interviewquestions.tuteehub.com/tag/inexpensivebrbr-2130225" style="font-weight:bold;" target="_blank" title="Click to know more about INEXPENSIVE">INEXPENSIVE</a> places to purchase it.<br/><br/><br/>Quote from: sapphireml on October 15, 2007, 08:41:11 AM<blockquote>Hi Everyone,<br/>I have an old computer that runs on dos 6.2.2 and I need to re-install the O/S.<br/>...<br/></blockquote><br/><br/>You didn't mention what the computer would be used for, after the re-install.<br/>Windows 3.1, for example.<br/>If it is to be <a href="https://interviewquestions.tuteehub.com/tag/win-732367" style="font-weight:bold;" target="_blank" title="Click to know more about WIN">WIN</a> 3.1, then this next idea to consider won't work.<br/><br/>There are free "dos" operating systems out there. You'd have to read about them to decide if they will do what you want though.<br/><br/><a href="http://www.freedos.org">FreeDos</a><br/><a href="https://en.wikipedia.org/wiki/FreeDOS">Some reading, for what it is worth, on FreeDos</a><br/><a href="http://www.deltasoft.com/opendos.htm">OpenDos</a><br/><a href="https://en.wikipedia.org/wiki/OpenDOS">Some reading on Open Dos</a><br/>This is a computer belonging to a customer whom I am providing technical support for. Need to re-install everything because the hard disk has crashed. Thanks.Quote from: sapphireml on October 15, 2007, 09:41:21 AM<blockquote>This is a computer belonging to a customer whom I am providing technical support for. <br/></blockquote><br/>Then you'll have to do it legit, and recommend that the customer purchase<br/>a copy of 6.22.<br/><br/>Quote<blockquote>Need to re-install everything because the hard disk has crashed. Thanks.<br/></blockquote><br/>umm.. ... we don't know what "everything" entails. But that is ok.<br/><br/>You are right. Anyway, I think I just need the <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 disk 2 because disks 1 and 3 seem to be readable. Thanks.</body></html>
8973.

Solve : ms-dos?

Answer» <html><body><p>How to change fonts or <a href="https://interviewquestions.tuteehub.com/tag/backgrounds-891118" style="font-weight:bold;" target="_blank" title="Click to know more about BACKGROUNDS">BACKGROUNDS</a> on Command prompt<br/>Do not knoew waht to do!!!....<br/><br/>Quote</p><blockquote>Sets the default console foreground and <a href="https://interviewquestions.tuteehub.com/tag/background-11619" style="font-weight:bold;" target="_blank" title="Click to know more about BACKGROUND">BACKGROUND</a> colors.<br/><br/>COLOR [attr]<br/><br/> attr Specifies color attribute of console output<br/><br/>Color attributes are specified by <a href="https://interviewquestions.tuteehub.com/tag/two-241629" style="font-weight:bold;" target="_blank" title="Click to know more about TWO">TWO</a> hex digits -- the first<br/>corresponds to the background; the second the foreground. Each digit<br/>can be any of the following values:<br/><br/> 0 = <a href="https://interviewquestions.tuteehub.com/tag/black-399326" style="font-weight:bold;" target="_blank" title="Click to know more about BLACK">BLACK</a> 8 = Gray<br/> 1 = Blue 9 = Light Blue<br/> 2 = Green A = Light Green<br/> 3 = Aqua B = Light Aqua<br/> 4 = Red C = Light Red<br/> 5 = Purple D = Light Purple<br/> <a href="https://interviewquestions.tuteehub.com/tag/6-237686" style="font-weight:bold;" target="_blank" title="Click to know more about 6">6</a> = Yellow E = Light Yellow<br/> 7 = White F = Bright White<br/><br/>If no argument is given, this command restores the color to what it was<br/>when CMD.EXE started. This value either comes from the current console<br/>window, the /T command line switch or from the DefaultColor registry<br/>value.<br/><br/>The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute<br/>the COLOR command with a foreground and background color that are the<br/>same.<br/><br/>Example: "COLOR fc" produces light red on bright white</blockquote><br/>Please try a more definitive name to your topic next time...</body></html>
8974.

Solve : Listing Original File Creation Dates?

Answer» <html><body><p>Would anyone being willing to help a DOS novice with a problem. I am trying to produce a list of all files on 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> storage device based upon the file creation date prior to being copied to the drive. The creation date for most if not all files on the drive is the date that the files were copied to the drive. Is there a field that can be <a href="https://interviewquestions.tuteehub.com/tag/viewed-1446330" style="font-weight:bold;" target="_blank" title="Click to know more about VIEWED">VIEWED</a>, which shows the original creation date for a given file? Additionally, is there a method to using the DIR command to list all files created after or before a given date, that happen to be archived in multiple subdirectories on the drive? Any assistance would be greatly appreciated.<br/><br/>Newbdir /tc tells you the creation date/time<br/><br/>It doesnt look <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> you can expand the date time in a for loop to give you the creation date.<br/><br/>If you need to use this programmatically, you will need to use the result of a dir in a for loop<br/><br/>There is no way to filter a directory listing based on the date, again you will nee to do this programmatically (date functions in dos are non-existent)<br/><br/>Check out Logparser, this is likely to meet all your needs : <a href="https://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;DisplayLang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&amp;DisplayLang=en</a><br/>GrahamQuote from: Mimaca on October 14, 2007, 05:25:46 PM</p><blockquote>Would anyone being willing to help a DOS novice with a problem. I am trying to produce a list of all files on an external storage device based upon the file creation date prior to being copied to the drive. The creation date for most if not all files on the drive is the date that the files were copied to the drive. Is there a field that can be viewed, which shows the original creation date for a given file? Additionally, is there a method to using the DIR command to list all files created after or before a given date, that happen to be archived in multiple subdirectories on the drive? Any assistance would be greatly appreciated.<br/><br/>Newb<br/></blockquote>problem with DIR is that its not able to show you the date creation till the seconds <a href="https://interviewquestions.tuteehub.com/tag/level-246691" style="font-weight:bold;" target="_blank" title="Click to know more about LEVEL">LEVEL</a>...i have seen how it can be done in pure batch, but its tedious. if you don't mind vbscript...here's one<br/>Code: <a>[Select]</a>On Error Resume Next<br/>Set objFSO = CreateObject("Scripting.FileSystemObject")<br/>strFolder="c:\temp" 'you can pass in as script argument too...<br/>Set wshArgs = WScript.Arguments<br/>If wshArgs(0) = "" Or wshArgs(1) = " " Then<br/> WScript.Echo "Usage: cscript /nologo " &amp; Wscript.ScriptName &amp; " "&amp; """MM-DD-YYYY HH-MM-SS""" &amp; " -b(efore)|-a(fter)"<br/> WScript.Quit(1)<br/>End If <br/>dateToCheck = wshArgs(0)<br/>WScript.Echo dateToCheck<br/>b4after = wshArgs(1)<br/><br/>Sub DoWalk(sDir) <br/> Set objFolder = objFSO.GetFolder(sDir)<br/> For Each Files In objFolder.Files<br/> numDays = DateDiff("d", Files.DateCreated , dateToCheck)<br/> If Right(b4after,1) = "a" And numDays &lt; 0 then <br/> WScript.Echo Files, Files.DateCreated<br/> ElseIf Right(b4after,1) = "b" And numDays &gt; 0 Then<br/> WScript.Echo Files, Files.DateCreated<br/> End If <br/> Next <br/> For Each oDir in objFolder.SubFolders<br/> DoWalk oDir.Path<br/> Next<br/>End Sub<br/><br/>DoWalk strFolder<br/>usage: save as myscript.vbs, and on command line, <a href="https://interviewquestions.tuteehub.com/tag/type-238192" style="font-weight:bold;" target="_blank" title="Click to know more about TYPE">TYPE</a> cscript /nologo myscript.vbs. <br/><br/></body></html>
8975.

Solve : Creating Batch File?

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 would like to know if their is a way to create a Batch File (or anything else)<br/>That will start a App1.exe<br/><br/>Once the App1.exe finished (closed) The App2.exe Start.<br/>Once the App2.exe finished (closed) The App3.exe Start......<br/><br/>Any <a href="https://interviewquestions.tuteehub.com/tag/idea-770073" style="font-weight:bold;" target="_blank" title="Click to know more about IDEA">IDEA</a>?start /WAIT "" "App1.exe"<br/>start /WAIT "" "App2.exe"<br/><br/>etc<br/>Thank you man.<br/>Your the Best You should put in "test" for the second step but I forgot my the first step.<br/>Instructions are on thiswebsite <a href="https://interviewquestions.tuteehub.com/tag/get-11812" style="font-weight:bold;" target="_blank" title="Click to know more about GET">GET</a> it from therer if you want. Quote from: dos <a href="https://interviewquestions.tuteehub.com/tag/nerd-1113695" style="font-weight:bold;" target="_blank" title="Click to know more about NERD">NERD</a> on <a href="https://interviewquestions.tuteehub.com/tag/october-584768" style="font-weight:bold;" target="_blank" title="Click to know more about OCTOBER">OCTOBER</a> 15, 2007, 12:07:43 AM<blockquote>You should put in "test" for the second step but I forgot my the first step.<br/>Instructions are on thiswebsite get it from therer if you want. <br/></blockquote><br/>dos nerd, are you for real?<br/><br/></body></html>
8976.

Solve : The Open File - Security Warning dialog box is displayed when you try to silentl?

Answer» <html><body><p>Hi,<br/><br/>The Open File - Security Warning dialog box is displayed when you try to silently install a hotfix or an update by using a batch file in Windows XP Service Pack <a href="https://interviewquestions.tuteehub.com/tag/2-236987" style="font-weight:bold;" target="_blank" title="Click to know more about 2">2</a> .<br/>is there any option to control the box using batch file becoz i m updating patches using beyond.exe.when <a href="https://interviewquestions.tuteehub.com/tag/ever-aeur-976690" style="font-weight:bold;" target="_blank" title="Click to know more about EVER">EVER</a> i am communicating remote machine the box is <a href="https://interviewquestions.tuteehub.com/tag/displaying-2059353" style="font-weight:bold;" target="_blank" title="Click to know more about DISPLAYING">DISPLAYING</a> .<br/>Pls <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 in this issue.<br/><br/>pls see the attachment<br/>thanks in advance.<br/><br/>senthil<br/>On what are we voting? Your choices are the same! Where am I?? Florida? Ohio? Chicago? Ursenthils did you observe that the options you have given are same?<br/>Or did you not intend to make a poll at all?You cannot make a Batch File close a <a href="https://interviewquestions.tuteehub.com/tag/program-246414" style="font-weight:bold;" target="_blank" title="Click to know more about PROGRAM">PROGRAM</a> or anything.<br/><br/>Oh yeah, and what attachment may I ask?Hi,<br/><br/>i want to update symantec antivirus software update silently . when i creating bat file to install the AV using beyond.exe, the pop up is appears.is it possible to install the software silently.<br/>Anyhelp,,,<br/><br/>thanks,<br/><br/>senthilDoesn't Symantec include those kinds of options in their software?</p></body></html>
8977.

Solve : Copying a file to multiple machines?

Answer» <html><body><p>Hello everyone. I am trying to create a <a href="https://interviewquestions.tuteehub.com/tag/bat-394554" style="font-weight:bold;" target="_blank" title="Click to know more about BAT">BAT</a> file that will <a href="https://interviewquestions.tuteehub.com/tag/copy-25621" style="font-weight:bold;" target="_blank" title="Click to know more about COPY">COPY</a> a file over to <a href="https://interviewquestions.tuteehub.com/tag/mutiple-2850166" style="font-weight:bold;" target="_blank" title="Click to know more about MUTIPLE">MUTIPLE</a> machines on our network. I have all the machines on our network exported to a txt file. I have the file I need to copy to these machines in the root of my c partition. I need to know what the DOS command would be to copy this file down to all the machines in this txt file.<br/><br/>Thanks,<br/>Brianto connect to network try net <a href="https://interviewquestions.tuteehub.com/tag/use-241643" style="font-weight:bold;" target="_blank" title="Click to know more about USE">USE</a><br/><br/>Code: <a>[Select]</a>C:\&gt;net use ?<br/>The syntax of this command is:<br/><br/><br/>NET USE<br/>[devicename | *] [\\computername\sharename[\<a href="https://interviewquestions.tuteehub.com/tag/volume-238165" style="font-weight:bold;" target="_blank" title="Click to know more about VOLUME">VOLUME</a>] [password | *]]<br/> [/USER:[domainname\]username]<br/> [/USER:[dotted domain name\]username]<br/> [/USER:[<a href="/cdn-cgi/l/email-protection">[emailprotected]</a> domain name]<br/> [/SMARTCARD]<br/> [/SAVECRED]<br/> [[/DELETE] | [/PERSISTENT:{YES | NO}]]<br/><br/>NET USE {devicename | *} [password | *] /HOME<br/><br/>NET USE [/PERSISTENT:{YES | NO}]<br/><br/>Quote from: brayknee on October 09, 2007, 12:49:12 PM</p><blockquote>Hello everyone. I am trying to create a bat file that will copy a file over to mutiple machines on our network. I have all the machines on our network exported to a txt file. I have the file I need to copy to these machines in the root of my c partition. I need to know what the DOS command would be to copy this file down to all the machines in this txt file.<br/><br/>Thanks,<br/>Brian<br/></blockquote><br/>I think you could get a USB with enough bites to copy and then create a shortcut to another computer. dos nerd, could you please ONLY post when BOTH these things are true:-<br/><br/>a. You understand the question<br/><br/>b. You know the answer<br/><br/>(You're getting noticed.)<br/><br/></body></html>
8978.

Solve : Making text appear HELP!!!?

Answer» <html><body><p>I want the DOS <a href="https://interviewquestions.tuteehub.com/tag/window-11540" style="font-weight:bold;" target="_blank" title="Click to know more about WINDOW">WINDOW</a> to <a href="https://interviewquestions.tuteehub.com/tag/come-409636" style="font-weight:bold;" target="_blank" title="Click to know more about COME">COME</a> up and type <br/>hi. (after 1 second) . (after 1 second) . (after 1 second) . (on and on and on)<br/>HELP!!!So...<br/><br/>Quote</p><blockquote>@echo off<br/>set /a DOT=1<br/>:start<br/>if %DOT% LSS 4 cls <br/>if %DOT% EQU 1 echo Hi.<br/>if %DOT% EQU 2 echo Hi..<br/>if %DOT% EQU 3 echo Hi...<br/>if %DOT% LSS 4 set /a DOT=%DOT%+1<br/>if %DOT% EQU 4 set /a DOT=1<br/>ping -n 2 -<a href="https://interviewquestions.tuteehub.com/tag/w-236579" style="font-weight:bold;" target="_blank" title="Click to know more about W">W</a> 2000 localhost &gt;nul<br/>goto start</blockquote><br/>Is that about it?You <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> have to<br/>make sur that your MS-DOS background is not the same colour as your font.<br/>Then if that doesn't work just press "DIR ..." lots of times. That might work.]<br/>From ??dos nerd, could you please ONLY post when BOTH these things are true:-<br/><br/>a. You <a href="https://interviewquestions.tuteehub.com/tag/understand-720010" style="font-weight:bold;" target="_blank" title="Click to know more about UNDERSTAND">UNDERSTAND</a> the question<br/><br/>b. You know the answer<br/><br/>(You're getting noticed.)<br/><br/><br/><br/><br/><br/></body></html>
8979.

Solve : How to organize files at times when using "AT" as a command??

Answer» <html><body><p>I <a href="https://interviewquestions.tuteehub.com/tag/really-1178981" style="font-weight:bold;" target="_blank" title="Click to know more about REALLY">REALLY</a> <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> itMaybe you should give more details of what you want to do, if this is <a href="https://interviewquestions.tuteehub.com/tag/even-976335" style="font-weight:bold;" target="_blank" title="Click to know more about EVEN">EVEN</a> a genuine <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/><br/></p></body></html>
8980.

Solve : How to pass a comma delimited string to the DOS batch file??

Answer» <html><body><p>I want to pass a string contains the comma, such as "A,B,C", to the DOS batch file. I want the whole string to be treated as ONE, not THREE separated parameters, how can I accomplish this?<br/><br/>thanksexplain further, what <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a> are using the delims with ?This any use?<br/><br/>Quote</p><blockquote><br/>C:\&gt;type testme.bat<br/>@echo off<br/>echo a,b,c &gt; test.txt<br/>echo d,e,f &gt;&gt; test.txt<br/>echo <a href="https://interviewquestions.tuteehub.com/tag/h-236823" style="font-weight:bold;" target="_blank" title="Click to know more about H">H</a>,i,j &gt;&gt; test.txt<br/><br/>for /f "delims==" %%L in (test.txt) do (<br/> echo %%L<br/> )<br/><br/>C:\&gt;testme.bat<br/>a,b,c<br/>d,e,f<br/>h,i,j<br/><br/></blockquote>here is the example:<br/><br/>Quote<blockquote>&gt; type test.bat<br/>@echo off<br/><br/>external_program /para:"%1"<br/><br/></blockquote><br/>What I expect is:<br/><br/>test A,B,C<br/><br/>the batch file will call that external program in the format of <br/>external_program /para:"A,B,C"Quote from: OldJack on October 13, <a href="https://interviewquestions.tuteehub.com/tag/2007-290053" style="font-weight:bold;" target="_blank" title="Click to know more about 2007">2007</a>, 10:38:32 AM<blockquote>here is the example:<br/><br/>Quote<blockquote>&gt; type test.bat<br/>@echo off<br/><br/>external_program /para:"%1"<br/><br/></blockquote><br/>What I expect is:<br/><br/>test A,B,C<br/><br/>the batch file will call that external program in the format of <br/>external_program /para:"A,B,C"<br/></blockquote><br/>OK I'm with you now.<br/><br/>First add quotes <br/><br/>test "a,b,c"<br/><br/>Then remove them with the ~ modifier in the batch file if you need to or just <a href="https://interviewquestions.tuteehub.com/tag/leave-1070813" style="font-weight:bold;" target="_blank" title="Click to know more about LEAVE">LEAVE</a> them.<br/><br/>Quote<blockquote><br/><br/>C:\&gt;type test2.bat<br/>@echo off<br/>echo %1<br/>echo %~1<br/>echo "%~1"<br/>echo external_program /para:"%~1"<br/>echo external_program /para:%1<br/><br/>C:\&gt;test2.bat a,b,c<br/>a<br/>a<br/>"a"<br/>external_program /para:"a"<br/>external_program /para:a<br/><br/>C:\&gt;test2.bat "a,b,c"<br/>"a,b,c"<br/>a,b,c<br/>"a,b,c"<br/>external_program /para:"a,b,c"<br/>external_program /para:"a,b,c"<br/><br/></blockquote><strong>Excellent! Thanks.</strong><br/><br/>Quote<blockquote><br/><br/>C:\&gt;type test2.bat<br/>@echo off<br/>echo %1<br/>echo %~1<br/>echo "%~1"<br/>echo external_program /para:"%~1"<br/>echo external_program /para:%1<br/><br/>C:\&gt;test2.bat a,b,c<br/>a<br/>a<br/>"a"<br/>external_program /para:"a"<br/>external_program /para:a<br/><br/>C:\&gt;test2.bat "a,b,c"<br/>"a,b,c"<br/>a,b,c<br/>"a,b,c"<br/>external_program /para:"a,b,c"<br/>external_program /para:"a,b,c"<br/><br/></blockquote></body></html>
8981.

Solve : merge files with COPY?

Answer» <html><body><p>Is there any easy way to merge many files into one file using the COPY command without naming each file?<br/><br/>Rather than:<br/><br/>copy file1.txt+file2.txt... outfile.txt<br/><br/>I tried:<br/><br/>copy *.txt outfile.txt<br/><br/>I am <a href="https://interviewquestions.tuteehub.com/tag/new-1114486" style="font-weight:bold;" target="_blank" title="Click to know more about NEW">NEW</a> to this so any advice is appreciated.At the prompt<br/><br/>for %a in ("*.txt") do type %a &gt;&gt; outfile.txt<br/><br/>In a batch file change % to %%<br/><br/>When testing, delete outfile.txt before running it a second time!<br/><br/><br/><br/>thank you, contrex.<br/><br/>this worked great but it seems to be doubling my file when it makes the final outfile.txt??<br/><br/>i think i found it. it seems to be copying the final outfile into outfile again. i changed the file <a href="https://interviewquestions.tuteehub.com/tag/extension-kaya-455373" style="font-weight:bold;" target="_blank" title="Click to know more about EXTENSION">EXTENSION</a> on the outfile to .wrk. this seems to work.<br/><br/>is it possible to apply the same logic to a CRLF dos program that i run. rather than typing every file name?<br/><br/>crlf 500.txt 182 /c /s2 /ff500.txt /d<br/>crlf 501.txt 182 /c /s2 /ff501.txt /d<br/>...<br/><br/>thanks, again.<br/><br/>any recommended books i can read on dos to learn this?Quote from: benm on October 09, 2007, 07:57:28 PM</p><blockquote>i think i found it. it seems to be copying the final outfile into outfile again. </blockquote><br/>I am pretty <a href="https://interviewquestions.tuteehub.com/tag/sure-656539" style="font-weight:bold;" target="_blank" title="Click to know more about SURE">SURE</a> - not 100% -that if it isn't there when you run the command it won't be seen by the "*.txt". You may be leaving outfile there after running the command so the next time you run it, it gets found by "*.txt". <br/><br/>You could either give the merged file a different extension or have it in a different folder.<br/><br/>Quote<blockquote>is it possible to apply the same logic to a CRLF dos program that i run. rather than typing every file name?<br/><br/>crlf 500.txt 182 /c /s2 /ff500.txt /d<br/>crlf 501.txt 182 /c /s2 /ff501.txt /d<br/></blockquote><br/>Try this<br/><br/>for %a in ("*.txt") do crlf %a 182 /c /s2 /ff%a /d<br/><br/>Quote<blockquote>any recommended books i can read on dos to learn this?<br/></blockquote><br/>I just used online guides but you could check your library.<br/><br/>DOS the Easy Way by Everett Murdock Ph.D. isn't too bad.<br/><br/><br/><br/><br/>contrex - thank you, you've been very helpful.<br/><br/>one last question I hope - i have been running these in a .bat file in the same folder where the files are located. how do you i specify the folder (c:\data\etc) in the commands you've provided?<br/><br/>thanks,<br/>BenQuote from: benm on October 11, 2007, 07:52:33 AM<blockquote>one last question I hope - i have been running these in a .bat file in the same folder where the files are located. how do you i specify the folder (c:\data\etc) in the commands you've provided?<br/></blockquote><br/>Something like this...<br/><br/>You put it in front of the filespec for the source files<br/><br/>for %a in ("C:\data\apple\orange\*.txt") do crlf %a 182 /c /s2 /ff%a /dff%a /d<br/><br/>I presume your crlf program will <a href="https://interviewquestions.tuteehub.com/tag/take-662846" style="font-weight:bold;" target="_blank" title="Click to know more about TAKE">TAKE</a> path names in its parameters<br/><br/>so you'd put the path in the appropriate place<br/><br/>for %a in ("C:\data files\path has spaces\apple\orange\*.txt") do crlf %%a 182 /c /s2 /"C:\data\pear\so does this one\banana\ff%%a" /d<br/><br/>note where I use quotes<br/><br/>In a batch you can open out the loop using brackets which can make it easier to visualise what's going on. You can have multiple lines.<br/><br/>For example<br/><br/>for %%a in ("C:\data files\path has spaces\apple\orange\*.txt") do (<br/> echo source file is %%a<br/> echo target file is C:\data\pear\so does this one\banana\ff%%a<br/> crlf %%a 182 /c /s2 /"C:\data\pear\so does this one\banana\ff%%a" /d<br/> )<br/><br/>ok, let's <a href="https://interviewquestions.tuteehub.com/tag/see-630247" style="font-weight:bold;" target="_blank" title="Click to know more about SEE">SEE</a> if i can explain what's happening.<br/><br/>i tried this in the folder where the files are located<br/><br/>for %%a in ("*.txt") do crlf %%a 182 /c /s2 /ff%%a /d<br/><br/>the crlf program did work but it seems to be grabbing the first file it processed and processing it again. so if i started with 3 input files, i get 4 output files - 3 starting with f and one starting with ff. <br/><br/>next, i tried specifying where the files were located using:<br/><br/>for %%a in ("F:\ZIP4\DOS\*.txt") do crlf %%a 182 /c /s2 /"F:\ZIP4\DOS\ff%%a" /d<br/><br/>this is the message i got: Failure in opeing working file: :\ZIP4\DOS\ffF:\ZIP4\DOS\500.txt<br/><br/>any thoughts?<br/>with a little more experimenting, this is what i got to work <br/><br/>for %%a in ("F:\ZIP4\RAW\IA\*.txt") do crlf %%a 182 /c /s2 /d<br/>for %%a in ("F:\ZIP4\RAW\IA\*.wrk") do type %%a &gt;&gt; F:\ZIP4\RAW\IA\iaprod.txt<br/>move F:\ZIP4\RAW\IA\iaprod.txt F:\ZIP4\PROD<br/>del F:\ZIP4\RAW\IA\*.wrk<br/><br/>the crlf program outputs the file with a .wrk extension.<br/>and renaming the output file to .txt when the input files are .wrk avoids the the file being doubled up in the end.<br/><br/>thank you very much for your help, contrex.</body></html>
8982.

Solve : List all files except .lst files?

Answer» <html><body><p>Is there a <a href="https://interviewquestions.tuteehub.com/tag/simple-1208262" style="font-weight:bold;" target="_blank" title="Click to know more about SIMPLE">SIMPLE</a> way of doing this in DOS?Pipe the output of <a href="https://interviewquestions.tuteehub.com/tag/dir-431995" style="font-weight:bold;" target="_blank" title="Click to know more about DIR">DIR</a> through FIND.EXE thus:-<br/><br/>dir | find /v /i ".lst"<br/><br/>Quote</p><blockquote><br/>S:\Backup\Test\hide files&gt;find /?<br/>Searches for a text string in a file or files.<br/><br/>FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]<br/><br/> /V Displays all lines NOT containing the specified string.<br/> /C Displays only the count of lines containing the string.<br/> /N Displays line numbers with the displayed lines.<br/> /I Ignores the case of characters when searching for the string.<br/> /OFF[LINE] Do not skip files with offline attribute set.<br/> "string" Specifies the text string to find.<br/> [drive:][path]filename<br/> Specifies a file or files to search.<br/><br/>If a path is not specified, FIND searches the text <a href="https://interviewquestions.tuteehub.com/tag/typed-1434711" style="font-weight:bold;" target="_blank" title="Click to know more about TYPED">TYPED</a> at the prompt<br/>or piped from another command.<br/><br/>S:\Backup\Test\hide files&gt;dir<br/>Volume in drive S is USB_HDD<br/>Volume Serial Number is 6C1A-995E<br/><br/>Directory of S:\Backup\Test\hide files<br/><br/>12/10/2007 15:09 &lt;DIR&gt; ..<br/>12/10/2007 15:09 &lt;DIR&gt; .<br/>12/10/2007 15:03 8 hello.doc<br/>12/10/2007 15:03 8 hello.lst<br/>12/10/2007 15:03 8 hello.txt<br/>12/10/2007 15:09 8 HuLLO.LsT<br/>12/10/2007 15:08 8 HALLO.LST<br/> 5 File(s) 40 bytes<br/> 2 Dir(s) 222,062,141,440 bytes free<br/><br/>S:\Backup\Test\hide files&gt;dir /b<br/>hello.doc<br/>hello.lst<br/>hello.txt<br/>HuLLO.LsT<br/>HALLO.LST<br/><br/>S:\Backup\Test\hide files&gt;dir | find /I /V ".lst"<br/>Volume in drive S is USB_HDD<br/>Volume Serial Number is 6C1A-995E<br/><br/>Directory of S:\Backup\Test\hide files<br/><br/>12/10/2007 15:09 &lt;DIR&gt; ..<br/>12/10/2007 15:09 &lt;DIR&gt; .<br/>12/10/2007 15:03 8 hello.doc<br/>12/10/2007 15:03 8 hello.txt<br/> 5 File(s) 40 bytes<br/> 2 Dir(s) 222,062,141,440 bytes free<br/><br/>S:\Backup\Test\hide files&gt;dir /b | find /I /V ".lst"<br/>hello.doc<br/>hello.txt<br/><br/><br/></blockquote>might be better to <a href="https://interviewquestions.tuteehub.com/tag/use-241643" style="font-weight:bold;" target="_blank" title="Click to know more about USE">USE</a> findstr with "$"<br/>eg<br/>dir /B | findstr /I /V ".lst$"<br/>just in case.just in case what? (I'm curious)<br/><br/>Quote from: contrex on October 12, 2007, 10:26:51 AM<blockquote>just in case what? (I'm curious)<br/><br/><br/></blockquote>just in case some file's name might be "important.lsting" ? without trailing $ sign, it will be <a href="https://interviewquestions.tuteehub.com/tag/omittedbrbr-2889291" style="font-weight:bold;" target="_blank" title="Click to know more about OMITTED">OMITTED</a> from the results.Oh right. I was just answering the original question<br/><br/>Quote<blockquote>List all files except .lst files</blockquote><br/>Maybe the OP should specify what he/she wants<br/></body></html>
8983.

Solve : how to trim the last 4 characters from file?

Answer» <html><body><p>I've been using a for loop to parse out info from a dir &gt; list.lst file to build up a where clause.<br/><br/>ex. FieldName='%%i' OR<br/><br/>so after a few iterations, it <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> <a href="https://interviewquestions.tuteehub.com/tag/look-544452" style="font-weight:bold;" target="_blank" title="Click to know more about LOOK">LOOK</a> like this<br/><br/>FieldName='%%i' OR<br/>FieldName='%%i' OR<br/>FieldName='%%i' OR<br/><br/>well, I'll need to trim off the <a href="https://interviewquestions.tuteehub.com/tag/last-2782539" style="font-weight:bold;" target="_blank" title="Click to know more about LAST">LAST</a> <a href="https://interviewquestions.tuteehub.com/tag/4-238406" style="font-weight:bold;" target="_blank" title="Click to know more about 4">4</a> characters (' OR ' ) when I'm done. Any ideas?show your for loop...</p></body></html>
8984.

Solve : DOS Command for creating text file?

Answer» <html><body><p>Do you happen to know what the DOS command is to make a text file that would <a href="https://interviewquestions.tuteehub.com/tag/contain-409810" style="font-weight:bold;" target="_blank" title="Click to know more about CONTAIN">CONTAIN</a> a file listing of all files that had a certain extension (like DLL)?try<br/><br/>set a=%cd:~0,1%<br/>dir %a%:\*.dll /b /s &gt;&gt;%temp%\textfile &amp;<a href="https://interviewquestions.tuteehub.com/tag/amp-363144" style="font-weight:bold;" target="_blank" title="Click to know more about AMP">AMP</a>; cls &amp; type %temp%\textfile<br/><br/><br/>sets drive <a href="https://interviewquestions.tuteehub.com/tag/letter-11355" style="font-weight:bold;" target="_blank" title="Click to know more about LETTER">LETTER</a> as %a%<br/>&gt;&gt; send to a text file , in this case to your %temp% folder and to a textfile called textfile<br/>*.dll means all .dll files , if you typed *.* it would mean all files</p></body></html>
8985.

Solve : File Copy/Backup Datewise. Batch Help !!!?

Answer» <html><body><p>I'm using a batch file to backup data from a PC to a server. The batch file is using Robocopy as the command to copy the folders/files.<br/>I have a little problem.<br/><br/>The <a href="https://interviewquestions.tuteehub.com/tag/source-244756" style="font-weight:bold;" target="_blank" title="Click to know more about SOURCE">SOURCE</a> directory will contain folders in the format of date i.<a href="https://interviewquestions.tuteehub.com/tag/e-236626" style="font-weight:bold;" target="_blank" title="Click to know more about E">E</a>., "dd-mm-yyyy" , so for today's date, 9th October 2007 there will be a folder whose name is - "09_10_2007" along with folders for earlier dates like "08_10_2007" and so on.<br/><br/>The purpose is, for any given date I'm supposed to copy the folder for the previous date (or a folder that has a name with a 2days old date)and thats what I cant achieve. On 9th Oct 07 I can copy the folder "09_10_2007" but on 9th Oct 07 I need to copy the folder "08_10_2007"<br/><br/>Using the following command I can copy the folder for current date :<br/><br/><strong>robocopy "\\xxx.xxx.xxx.xxx\C$\Backup\%Date:~-7,2%_%Date:~-10,2%_%Date:~-4,4%" "%BackTemp%" /e /ZB /R:2 /w:10 /log+:""%<a href="https://interviewquestions.tuteehub.com/tag/backlog-891127" style="font-weight:bold;" target="_blank" title="Click to know more about BACKLOG">BACKLOG</a>%"\logs%Date:~-7,2%_%Date:~-10,2%_%Date:~-4,4%.txt"</strong><br/><br/>Where <em>"%BackTemp%" &amp; "%BackLog%" </em> are pre-defined variables.<br/><br/><br/><strong>Can anyone please advice me how I can copy the folder for the previous date on any given date ??</strong>You need an algorithm to determine yesterday's date... Many lines of code... Perl can do it in <a href="https://interviewquestions.tuteehub.com/tag/one-241053" style="font-weight:bold;" target="_blank" title="Click to know more about ONE">ONE</a> line:-<br/><br/>Google for "yesterday's date batch"<br/><br/><br/><br/><br/><br/>Thanks contrex.<br/>I had been Googling uot for <a href="https://interviewquestions.tuteehub.com/tag/achieving-7279732" style="font-weight:bold;" target="_blank" title="Click to know more about ACHIEVING">ACHIEVING</a> this , I did find something useful but would need your assistance on this to pickup a folder with yesterday's date from the source ( as I had described earlier)1 calculate yesterday's date in the right format: dd-mm-yyyy (similar to your existing today's date format)<br/>2 Put it in a variable called e.g. YDate<br/>3 change each occurence of Date to YDate in your Robocopy command, and it will get sliced just like todays's date string would.<br/><br/>e.g. Robocopy "\\xxx.xxx.xxx.xxx\C$\Backup\%YDate:~-7,2%...(etc)<br/><br/>generalised algorithm for calculating yesterdays date:<br/><br/>date is dd-mm-yyyy<br/><br/>(easiest case)<br/>If the day number dd is 2 or greater<br/><br/> keep mm and yyyy the same<br/> subtract 1 from dd<br/><br/>(harder ones)<br/>If the day number dd is 1<br/><br/> if the mm is 5,7,10 or 12<br/> keep yyyy the same<br/> subtract 1 from mm<br/> make dd=30<br/><br/> if the mm is 2,4,6,8,9 or 11<br/> keep yyyy the same<br/> subtract 1 from mm<br/> make dd=31<br/><br/> (hardest, often forgotten or done wrongly)<br/> if the mm is 3<br/> if yyyy is not a leap year<br/> keep yyyy the same<br/> subtract 1 from mm<br/> make dd=28<br/> if yyyy is a leap year<br/> keep yyyy the same<br/> subtract 1 from mm<br/> make dd=29<br/><br/> if the mm is 1 <br/> if the day is 2 or more<br/> keep mm and yyyy the same<br/> subtract 1 from dd<br/> if the day is 1<br/> subtract 1 from yyyy<br/> make mm=12<br/> make dd=31<br/><br/><br/> <br/><br/> <br/> <br/><br/><br/>the next closest thing you can use natively is vbscript<br/>here's one that calculate yesterday's date for you in the format dd_mth_year<br/>Code: <a>[Select]</a>d=Now<br/>yesterDay=DateAdd("d",-1,d)<br/>yestDay= Day(yesterDay)<br/>yestMth= Month(yesterDay)<br/>yestYr=Year(yesterDay)<br/>WScript.Echo yestDay&amp;"_"&amp;yestMth&amp;"_"&amp;yestYr<br/>save it as somescript.vbs<br/><br/>usage in batch: <br/><br/>Code: <a>[Select]</a>for /F %%a in ('cscript /nologo somescript.vbs') do set yest=%%a<br/>then you can use the variable %yest% anywhere in your batch<br/></p></body></html>
8986.

Solve : Creation of database in MSSQL using Batch scritpt?

Answer» <html><body><p>I want to crate database in MSSQL using Batch script I used it by <a href="https://interviewquestions.tuteehub.com/tag/two-241629" style="font-weight:bold;" target="_blank" title="Click to know more about TWO">TWO</a> <a href="https://interviewquestions.tuteehub.com/tag/ways-25480" style="font-weight:bold;" target="_blank" title="Click to know more about WAYS">WAYS</a>.<br/><a href="/cdn-cgi/l/email-protection">[emailprotected]</a> off<br/>SET ServerName=%1<br/><br/><br/><br/>for /f %%a in ('dir /b *.sql') do call :process %%a<br/><br/>goto end<br/>:process osql -E -S %ServerName% -n -i %1 &gt;&gt; Result.txt<br/><br/><br/>echo %1<br/>:end <br/>It is not creating any database.<br/><br/>2.Created .sql file for cration of database and <a href="https://interviewquestions.tuteehub.com/tag/run-1192138" style="font-weight:bold;" target="_blank" title="Click to know more about RUN">RUN</a> it batch script <br/><br/>by giving C:\Program Files\Microsoft SQL Server\90\NotificationServices\9.0.242\Bin&gt;<br/>Create.sql<br/><br/>It is giving error as C:\Program Files not found.<br/><br/>Help me...... <br/>Path with <a href="https://interviewquestions.tuteehub.com/tag/spaces-1219927" style="font-weight:bold;" target="_blank" title="Click to know more about SPACES">SPACES</a> needs quotes.<br/>Quote from: pravinshembekar on October 11, 2007, 04:30:48 AM</p><blockquote><br/>for /f %%a in ('dir /b *.sql') do call :process %%a<br/><br/>goto end<br/>:process osql -E -S %ServerName% -n -i %1 &gt;&gt; Result.txt<br/><br/><br/>echo %1<br/>:end <br/>It is not creating any database.</blockquote><br/>This line is the problem <br/>:process osql -E -S %ServerName% -n -i %1 &gt;&gt; Result.txt<br/><br/>This whole line is treated as a <a href="https://interviewquestions.tuteehub.com/tag/label-1065253" style="font-weight:bold;" target="_blank" title="Click to know more about LABEL">LABEL</a>, move the osql to the line below .... you will almost certainly have a 0 byte file called Result.txt<br/><br/>Graham</body></html>
8987.

Solve : how to delete files with certain string in them??

Answer» <html><body><p>Hi, I am a new user with very limited DOS experience.<br/><br/>I figured out how to find and display filenames with a certain string in them ie: findstr /i /m test .*.<br/><br/>If I would like to delete all those files in one go from that directory, what are the options, do I need to write a .<a href="https://interviewquestions.tuteehub.com/tag/bat-394554" style="font-weight:bold;" target="_blank" title="Click to know more about BAT">BAT</a> <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> (don't really know how to do that and how to address that particular directory)<br/>There is many holes in my Computer/Windows/DOS knowledge, so I apologize and hope you are patient with me.<br/>thanks, EdgarAny experience in QBasic? Interrupts can do it in DOS.<br/><br/>In Dos you can pipe the filenames to a file, but what are you really trying to do?<br/><br/>Sounds a little strange that you want to delete files with a certain string in them.<br/><br/>Ted<br/><br/>PS: Just because you delete a file, could still hold the data on the disk until overwritten.<br/>Thanks Ted,<br/>no, no experience in QBasic, and don't know what interrupts are.<br/><br/>I don't really want to pipe the filenames to a file, but I want to delete the files I <a href="https://interviewquestions.tuteehub.com/tag/found-458144" style="font-weight:bold;" target="_blank" title="Click to know more about FOUND">FOUND</a> with "findstr" out of that directory in one go, without having to do delete every file by itself.<br/><br/>thanks, Edgar<br/><br/>Code: <a>[Select]</a>for /f "tokens=*" %%a in ('findstr /I /M "search string" *txt') do (<br/> echo %%a<br/> rem your removal command here...<br/>)<br/>thanks ghostdog,<br/><br/>I gather this is the code for a <a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a> file? I am such a noob... <br/>Is this all it takes, then you just run this batch file in that directory?<br/>is the "rem your removal command here" needed or is it just a remark?<br/><br/>edgar1. Yes, that is the code<br/>2. You probably just need to leave it like that (except for the search strings)<br/>3. The <strong>rem</strong> specifies a remark; but your code that deletes files there (such as del %%a)So does the code go:<br/><br/>or /f "tokens=*" %%a in ('findstr /I /M "search string" *txt') do (<br/>echo %%a<br/>rem delete all files with search string in them<br/>del %%a<br/><br/>)You don't <strong>need</strong> (but it still works with) either echo %%a or the rem line: echo just displays %%a (which is deleted) and rem is just a remark and doesn't get printed (only viewable while editing your batch and therefore only needed if you want to keep notes).<br/><br/>But otherwise it's all good.Hi guys,<br/>thanks it worked! I used:<br/>or /f "tokens=*" %%a in ('findstr /I /M "search string" *txt') do (<br/> echo %%a<br/> rem delete all files with search string in them<br/>del %%a<br/><br/>)<br/><br/>and it did the trick. Now, two observations. On filenames with spaces in them it did not work. If the file has a different suffix than .txt it did not work (I suppose thats why *txt is in the code)<br/><br/>thanks for all your help, great forum.<br/>edgarQuote from: edgar on October 10, 2007, 06:05:33 PM</p><blockquote>On filenames with spaces in them it did not work.</blockquote><br/>using quotes thus: <strong>del "%%a" </strong> is the standard way around that.<br/><br/>Quote from: edgar on October 10, 2007, 06:05:33 PM<blockquote>If the file has a different suffix than .txt it did not work (I suppose thats why *txt is in the code)</blockquote><br/>In fact, in the code as shown in your post, the wildcard search (*txt) will take place on all files whose name or extension <a href="https://interviewquestions.tuteehub.com/tag/ends-971392" style="font-weight:bold;" target="_blank" title="Click to know more about ENDS">ENDS</a> in the three letters "txt",<br/><br/>so it would work on all these files<br/><br/>prices.txt<br/>process.etxt<br/>protetxt<br/><br/>NOT just files whose extension is .txt - for that the wildcard filespec would be *.txt - see the dot?<br/><br/>If you wanted to search all files, the wildcard filespec would be *.*</body></html>
8988.

Solve : new user with registry problems?

Answer» <html><body><p>i was recently given an older dell computer, it has had windows 98 program put onto it. everything seemed to be going great <a href="https://interviewquestions.tuteehub.com/tag/til-2307660" style="font-weight:bold;" target="_blank" title="Click to know more about TIL">TIL</a> i tried to download yahoo instant messenger.thats when i got the file message. the window will pop up for instant messageing and i can <a href="https://interviewquestions.tuteehub.com/tag/type-238192" style="font-weight:bold;" target="_blank" title="Click to know more about TYPE">TYPE</a> a message and send it, but then i cant <a href="https://interviewquestions.tuteehub.com/tag/see-630247" style="font-weight:bold;" target="_blank" title="Click to know more about SEE">SEE</a> what i have written or what anyone has written to me. i used the tips from your question and answer page to try to restore my registry and it didnt help. i dont really no very much about computers and have no <a href="https://interviewquestions.tuteehub.com/tag/ideal-246851" style="font-weight:bold;" target="_blank" title="Click to know more about IDEAL">IDEAL</a> what to do next. when i click on yahoo messenger i get 2 different internet script error pages.<br/>line 2499<br/>char 21<br/>error unexpected quantifier<br/>code 0<br/>url:file://c:\programfiles\yahoo!\messenger\tmpimv2.tmp<br/><br/><br/>line 2687<br/>char 1<br/>error '$handleresize' is undefined<br/>code 0<br/>url:file://c:\programfiles\yahoo!\messenger\tmpimv2.tmp<br/><br/>i also get a box that tells me that some of my files cannot be opened <br/>any help would be greatly appreciated<br/>thanks<a href="https://answers.yahoo.com/question/index?qid=20061120030526AAaLBmu">http://answers.yahoo.com/question/index?qid=20061120030526AAaLBmu</a><br/></p></body></html>
8989.

Solve : To check whether SQL Server is intalled.?

Answer» <html><body><p>Hi, All<br/><br/>I have to check whether sql server is installed on the machine where the batch script is executing by using Batch script.<br/><br/>Can anyone please give me the solution.<br/><br/>Thanks.I'm worried that you sound like a wannabee hacker. The following are trivial tasks:<br/><br/>(a) to find out if SQL server is installed.<br/>(b) to find out how to find out if SQL server is installed.<br/><br/>Please <a href="https://interviewquestions.tuteehub.com/tag/advise-850930" style="font-weight:bold;" target="_blank" title="Click to know more about ADVISE">ADVISE</a> <a href="https://interviewquestions.tuteehub.com/tag/aeuroereason-239555" style="font-weight:bold;" target="_blank" title="Click to know more about REASON">REASON</a> why you have asked this.<br/><br/>Quote from: Dipu on October 10, 2007, 04:32:39 AM</p><blockquote>Hi, All<br/><br/>I have to check whether sql server is installed on the machine where the batch script is executing by using Batch script.<br/><br/>Can anyone please give me the solution.<br/><br/>Thanks.<br/></blockquote>if you want to see whether its installed, you can go to Program files and search for its installation path.<br/>however, if you just want to check whether its up and running...a few ways<br/>1) SQL server usually runs on port 1433. So using a combination of <a href="https://interviewquestions.tuteehub.com/tag/netstat-7306474" style="font-weight:bold;" target="_blank" title="Click to know more about NETSTAT">NETSTAT</a> with options, findstr and using errorlevels, you can check whether its up<br/>2) using the sc command , #hint: type sc /? to see how to query mssql service. <br/>3) using command line mssql <a href="https://interviewquestions.tuteehub.com/tag/client-769117" style="font-weight:bold;" target="_blank" title="Click to know more about CLIENT">CLIENT</a> like osql, isql. Try to connect to the server, if <a href="https://interviewquestions.tuteehub.com/tag/returns-1187977" style="font-weight:bold;" target="_blank" title="Click to know more about RETURNS">RETURNS</a> error, then mssql is not up or not set up properly....</body></html>
8990.

Solve : a main batch file (see below) that will call and run 6 other batch files?

Answer» <html><body><p>My <a href="https://interviewquestions.tuteehub.com/tag/pc-590329" style="font-weight:bold;" target="_blank" title="Click to know more about PC">PC</a>: Window XP pro. with SP2<br/><br/>I am new to the Batch script. I have a main batch file (see below) that will call and run 6 other batch files for the nightly builds.<br/><br/>Right now, if the 1st batch file has the build error, it will hang on there, so other 5 batch files aren’t getting called at all. <br/><br/>Is there a way that the main batch file can continue call and run other batch files even if the 1st batch file - BW1_nightly_IS12.bat has not exited successfully?<br/><br/>Is there a way that I can get some sort of a message about the build errors for the BW1_nightly_IS12.bat?<br/><br/>Any input would be appreciated. <br/><br/>Thanks,<br/>Betty<br/>REM call multiple batch files to run the nightly release and debug version of the BW application<br/><br/>if exist "C:\batchFiles\nightluBuild_TIMESTAMP.TXT" del /Q "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/><br/>Now.exe START! &gt;&gt; "C:\work\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/><br/>Now.exe Running BW1 nightly build - release version - from trunk &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_nightly_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_IS12_buildLog.txt"<br/><br/>Now.exe running the BW1 nightly build - from C:\BW1_ORC Branch &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_ORC_nightly.bat" &gt; "C:\batchFiles\BW1\BW1_ORC_nightly_buildLog.txt"<br/><br/>Now.exe running the BW1 FIRMWARE build - from trunk &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_Firmware.bat" &gt; "C:\batchFiles\BW1\BW1_Firmware_buildLog.txt"<br/><br/>Now.exe running the BW1 FIRMWARE build - from BW1_ORC branch &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_ORC_Firmware.bat" &gt; "C:\batchFiles\BW1\BW1_ORC_Firmware_buildLog.txt"<br/><br/>Now.exe Running BW1 nightly build - debug version - trunk &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_nightly_DEBUG_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_DEBUG_IS12_buildLog.txt"<br/><br/>Now.exe Running BW1 nightly build - debug version - ORC branch &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_nightly_debug_ORC_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_debug_ORC_IS12_buildLog.txt"<br/><br/>Now.exe BUILD DONE! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/><br/><br/>I am thinking about to use the following line, and not sure if it’s a right way to do it.<br/>IF ERRORLEVEL ==1 GOTO label nightlyBuild2<br/><br/><br/>we test for ERRORLEVEL thus<br/><br/>IF ERRORLEVEL 1 GOTO nightlyBuild2<br/><br/>no equals signs, no word "label"<br/><br/>label looks like this<br/><br/>:nightlyBuild2<br/><br/><br/>Why don't you ask the person who wrote the batch files?<br/><br/><br/><br/>Hello Contrex,<br/><br/>Thank you very much for your help. I am the person who wrote the batch file <a href="https://interviewquestions.tuteehub.com/tag/since-644476" style="font-weight:bold;" target="_blank" title="Click to know more about SINCE">SINCE</a> I am pretty new to the batch script, and I really don't know how to do a lot of thing yet at this moment.<br/><br/>Here is the updated main batch file, please have a look and let me know what you think. <br/>One simple question, if the ERRORLEVEL is 0, what will happen to all labels? <br/><br/>Thanks a lot in advance,<br/><br/>Betty<br/><br/>REM call multiple batch files to run the nightly release and debug version of the BW application<br/><br/>if exist "C:\batchFiles\nightluBuild_TIMESTAMP.TXT" del /Q "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/><br/>Now.exe START! &gt;&gt; "C:\work\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/><br/>Now.exe Running BW1 nightly build - release version - from trunk &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_nightly_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_IS12_buildLog.txt"<br/>if errorlevel 1 goto notify1<br/>:notify1<br/>Now.exe BW1 nightly build - release version - from trunk exited with an errorlevel of 1! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>goto nightlyBuild2 <br/><br/>:nightlyBuild2 <br/>Now.exe running the BW1 nightly build - from C:\BW1_ORC Branch &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_ORC_nightly.bat" &gt; "C:\batchFiles\BW1\BW1_ORC_nightly_buildLog.txt"<br/>if errorlevel 1 goto notify2<br/>:notify2<br/>Now.exe BW1 nightly build - from C:\BW1_ORC Branch exited with an errorlevel of 1! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>goto nightlyBuild3 <br/><br/>:nightlyBuild3<br/>Now.exe running the BW1 FIRMWARE build - from trunk &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_Firmware.bat" &gt; "C:\batchFiles\BW1\BW1_Firmware_buildLog.txt"<br/>if errorlevel 1 goto notify3<br/>:notify3<br/>Now.exe BW1 FIRMWARE build - from trunk exited with an errorlevel of 1! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>goto nightlyBuild4 <br/><br/>:nightlyBuild4<br/>Now.exe running the BW1 FIRMWARE build - from BW1_ORC branch &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_ORC_Firmware.bat" &gt; "C:\batchFiles\BW1\BW1_ORC_Firmware_buildLog.txt"<br/>if errorlevel 1 goto notify4<br/>:notify4<br/>Now.exe BW1 FIRMWARE build - from BW1_ORC branch exited with an errorlevel of 1! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>goto nightlyBuild5 <br/><br/>:nightlyBuild5<br/>Now.exe Running BW1 nightly build - debug version - trunk &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_nightly_DEBUG_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_DEBUG_IS12_buildLog.txt"<br/>if errorlevel 1 goto notify5<br/>:notify5<br/>Now.exe BW1 nightly build - debug version exited with an errorlevel of 1! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>goto nightlyBuild6 <br/><br/>:nightlyBuild6<br/>Now.exe Running BW1 nightly build - debug version - ORC branch &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>call "C:\batchFiles\BW1\BW1_nightly_debug_ORC_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_debug_ORC_IS12_buildLog.txt"<br/>if errorlevel 1 goto notify6<br/>:notify6<br/>Now.exe BW1 nightly build - debug version - ORC branch exited with an errorlevel of 1! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>goto end <br/><br/>Now.exe BUILD DONE! &gt;&gt; "C:\batchFiles\nightluBuild_TIMESTAMP.TXT"<br/>:end;<br/>Quote from: betty1 on October 08, 2007, 02:31:24 PM</p><blockquote>One simple question, if the ERRORLEVEL is 0, what will happen to all labels? <br/></blockquote><br/>Answer: you need to rewrite that batch! <br/><br/>It is my bed time here in England, I will look at this tomorrow but I will say a small thing about errorlevel <br/><br/>Errorlevel can be between <a href="https://interviewquestions.tuteehub.com/tag/255-297944" style="font-weight:bold;" target="_blank" title="Click to know more about 255">255</a> and 1 for errors and 0 for success. It returns TRUE if the return code was equal to or higher than the specified errorlevel. This means most of the time we only need to check IF ERRORLEVEL 1 ... and this will return TRUE for every non-zero return code.<br/><br/>Consider this code<br/><br/>myprogram.exe<br/>IF ERRORLEVEL 1 goto bad<br/>echo myprogram.exe was successful!<br/>goto end<br/>:bad<br/>echo there was an error in myprogram.exe!<br/>:end<br/>echo end of batch<br/><br/>If myprogram.exe returned an errorlevel of 1 (or more!) then the IF is satisfied and the batch interpreter (cmd.exe) jumps to the label.<br/>If myprogram.exe returned an errorlevel of 0 then the IF is NOT satisfied and the interpreter goes to the next line.<br/><br/>Your code<br/><br/>Quote<blockquote>call "C:\batchFiles\BW1\BW1_nightly_IS12.bat" &gt; "C:\batchFiles\BW1\BW1_nightly_IS12_buildLog.txt"<br/>if errorlevel 1 goto notify1<br/>:notify1<br/></blockquote><br/>It will go to notify1 whether the errorlevel is 0 or &gt;=1 (it is going there anyway!)<br/><br/><br/><br/>thanks for your speedy reply. Am I on the right track?<br/><br/>thank you very much,<br/>Betty<br/><br/><br/><br/>call nightlyBuild1.bat<br/>IF ERRORLEVEL 1 goto bad1<br/>echo nightlyBuild1.bat was successful!<br/>goto nightlyBuild2<br/><br/>:nightlyBuild2<br/>call nightlyBuild2.bat<br/>IF ERRORLEVEL 1 goto bad2<br/>echo nightlyBuild2.bat was successful!<br/>goto nightlyBuild3<br/><br/>:nightlyBuild3<br/>call nightlyBuild3.bat<br/>IF ERRORLEVEL 1 goto bad3<br/>echo nightlyBuild3.bat was successful!<br/>goto end<br/><br/>:bad1<br/>echo there was an error in nightlyBuild.bat!<br/>goto nightlyBuild2<br/><br/>:bad2<br/>echo there was an error in nightlyBuild2.bat!<br/>goto nightlyBuild3<br/><br/>:bad3<br/>echo there was an error in nightlyBuild3.bat!<br/>goto end<br/><br/>:end<br/>echo end of batch<br/>Quote from: betty1 on October 08, 2007, 04:29:56 PM<blockquote>thanks for your speedy reply. Am I on the right track?<br/></blockquote><br/>Yes, you are! Well done!<br/><br/>I think you missed a 1 here...<br/><br/>Quote<blockquote>:bad1<br/>echo there was an error in nightlyBuild.bat!<br/>goto nightlyBuild2<br/></blockquote><br/>also you don't need the lines in red (they are redundant)<br/><br/>Quote<blockquote>call nightlyBuild1.bat<br/>IF ERRORLEVEL 1 goto bad1<br/>echo nightlyBuild1.bat was successful!<br/>goto nightlyBuild2<br/><br/>:nightlyBuild2<br/>call nightlyBuild2.bat<br/>IF ERRORLEVEL 1 goto bad2<br/>echo nightlyBuild2.bat was successful!<br/>goto nightlyBuild3<br/><br/>:nightlyBuild3<br/>call nightlyBuild3.bat<br/>IF ERRORLEVEL 1 goto bad3<br/>echo nightlyBuild3.bat was successful!<br/>goto end<br/></blockquote><br/><br/>thanks a looooooooooooooot for all your help.<br/><br/>Since I want the main batch file continue call and run other batch files even if the nightlyBuild1 has not exited successfully. I thought IF nightlyBuild1 retuned an errorlevel of 0 then the nightlyBuild2.bat will be skipped, that’s why I added the redundant line in my script to call the label “:nightlyBuild2”.<br/><br/>After I re-read your message again, I thought that I misunderstood the IF and errorlevel concepts. In fact, IF nightlyBuild1 retuned an errorlevel of 0 then the IF statement will return false, and then the program will go to the next line. Am I right?<br/><br/>Thanks,<br/>Betty<br/>Quote from: betty1 on October 09, 2007, 09:45:45 AM<blockquote>In fact, IF nightlyBuild1 retuned an errorlevel of 0 then the IF statement will return false, and then the program will go to the next line. Am I right?</blockquote><br/>Hi Betty<br/><br/>Yes, you are absolutely correct. If the IF test returns a 0 value, no diversion of normal program flow will happen.<br/><br/>For a mental exercise, you could try imagine what the code will look like if you tested for errorlevel 0 <a href="https://interviewquestions.tuteehub.com/tag/instead-248606" style="font-weight:bold;" target="_blank" title="Click to know more about INSTEAD">INSTEAD</a> of 1.<br/><br/>An unconnected note about ERRORLEVEL (since you sound nice!)<br/><br/>Some programs are capable of returning multiple errorlevels. Since <em>IF errorlevel N</em> will return TRUE for any errorlevel equal to or greater than N, to get the right one, it is necessary to test in descending order. For example suppose you had a program that had 5 possible errorlevels<br/><br/>LaunchSpaceship.exe<br/>IF errorlevel 5 goto alien-attack<br/>IF errorlevel 4 goto out-of-fuel<br/>IF errorlevel 3 goto pilot-is-drunk<br/>IF errorlevel 2 goto pilot-is-tired<br/>IF errorlevel 1 goto ships-cat-is-hungry<br/><br/>echo SUCCESSFUL LAUNCH<br/>goto next<br/><br/>:alien-attack<br/>(etc)<br/><br/>:next<br/><br/><br/><br/><br/><br/>Hello Contrex,<br/><br/>Thank you very much for <a href="https://interviewquestions.tuteehub.com/tag/providing-1171130" style="font-weight:bold;" target="_blank" title="Click to know more about PROVIDING">PROVIDING</a> me this very interesting example. I feel I have learned a lot from you today and yesterday. So, I'm really grateful for that.<br/><br/>Have a nice day,<br/>Betty<br/></body></html>
8991.

Solve : How to send an argument to a exe command in batch file.?

Answer» <html><body><p>Hi All,<br/><br/> Here is my question, we need to run an exe command called "scc add 192.29.193.19". When ever we run the command it will ask the following confirmation message from the user as shown below<br/><br/>Please type "yes" to approve: <br/><br/>Then user will type yes to run the command successfully. Since we want to <a href="https://interviewquestions.tuteehub.com/tag/automate-7261678" style="font-weight:bold;" target="_blank" title="Click to know more about AUTOMATE">AUTOMATE</a> the process, is there a way in DOS command to type the word "yes" by itself <a href="https://interviewquestions.tuteehub.com/tag/instead-248606" style="font-weight:bold;" target="_blank" title="Click to know more about INSTEAD">INSTEAD</a> of expecting user to type the letter.<br/><br/>Any help is greatly appreciated<br/><br/>Thanks<br/>KarthikIs that "yes" or "YES" or doesn't it matter? <br/><br/>And should ENTER be pressed? <br/><br/>And what does scc.exe do? (May be easier to write a substitute program)<br/><br/>Could try<br/><br/>echo yes &lt; scc.exe add ...<br/><br/><br/><br/><br/><br/>You are right, After I execute the scc command with the <a href="https://interviewquestions.tuteehub.com/tag/ip-14828" style="font-weight:bold;" target="_blank" title="Click to know more about IP">IP</a> Address it creates a site information in VPN for the specified IP address.<br/><br/>All we need to do is type "yes" and press enter then it gives message "Site successfully <a href="https://interviewquestions.tuteehub.com/tag/created-938398" style="font-weight:bold;" target="_blank" title="Click to know more about CREATED">CREATED</a>"<br/><br/>I want to automate typing "yes" and press enter button.<br/><br/>How can I do thatQuote from: karthiksp on October 09, 2007, 07:17:39 AM</p><blockquote><br/>I want to automate typing "yes" and press enter button.<br/><br/>How can I do that<br/></blockquote><br/>I wrote before... (Did you read it?)<br/><br/>Quote<blockquote>Could try<br/><br/>echo yes &lt; scc.exe add ...<br/></blockquote><br/></body></html>
8992.

Solve : Invalid system disk?

Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/windows-22662" style="font-weight:bold;" target="_blank" title="Click to know more about WINDOWS">WINDOWS</a> 95, Windows 98, and Windows ME users<br/><br/> 1. Boot from a bootable floppy <a href="https://interviewquestions.tuteehub.com/tag/diskette-440625" style="font-weight:bold;" target="_blank" title="Click to know more about DISKETTE">DISKETTE</a>.<br/> 2. At the A:\&amp;<a href="https://interviewquestions.tuteehub.com/tag/gt-249387" style="font-weight:bold;" target="_blank" title="Click to know more about GT">GT</a>; type fdisk <br/> 3. If you receive a message no <a href="https://interviewquestions.tuteehub.com/tag/fixed-245605" style="font-weight:bold;" target="_blank" title="Click to know more about FIXED">FIXED</a> disk present, read Hard Disk drive is bad or not connected properly.<br/> 4. If you are able to get into fdisk, choose option 4 to display the partition information. In the partition information, if the System is listed as FAT16 or FAT32 then continue to step 5. If you have a message indicating no partitions defined, no information is on your hard disk drive and you will need to create a new partition. See our fdisk page for additional information.<br/> 5. If you see FAT16 or FAT32 in fdisk press the ESC key until back at the A:\&gt;<br/> 6. Once at the A:\&gt; type, sys c: (only do this command if you are using the same operating system that this diskette was created on).<br/> 7. <strong>This should return a message 'System Transferred', if you receive bad command or file name and have verified you have typed the command properly, you will need to obtain a bootable diskette with the file sys.com on it.</strong><br/> 8. If system was transferred successfully, reboot the computer and issue should be resolved.<br/><br/>The Question are, where can i download that "sys.com" Sys.com should already be available on your dos bootable floppy. If you want to download Sys.com Google for 'download sys.com' and take your pick of which one you want..<br/><br/>And if you want to download a complete Dos <a href="https://interviewquestions.tuteehub.com/tag/bootdisk" style="font-weight:bold;" target="_blank" title="Click to know more about BOOTDISK">BOOTDISK</a> go <strong><a href="http://www.bootdisk.com/bootdisk.htm">here</a></strong>.<br/><br/>Good lucktq Dusty, i just realize that when i use my boot disk.I'm posting this thread because it's keep saying "bad command" when i type the command sys c: but after i run the scandisk /all twice, and do that command goes through and the sys c: successful.<br/>Tq anywayTry sys C:\ ...</body></html>
8993.

Solve : Running Batch script over a period of interval of time.?

Answer» <html><body><p>I am uploading data from text file to MySQL by using Bach file .I am using following command on command prompt <br/><br/>C:\Program Files\MySQL\MySQL Server 5.0\bin&gt;at 6:48PM /interactive E:\TIGER\IPTo<br/>COuntry\Run.bat <br/>It is not giving any error.But the data is not getting modified.<br/><br/>I will be thankful if somebody will <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.Its Urgent.........<br/>(1) <a href="https://interviewquestions.tuteehub.com/tag/time-19467" style="font-weight:bold;" target="_blank" title="Click to know more about TIME">TIME</a> needs to be in 24 hour format i.e. "18:48"<br/><br/>(<a href="https://interviewquestions.tuteehub.com/tag/2-236987" style="font-weight:bold;" target="_blank" title="Click to know more about 2">2</a>) If the command is not an executable (.exe) file, you must <a href="https://interviewquestions.tuteehub.com/tag/precede-604687" style="font-weight:bold;" target="_blank" title="Click to know more about PRECEDE">PRECEDE</a> the command with <a href="https://interviewquestions.tuteehub.com/tag/cmd-920083" style="font-weight:bold;" target="_blank" title="Click to know more about CMD">CMD</a> /c<br/><br/>So try<br/><br/>at 18:48 /interactive cmd /c E:\TIGER\IPToCOuntry\Run.bat <br/><br/>Please note: your ridiculous "poll" does nothing to enhance your reputation.<br/><br/>If you want the task to run every day at the same time, you will need to modify your command. As it stands, it will run once, the next time the scheduled time arrives.<br/><br/><br/><br/><br/><br/></p></body></html>
8994.

Solve : copy command?

Answer» <html><body><p>i had a little problem with the copy <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a>. when i use: <br/>copy testing1.txt C:\ it works but :<br/>copy testing1.txt C:\Program Files\ it doesnt <a href="https://interviewquestions.tuteehub.com/tag/work-20377" style="font-weight:bold;" target="_blank" title="Click to know more about WORK">WORK</a>.. <br/><br/>anyone can help?You <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> quote <a href="https://interviewquestions.tuteehub.com/tag/marks-238132" style="font-weight:bold;" target="_blank" title="Click to know more about MARKS">MARKS</a> before and after a path or <a href="https://interviewquestions.tuteehub.com/tag/filename-987949" style="font-weight:bold;" target="_blank" title="Click to know more about FILENAME">FILENAME</a> that contains spaces.<br/>lol ok ty.. pff so easy but didnt find it</p></body></html>
8995.

Solve : right arrow symbol at end of text file??

Answer» <html><body><p>I'm <a href="https://interviewquestions.tuteehub.com/tag/getting-2670847" style="font-weight:bold;" target="_blank" title="Click to know more about GETTING">GETTING</a> a <a href="https://interviewquestions.tuteehub.com/tag/right-239192" style="font-weight:bold;" target="_blank" title="Click to know more about RIGHT">RIGHT</a> arrow symbol at the end of my text file. I have several text files that i'm merging together and then moving to another folder with a new name. Here's a sample of what I'm doing:<br/><br/>copy iaraw.txt+f500.txt+f501.txt+ and so on...<br/>move iaraw.txt F:\ZIP4\PROD\iaprod.txt<br/>del f*.txt<br/><br/><br/>Any ideas?<br/><br/>thanks.that's probbaly the end of file marker<br/>if you <a href="https://interviewquestions.tuteehub.com/tag/really-1178981" style="font-weight:bold;" target="_blank" title="Click to know more about REALLY">REALLY</a> don't <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> to <a href="https://interviewquestions.tuteehub.com/tag/see-630247" style="font-weight:bold;" target="_blank" title="Click to know more about SEE">SEE</a> that...can try this<br/>Code: <a>[Select]</a>for /F %%a in ('dir /B /A-D *.txt') do type %%a &gt;&gt; outfile.txt<br/></p></body></html>
8996.

Solve : pass an instruction from a DOS command to a program ??

Answer» <html><body><p>I don't think it's possible but I'll ask, just in case.<br/><br/>I have an EXE program which does only one thing when you hit its single button.<br/>Is there a way to launch this program and pass it an instruction equivalent to hitting the button from a command line or a batch file ?<br/><br/>*crossing fingers*When in the program, can you press a key to "hit the button" or do you have to use the mouse? If so, what is the key?<br/><br/><br/>Unfortunately, I need to use the mouse. Enter doesn't work and there is no keyboard shortcut.Have you tried alt enter, ctrl enter and shift enter ? ?Yes. And nothing happens (except ALT ENTER that gives a bip).<br/><br/>I know it's the <a href="https://interviewquestions.tuteehub.com/tag/wrong-1462035" style="font-weight:bold;" target="_blank" title="Click to know more about WRONG">WRONG</a> place to ask but...<br/>...I started learning C++ two weeks ago (just reached the CLASS chapter). So it's much too fresh for me to know if you can control a program through <a href="https://interviewquestions.tuteehub.com/tag/another-876628" style="font-weight:bold;" target="_blank" title="Click to know more about ANOTHER">ANOTHER</a> one in C++. But if it's possible, I can change my priorities until I learn how and give up the DOS option.If you understand the Windows API lots of things become possible. <br/><br/>(Don't ask me anything about this, I just copied it)<br/><br/>This code [allegedly] will click a command button in another program using standard Windows API calls. This example clicks the "Open" button that appears in Internet Explorer when you try to open and executable, script, batch file, etc.<br/><br/>Quote</p><blockquote><br/>#include &lt;windows.h&gt;<br/><br/>int <a href="https://interviewquestions.tuteehub.com/tag/main-552371" style="font-weight:bold;" target="_blank" title="Click to know more about MAIN">MAIN</a>()<br/>{<br/><br/>//create two structures to hold our Main Window handle<br/>//and the Button's handle<br/>HWND WindowHandle;<br/>HWND ButtonHandle;<br/><br/>//this window's caption is "File Download", so we search for it's handle using the FindWindow API<br/>WindowHandle = FindWindow(NULL, "File Download");<br/><br/>//the Button's Caption is "Open" and it is a "Button". SPYXX.exe that comes with Microsoft Visual Studio will reveal this information to you<br/>ButtonHandle = FindWindowEx(WindowHandle, <a href="https://interviewquestions.tuteehub.com/tag/0-242464" style="font-weight:bold;" target="_blank" title="Click to know more about 0">0</a>, "Button", "&amp;Open");<br/><br/>//send a message to the button that you are "clicking" it. Surprisingly C++ understands what BM_CLICK is without having to set it. Different than VB<br/>SendMessage (ButtonHandle, BM_CLICK, 0 , 0);<br/><br/>return 0;<br/>}<br/><br/></blockquote><br/>The above was found on this page:-<br/><br/><a href="http://www.vbforums.com/showthread.php?t=345259">http://www.vbforums.com/showthread.php?t=345259</a><br/><br/>It is in the VBForums section: VBForums &gt; VBForums CodeBank &gt; CodeBank - C++<br/><br/>Where there is a discussion about<br/><br/>Quote<blockquote>Use API to programmatically click button of another app</blockquote><br/>There is much more out there about this sort of thing. Google is your friend.<br/><br/><br/><br/><br/>Contrex, you're the man! I needed to be pointed to the right direction and you did just that.<br/><br/>As I said, I just started learning about C++ classes. There's no way I could implement something like that right now.<br/>I'm working on a rather complex personal project and there's one essential bridging step which consists of the transfer of data between two different programs, the first being unable to export and the second unable to import. So far, the only way to do it was by using manually a small EXE utility. So either I can control it through my own code or I can write some code that does the same job.<br/>I also have restrictions about the C++ compiler I can use (g++, part of the gnu GCC). There is a windows.h header file in the GCC library in which I'll have to dig. Later.<br/><br/>Thanks for shedding some light on my problem. Now I have a better understanding of it. And I know it's feasible.<br/><br/>Quote<blockquote>Google is your friend.</blockquote><br/>Yep, the Google button in my browser is starting to show <a href="https://interviewquestions.tuteehub.com/tag/wearing-1450879" style="font-weight:bold;" target="_blank" title="Click to know more about WEARING">WEARING</a> marks...<br/><br/>Thanks again, Contrex. I'll see you around, probably in the programming section. Have a nice day.</body></html>
8997.

Solve : re-advertised need help Pllllleaaaaaasse?

Answer» <html><body><p>Hi i'm new to batch file scripting and was wondering if anyone could <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/><br/>I'm looking to run a batch file that will replace one document with another<br/><br/>i.e. C:\temp\master.doc to C:\temp\minor.doc <br/><br/>I want to keep the master copy but replace the minor copy with an <a href="https://interviewquestions.tuteehub.com/tag/image-11684" style="font-weight:bold;" target="_blank" title="Click to know more about IMAGE">IMAGE</a> of the master.<br/><br/>Any help greatly appreciated. <br/><br/>Or pointers to were I can see <a href="https://interviewquestions.tuteehub.com/tag/sample-244735" style="font-weight:bold;" target="_blank" title="Click to know more about SAMPLE">SAMPLE</a> <a href="https://interviewquestions.tuteehub.com/tag/scripts-1196731" style="font-weight:bold;" target="_blank" title="Click to know more about SCRIPTS">SCRIPTS</a> /code etc<br/>This sounds very simple, so I must have misjudged your requirement .. basically, you want to replace minor.doc with a copy of master.doc<br/><br/>Copy /Y C:\temp\master.doc C:\temp\minor.doc <br/><br/>the /Y means to answer yes to the 'do you want to overwrite' question<br/><br/>GrahamTried that graham but although i am running this batch file locally and the files for testing purposes are local the dos prompt keeps telling me the files cannot be locatedHi graham found the problem running the batch file under c:\ Documents and Settings\localuser\temp\test1\filename.txt copying to c:\ Documents and Settings\localuser\temp\test2\filename.txt<br/><br/>doesn't like the spaces tried under C:\tempfile\ and it ran no problem cheers for your help mateQuote</p><blockquote>doesn't like the spaces </blockquote>If the path is C:\Documents and Settings\user\file.txt,<br/>You have to put " on each end.<br/><br/>"C:\Documents and Settings\user\file.txt"</body></html>
8998.

Solve : position and size ??

Answer» <html><body><p>Hello. I'm new to this forum and <a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a> scripting. My question is in two parts.<br/><br/>I often have to work with different programs at the same time and I'm getting tired to reposition and resize the <a href="https://interviewquestions.tuteehub.com/tag/windows-22662" style="font-weight:bold;" target="_blank" title="Click to know more about WINDOWS">WINDOWS</a>. I'm looking for the proper <a href="https://interviewquestions.tuteehub.com/tag/dos-432778" style="font-weight:bold;" target="_blank" title="Click to know more about DOS">DOS</a> syntax to do it through a batch file.<br/><br/>How can I open NotePad (for example) from a DOS <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a> with its window at a specific location on my screen and of a specific size ?<br/>Instead of just opening NotePad, can I do the same directly with a TXT file (open mytext.txt in NotePad at this location and with this size, or - other example - open mypic.bmp with PSP at this location and with this size) ?<br/><br/>Thanks for your help. You cannot do this in DOS or NT-family command prompt.<br/><br/>You can, however, <a href="https://interviewquestions.tuteehub.com/tag/edit-11544" style="font-weight:bold;" target="_blank" title="Click to know more about EDIT">EDIT</a> the properties of the command window to make it always come up in the same place and have the same size.<br/>Thanks a lot for your answer, contrex. I feared something like that...</p></body></html>
8999.

Solve : Batch to list files modified today in text file.?

Answer» <html><body><p>Can anyone tell me what the batch file command(s) are to write a list of all "*.doc" modified today to a text file. Any help would be greatly appreciated.Is this your homework?<br/><br/>You already asked this in another thread. Why have you abandoned that one to start this new thread? Didn't you like my answers?<br/><br/><br/>The last question was to start a new batch file based on any doc file being modified today. I just want to list all files that are modified now. I <a href="https://interviewquestions.tuteehub.com/tag/figured-7681243" style="font-weight:bold;" target="_blank" title="Click to know more about FIGURED">FIGURED</a> that the last post was a closed issue and that it might not get read. Your answer solved my first question. Like I said I am somewhat of a newbie. <br/><br/>I am actually trying to use pieces of information from other people's post to accomplish a task that a co-worker has to do manually right now. The task doesn't really involve doc files but I can modified the file type in the batch files to cover that. If you really 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> everything I am trying to do with this I would be happy to post it, just did want to ask someone else to write the batch file for me without first trying myself.<br/><br/>Thanks,<br/>Psycho DanOK. I'm glad you didn't just want somebody to write the batch file for you, because many people do seem to want exactly that, and it gets to be a pain in the *ss.<br/><br/>Everybody has their own way of doing these things but I personally would probably do it this way<br/><br/>1. Set up a loop to examine the output of 'dir /b *.doc'<br/>2. In the loop, get each file's date and time string by using the %%~t variable modifier<br/>3. Put this string in a variable.<br/>4. Obtain the first 10 characters of this string, which will be dd/mm/yyyy or mm-dd-yyyy or whatever depending on your local date format. There are a number of ways of doing this.<br/>5. Compare this with the variable %date% which will be today's date in the same format.<br/>6. If they match, the file was modified (or created) today.<br/><br/>I can foresee complications/missed files if its running time spans midnight unless you get today's date right at the beginning.<br/><br/><br/><br/><br/>here's a vbscript:<br/>Code: <a>[Select]</a>Set objFSO=CreateObject("Scripting.FileSystemObject")<br/>myDocFolder = "c:\temp"<br/>Set objFolder = objFSO.GetFolder(myDocFolder)<br/>N=Now<br/>theDateNow = Year(N)*1e10 + Month(N)*1e8 + Day(N)*1e6<br/>For Each myDocs In objFolder.Files<br/> If objFSO.GetExtensionName(myDocs) = "doc" Then<br/> theDocDate = myDocs.DateLastModified<br/> N=theDocDate<br/> theFileDate = Year(N)*1e10 + Month(N)*1e8 + Day(N)*1e6 <br/> If theFileDate = theDateNow Then<br/> WScript.Echo "Same day file: " &amp; myDocs <br/> End If <br/> End If <br/>Next<br/>usage:<br/>Code: <a>[Select]</a>c:\&gt; cscript myscript.vbs &gt; newlist<br/>ghostdog, he wrote he didn't want anyone to write him a <strong>batch file</strong> without trying it himself, so what do you do? Write him a vbs script! Is there any situation in life that does not prompt you to churn out a vbs script and post it?<br/><br/>Quote from: contrex on October 01, 2007, 11:44:47 PM</p><blockquote>ghostdog, he wrote he didn't want anyone to write him a <strong>batch file</strong> without trying it himself, so what do you do? Write him a vbs script! <br/></blockquote>any problem with that? i did not write a batch for him, did i? you have already provided him guidance, so i guess he will try to do the batch himself. there are many ways to solve a problem, i am just showing him some other ways. Somebody may <a href="https://interviewquestions.tuteehub.com/tag/come-409636" style="font-weight:bold;" target="_blank" title="Click to know more about COME">COME</a> in and do a Perl script for him, who knows?... if he wants to stick with batch, that's entirely up to him. <br/><br/>Quote<blockquote>Is there any situation in life that does not prompt you to churn out a vbs script and post it?<br/></blockquote>1) when i am unhappy<br/>2) when i am busy<br/>3) when i don't feel like it.<br/><br/>this is a public forum, what i post are valid suggestions/solutions that may/or may not solve the problem, as long as i don't violate posting rules (or be rude to people and get banned). You can't stop me from posting just because you feel you don't like it. Just like i can't stop you from asking people "is this homework" everytime someone does that, right?.Sorry, Ghostdog, for being testy with you. I had just got up! Actually that is a very interesting VBscript you contributed. Quote from: contrex on October 02, 2007, 02:00:27 AM<blockquote>Sorry, Ghostdog, for being testy with you. I had just got up! Actually that is a very interesting VBscript you contributed. <br/></blockquote>hey..no problem the script follows the method you posted. I was able to write a batch file to do it, but I am always interested in learning new way to do things. Thanks to both of you for your help. I thought about trying vbscript but I would be totally lost on that, so maybe I will try it after I get my batch files working without needing daily input from me (which I am almost there thanks to contrex's help). <br/><br/>Thanks again,<br/>Psycho DanI think you will be using delayed expansion inside the loop<br/>Contrex I am a newbie to this myself but I have noticed that you tend to have an "I really cant be arsed with helping but !! I will, under duress attitude" and then you can can be quite helpful are you manic depressive. <br/><br/>Cos it really doesn't help when u dont know what your doing then some one makes you feel moronic for asking. So lighten up we aint all "au fait" with this and we dont want to be hand held just pointed in the right direction Quote from: w33man on October 05, 2007, 08:26:55 AM<blockquote>Contrex I am a newbie to this myself but I have noticed that you tend to have an "I really cant be arsed with helping but !! I will, under duress attitude" and then you can can be quite helpful are you manic depressive. <br/><br/>Cos it really doesn't help when u dont know what your doing then some one makes you feel moronic for asking. So lighten up we aint all "au fait" with this and we dont want to be hand held just pointed in the right direction <br/></blockquote><br/>w33man, thank you for your interest in my mental health. Comment how you like about the <a href="https://interviewquestions.tuteehub.com/tag/accuracy-238102" style="font-weight:bold;" target="_blank" title="Click to know more about ACCURACY">ACCURACY</a> or otherwise of my answers. It's a free forum. Catch me out in an error - great. The truth is served. Answer a question better, more fully, more helpfully than me - fantastic! Way to <a href="https://interviewquestions.tuteehub.com/tag/go-468886" style="font-weight:bold;" target="_blank" title="Click to know more about GO">GO</a>! But - consider the ratio of 7:1882. That is how much weight I attach to your opinion about my attitude and personal style. Well, rather less actually. Sorry but there it is. <br/><br/>(Paraphrase: go pound sand.)<br/><br/><br/><br/><br/></body></html>
9000.

Solve : Need to merge 2 text files?

Answer» <html><body><p>I have an existing batch process to which I need to add a routine which merges lines from 2 text files into a single file. I'm not looking to simply append one file to the other, but need to merge the files on a line-by-line basis.<br/><br/>I have a routine which works using a nested FOR loop, but it currently takes about 25 minutes to run due to inefficiencies with the algorithm and the large number of lines to be merged.<br/><br/>I've attached my current code as well as 2 sample input files and the output file that is generated from those input files.<br/><br/>I had been doing this previously with the Unix "join" command when the overall process was handled by a Unix script, but the whole process now has to run under Windows.<br/><br/>Basically, each input file contains a list of database tables along with each table's row count. Each line has the table name, a pipe ) delimiter, and the row count. The first file contains "before" row counts, while the 2nd file contains the "after" row counts. The current code successfully combines the counts for each table on a single row and also calculates the difference if the number of rows changed from "before" to "after", but it runs slowly.<br/><br/>I'd appreciate any suggestions on a better way to handle this within a batch process running under Windows Server 2003.Received <a href="https://interviewquestions.tuteehub.com/tag/message-25597" style="font-weight:bold;" target="_blank" title="Click to know more about MESSAGE">MESSAGE</a> saying upload folder was full. Here's what sample input and output files look like:<br/><br/>Input #1 -- pre_merge_table_counts.txt:<br/><br/>Table_1 | 5<br/>Table_2 | 10<br/>Table_3 | 50<br/>Table_4 | 15<br/>Table_5 | 1030<br/>Table_6 | 520<br/>Table_7 | 8040<br/>Table_8 | 620<br/>Table_9 | 75<br/>Table_10 | 220<br/>Table_11 | 2330<br/>Table_12 | 710<br/><br/><br/>Input # 2 -- post_merge_table_counts.txt:<br/><br/>Table_1 | 100<br/>Table_2 | 200<br/>Table_3 | 50<br/>Table_4 | 15<br/>Table_5 | 1030<br/>Table_6 | 520<br/>Table_7 | 8040<br/>Table_8 | 620<br/>Table_9 | 300<br/>Table_10 | 400<br/>Table_11 | 2330<br/>Table_12 | 710<br/><br/><br/>Output -- output.txt<br/><br/>TABLE COUNTS <br/><br/><br/>Table_1 Before: 5 After: 100 Difference = 95 <br/>Table_2 Before: 10 After: 200 Difference = 190 <br/>Table_3 Before: 50 After: 50 <br/>Table_4 Before: 15 After: 15 <br/>Table_5 Before: 1030 After: 1030 <br/>Table_6 Before: 520 After: 520 <br/>Table_7 Before: 8040 After: 8040 <br/>Table_8 Before: 620 After: 620 <br/>Table_9 Before: 75 After: 300 Difference = 225 <br/>Table_10 Before: 220 After: 400 Difference = 180 <br/>Table_11 Before: 2330 After: 2330 <br/>Table_12 Before: 710 After: 710 Here's the code I'm currently using:<br/><br/><br/>@echo off<br/><br/>setlocal enabledelayedexpansion<br/><br/>rem ---------------------------------------------------------------<br/>rem Procedure Generate_Report<br/><br/>:GENERATE_REPORT<br/><br/>echo. &gt; output.txt<br/>echo TABLE COUNTS &gt;&gt; output.txt<br/>echo. &gt;&gt; output.txt<br/>echo. &gt;&gt; output.txt<br/><br/>Set Count=0<br/>For /F "tokens=1,2* delims=|" %%A in (pre_merge_table_counts.txt) Do (<br/>Set PRE_TABLE_NAME=%%A<br/>Set PRE_TABLE_SIZE=%%B<br/>Set /A COUNT+=1<br/>Set COUNT2=0<br/>For /F "tokens=1,2* delims=|" %%C in (post_merge_table_counts.txt) Do (<br/>Set POST_TABLE_NAME=%%C<br/>Set POST_TABLE_SIZE=%%D<br/>Set /A COUNT2+=1<br/>If !COUNT2!==!COUNT! (<br/>If !PRE_TABLE_NAME!==!POST_TABLE_NAME! (<br/>If !PRE_TABLE_SIZE!==!POST_TABLE_SIZE! (<br/>echo !PRE_TABLE_NAME! Before: !PRE_TABLE_SIZE! After: !POST_TABLE_SIZE! &gt;&gt; output.txt<br/>) else (<br/>Set /A TABLE_DIFFERENCE=POST_TABLE_SIZE-PRE_TABLE_SIZE<br/>echo !PRE_TABLE_NAME! Before: !PRE_TABLE_SIZE! After: !POST_TABLE_SIZE! Difference = !TABLE_DIFFERENCE! &gt;&gt; output.txt<br/>)<br/>) else (<br/>echo !PRE_TABLE_NAME! Before: !PRE_TABLE_SIZE! After: !POST_TABLE_NAME! !POST_TABLE_SIZE! &gt;&gt; output.txt<br/>)<br/>)<br/>)<br/>rem if !Count!==10 goto TEMP_DONE_WITH_SMALL_NUMBER_OF_LINES<br/>)<br/><br/>:TEMP_DONE_WITH_SMALL_NUMBER_OF_LINES<br/>echo Done.<br/>pause<br/><br/><br/>don't <a href="https://interviewquestions.tuteehub.com/tag/know-534065" style="font-weight:bold;" target="_blank" title="Click to know more about KNOW">KNOW</a> how big is your file, but you can try this vbscript:<br/>Code: <a>[Select]</a>Set objFSO = CreateObject("Scripting.FileSystemObject")<br/>myInputFile1 = "C:\temp\a.txt"<br/>myInputFile2 = "C:\temp\b.txt"<br/>Dim a1()<br/>Dim a2()<br/>Dim i,j,t1,t2<br/>i=0<br/>j=0<br/>Set objFile1 = objFSO.OpenTextFile(myInputFile1,1)<br/>Do Until objFile1.AtEndOfStream<br/> line = objFile1.ReadLine<br/> ReDim Preserve a1(i)<br/> a1(i) = line<br/> i=i+1<br/>Loop<br/>objFile1.Close<br/>Set objFile2 = objFSO.OpenTextFile(myInputFile2,1)<br/>Do Until objFile2.AtEndOfStream<br/> line = objFile2.ReadLine<br/> ReDim Preserve a2(j)<br/> a2(j) = line<br/> j=j+1<br/>Loop <br/>objFile2.Close<br/>For k = LBound(a1) To UBound(a1) <br/> t1 = Split(a1(k),"|")<br/> t2 = Split(a2(k),"|")<br/> WScript.Echo t1(0) &amp; " Before: " &amp; t1(1) &amp; " After: " &amp; t2(1) &amp; " difference = " &amp; t2(1) - t1(1) <br/>Next<br/><br/>output: save as myscript.vbs and type: cscript /nologo myscript.vbs &gt; outfile<br/>Code: <a>[Select]</a><br/>Table_1 Before: 5 After: 100 difference = 95<br/>Table_2 Before: 10 After: 200 difference = 190<br/>Table_3 Before: 50 After: 50 difference = 0<br/>Table_4 Before: 15 After: 15 difference = 0<br/>Table_5 Before: 1030 After: 1030 difference = 0<br/>Table_6 Before: 520 After: 520 difference = 0<br/>Table_7 Before: 8040 After: 8040 difference = 0<br/>Table_8 Before: 620 After: 620 difference = 0<br/>Table_9 Before: 75 After: 300 difference = 225<br/>Table_10 Before: 220 After: 400 difference = 180<br/>Table_11 Before: 2330 After: 2330 difference = 0<br/>Table_12 Before: 710 After: 710 difference = 0<br/><br/>Thanks - this works well. I tweaked it just slightly to add an "if" for the echo in the final loop so that the output will be more consistent with the original format where the "Difference" is only displayed if the counts are, indeed, different. (This makes it easier to locate the tables that actually changed when scanning through the lines of output.)<br/><br/>I replaced the original Echo line in the final For loop with the following:<br/><br/><br/>If t1(1) = t2(1) Then<br/>WScript.Echo t1(0) &amp; " Before: " &amp; t1(1) &amp; " After: " &amp; t2(1)<br/>Else<br/>WScript.Echo t1(0) &amp; " Before: " &amp; t1(1) &amp; " After: " &amp; t2(1) &amp; " Difference = " &amp; t2(1) - t1(1)<br/>End IfThe vb script takes about 1 second to do what the FOR loop in the original batch took 25 minutes to do -- quite an improvement! (FYI -- there are over 2500 tables listed in each file.)<br/><br/>The original FOR loop had to repeatedly go through the second file from the first line to whatever line # is being <a href="https://interviewquestions.tuteehub.com/tag/processed-2954945" style="font-weight:bold;" target="_blank" title="Click to know more about PROCESSED">PROCESSED</a> for the first file, which is why it was so slow, as it had to keep reading lines over and over again from the 2nd file.<br/><br/>I'd still be interested to hear if anyone has an idea of how to accomplish this without needing to <a href="https://interviewquestions.tuteehub.com/tag/call-412416" style="font-weight:bold;" target="_blank" title="Click to know more about CALL">CALL</a> an external file. Even if it took a minute or two to process within the batch process, that would be OK. 25 minutes is just too slow, though. Otherwise, the vb script certainly accomplishes the task, but seems to require the use of a second file.<br/><br/>Thanks for the help.<br/>Quote from: ranman65 on October 05, 2007, 09:17:20 AM</p><blockquote>Otherwise, the vb script certainly accomplishes the task, but seems to require the use of a second file.<br/></blockquote>which second file are you talking about?I've got a batch process (___.bat) which would then call the ___.vbs file, so the ___.vbs file is the second file.<br/><br/>If possible, I'd prefer to have all of the code contained within the original ___.bat file.Quote from: ranman65 on October 05, 2007, 09:54:58 AM<blockquote>I've got a batch process (___.bat) which would then call the ___.vbs file, so the ___.vbs file is the second file.<br/><br/>If possible, I'd prefer to have all of the code contained within the original ___.bat file.<br/></blockquote>create the vb script dynamically in your batch file. hint: using echo with <a href="https://interviewquestions.tuteehub.com/tag/redirection-620965" style="font-weight:bold;" target="_blank" title="Click to know more about REDIRECTION">REDIRECTION</a> &gt;<br/>then call the script as normal using cscript. <br/><br/>However, if that's not desired, pls wait for a pure batch solution.OK -- that works like a charm (using "^"s to set off the right parentheses and ampersands so they don't get misinterpretted when the batch job is processed)!<br/><br/>Thanks, again!</body></html>