This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 3101. |
Solve : Setting a variable? |
|
Answer» Hi I am a little NEW to DOS programming and am trying to set a certain commands result to a variable Hi I am a little new to DOS programming and am trying to set a certain commands result to a variable May I clarify? You want to run this command Quote openssl base64 -d -in out.txt -out temp.txt This command will place some text into a text file called temp.txt. Do you then wish to place the CONTENTS of temp.txt into a variable? So that (eg) echo %VAR% would show the one line of temp.txt? Is that correct? If the answer to the above question is "yes", you could try this Quote openssl base64 -d -in out.txt -out temp.txt Also, please do not write "HELP ANYONE!!!!!". This is considered to be bad manners. It is like shouting at people. It will not get you an answer faster. I apologize. Being rude or ill mannered was not my intention in the least. as to your answer to my post, is there anyway i could do this without writing to a file at all and simply save the result in an environment variable. Thank youI am not familiar with the openssl command. If an -out file is not specified, does the output APPEAR on the screen? yes it doesThen this might work Quote setlocal enableextensions If the decrypted text still appears on screen, try this alteration Quote for /F "delims= " %%L in ('openssl base64 -d -in out.txt>nul') do set VAR=%%L Thank you so much Ive been stuck on this one for a while (New to DOS). Worked like a charmI'm sorry I shouted at you before! You may not need this line Quote setlocal enabledelayedexpansion |
|
| 3102. |
Solve : renaming files with wild cards?? |
|
Answer» Good afternoon, |
|
| 3103. |
Solve : Check if file exists with batch script? |
|
Answer» I have a bat file that I want to kick off but then wait until a certain file gets DOWNLOADED to execute the remainder of the script. How can I check to see if a file exists on a recurring BASIS (i.e. loop) in the script without causing excessive resource usage on the machine (i.e. how can I leave some space between the checks).Assuming you have Windows XP, this might work: |
|
| 3104. |
Solve : Using IF conditions to call a batch file? |
|
Answer» Quote from: Dark Blade on June 12, 2007, 03:00:41 AM Well, I THINK my computer just froze and jumped for a second, so it may have pocessed the first %TIME%, but not the second, so that they were different. Quote c:\>echo %time% It would only have to FREEZE for 1/100 of a second. That .60 at the END is 60 hundredths of 1 second |
|
| 3105. |
Solve : Connecting to remote systems via DOS batch file? |
|
Answer» HI, Please LET me know whether possible to connect to other WINDOWS remote systems (USING IP, login and pwd) using DOS batch file what do you want to do when you are connected? what exactly are you doing?Yes, it is possible (assuming the remote computer is configured properly and you have the required credentials).I have the required credintials to connect to remote desktop which is windows XP system. After connecting, I want to RUN one exe file . This I need to do for > 30 systems each time, hence looking for automation. |
|
| 3106. |
Solve : Generation of multiple file using single file with unique name.? |
|
Answer» Hi all, |
|
| 3107. |
Solve : Rewriting a batch file from an ftp copy to a network file system copy? |
|
Answer» Hello! I am not good at writing batch files. It's all so Greek to me, so I'm hoping someone can help. I have a batch file that was originally written to ftp files from one server to another. Now it's been decided that ftp is not the mode of transport desired. Instead it's preferred I use nfs. So here's the ftp portion of the batch file: |
|
| 3108. |
Solve : Changing the Time Zone...? |
|
Answer» Hi, how can I change the time zone using a BATCH script? |
|
| 3109. |
Solve : De Refferencing command line args? |
|
Answer» Ok I am trying to make a batch file, where one its many tasks is to run this file call ldapsearch. The command line call looks like: ldapsearch -x -b "dc=utoronto,dc=ca" "(login=sham)" password Now in this call 'login' is the criteria for the search and 'sham' is the value. In my script these two have to be taken in as command line arguments. SO %1 and %2 then so in my script I tried to do ldapsearch -x -b "dc=utoronto,dc=ca" "("%1"="%2")" password but that did not work since the computer gets ldapsearch -x -b "dc=utoronto,dc=ca" "(""login""=""sham")" password is there any way i can DE refference the command line arguments without the surrounding " ", or is there another better way of doing this. Thank youDont surround the params with quotes --- ldapsearch -x -b "dc=utoronto,dc=ca" "(%1=%2)" password If there were spaces in the params, you would need to put the quotes around the params on the commandline, which you could remove before supplying to the ldapsearch commandline Graham I'm sure it is possible. Just a case of getting all the quotes and percentage signs right... Have you tried the following...? ldapsearch -x -b "dc=utoronto,dc=ca" "(%1=%2)" password Seems to work for me on Windows XP. (Obviously I get an error because 'ldapsearch' is not recognized.) Code: [Select]D:\>type TEST.bat ldapsearch -x -b "dc=utoronto,dc=ca" "(%1=%2)" password D:\>TEST login sham D:\>ldapsearch -x -b "dc=utoronto,dc=ca" "(login=sham)" password 'ldapsearch' is not recognized as an internal or external command, operable program or batch file. D:\> Hope that helps, JamesThanks guys works just fine.OOps i thought it worked fine!! Till i tested it this morning guys. Seems that the STRING get put as ldapsearch -x -b "dc=utoronto,dc=ca" "("login"="shammer")" pass which MIRACULOUSLY works fine unless there is a space SOMEWHERE say instead of shammer i have "sham rock". THen the whole thing goes to *censored*. Is there some way i can collapse the command line arguments a single compact string like "(login=shammer)" THANKS guys Never mind guys I figured it out!! I just put %1=%2 instead of "(%1=%2)" |
|
| 3110. |
Solve : how to change the cmd.exe name to other .exe name? |
|
Answer» HMMM i just create a small kids games using batch and convert it into an exe file i wonder when i click the batch itself it just name cmd.exe is there a way to change it to other name like shooter.exeI don't understand the question... So you made a batch file and you converted it into an EXE... Now what? Can't you rename this file? Is this the windows command prompt located in the system directory (c:\windows\system32)? Also your operating system may be useful...ok whenever i launch the batch on top of the bar always show the c:\windows\system32\cmd.exe and in the TASKLIST also shown the cmd.exe so is there a way to rename the cmd.exe name to for example shooter.exe im running windows XP sp2cmd.exe is the name of the Windows XP command interpreter. It appears at the top pf command windows unless you explicitly change it eg:- title "shooter.exe" ya so how to change it any1 can help me out You can set the title if you change the way you start your batch file. If your batch file is called GAME.BAT, then try this from your command prompt: Code: [Select]start "Shooter" game.bat Using this, you could create a 2nd batch file to launch your game with the code above. Quote from: GuruGary on JUNE 12, 2007, 11:17:04 PM You can set the title if you change the way you start your batch file. If your batch file is called GAME.BAT, then try this from your command prompt: thx fot that i already knew that but then if i convert it into an exe so....Quote from: nwlun on June 12, 2007, 05:12:59 PM ya so how to change it I just told you |
|
| 3111. |
Solve : How to copy hidden or system file?? |
|
Answer» Hello,
Maybe More Simply if using Type command: ------------------------------------------------------- type hidden.txt>backup.txt ------------------------------------------------------- it work with Hidden+System File |
|
| 3112. |
Solve : *confirm* Hidden batch help??? |
|
Answer» I think that he MIGHT want to keep it hidden/move it while it's hidden. But if it's the former, he could just unhide it, copy it, then hide it.Quote from: Dark Blade on June 12, 2007, 04:22:02 AM I think that he might want to keep it hidden/move it while it's hidden. But if it's the former, he could just unhide it, copy it, then hide it. that the POINT What's the point? To keep it hidden/move it while it's hidden Unhide it, copy it, then hide it. Quote from: Dark Blade on June 13, 2007, 12:19:19 AM What's the point? im not here to quarell with u .. i just need a confirmation only if like wat u said just now then i wouldnt need a batch at all all i need is to USE my hand to CLICK on it and eye to see it Confirmation of what? That a hidden batch FILE cannot copy itself? It is confirmed. |
|
| 3113. |
Solve : Sleep command?? |
|
Answer» hi all, |
|
| 3114. |
Solve : Crc32 by DOS command? |
|
Answer» please, HELP me |
|
| 3115. |
Solve : How to Parameterize a value with diff command?? |
|
Answer» Hi all, |
|
| 3116. |
Solve : Writing a Script? |
|
Answer» another question, whats a script? is that the code used in a batch file? another question, whats a script?do you want to WAIT a few hours before you can get an answer, or just seconds using a search engine?wiki Quote is that the code used in a batch file?see link. so is batch script even a programming language?i guess but i think its real name is DOS programming. |
|
| 3117. |
Solve : Breaking Up a string? |
|
Answer» Hi all @echo off the output is... Quote whole line... To get the result from a called batch into a calling batch file you could do this in the called batch Quote for /f "tokens=1,2, delims= " %%A in (temp.txt) do echo %%B > num.txt Then when control returns to the calling batch, that file could contain a line eg Quote for /f "delims==" %%A in (temp.txt) do set num=%%Anot solving your problem, as contrex has already done that, but just curious, what are you going to do once you get the output of pkcs into the variables? how are you going to use the slot numbers, or whatever that is returned from the command? |
|
| 3118. |
Solve : how to run setup in command prompt?? |
|
Answer» how to run setup in command prompt?what "setup" do you mean? |
|
| 3119. |
Solve : Capturing the string in the results of the batch file? |
|
Answer» Hi, |
|
| 3120. |
Solve : Moving files to a new directory? |
|
Answer» Good evening all, I am a new user so forgive me if this question has already been posted. Moving files is easy - but how can I specify the destination ? You seem to be aiming to:- - Generate the name of a directory from today's date. - Create that directory. - Move the contents of an already existing directory into the new directory. You are grabbing the date by using a one-line FOR to split out the three tokens, day, month, and year, separated by the / character, of the output of the date /t command. Then you use these to generate the directory name. First you need to make the directory using mkdir (or its shorter form, md) Quote mkdir [directory name] Then you need to move the files using the move command Quote move [filespec] [directory name] So you need to use the directory name twice. Trouble is, the generated directory name -- %%a%%b%%c -- only exists while the FOR statement is actually being processed. I can think of 3 ways around this. (i) You can get multiple commands on one line by using the & character. Quote date /t>%test%\date.txt (ii) You can EXTEND the FOR statement over multiple lines using parentheses. Indenting of lines between the opening and closing parentheses is optional, but it is often done to improve readability of batch/command files. Quote date /t>%test%\date.txt (iii) You can copy the date stuff into a VARIABLE and then it is available for reuse. Quote for /f "tokens=1,2,3 delims=/" %%a in (%test%\date.txt) do set foldername=c:\test\%%a%%b%%c A couple of little tips you may or may not find USEFUL... (1) You are writing the output of date /t into a file and then reading that file back. With FOR you can get at the command output by single-quoting the command. What I mean is, Why do this Quote date /t>%test%\date.txt When you can do this? Quote for /f "tokens=1,2,3 delims=/" %%a in ('date /t') do mkdir c:\test\%%a%%b%%c No temp file to CLEAN up, less disk activity. (2) If you really have to use a file to hold stuff, and you won't need it again, consider putting it in your Windows temp folder. You can read the %temp% system variable to get its location. Quote date /t>%temp%\date.txtThanks Contrex - It works perfectly.. |
|
| 3121. |
Solve : Copy one file content to another? |
|
Answer» HI i am new here i had a query, i want to copy content of one file to another using dos batch file how to do that. the conditions are as follows 1) there are many source files which will be copied to one destination file 2)when one file is copied to the destination file a .xml file should run then the data will be erased from the destination file 3)again the SECOND file will copied to the destination file and xml file will refresh or run 4)in EVERY file top 10 LINES should not be copied i am totally pissed off can anyone help me or suggest another easy to use method |
|
| 3122. |
Solve : [SOLVE]how to copy it to txt? |
|
Answer» ..dude..what are you trying to do?Quote from: ghostdog74 on July 14, 2007, 08:23:14 AM dude..what are you trying to do? If you couldn't tell by looking at it, you could have copied it and run it, then you'd know. First a variable %dirlist% is created and left blank Then in the first LOOP:- - is extracted from the output of fsutil, for each drive on the system, the drive letter, a colon and a backslash eg C:\ - neatly USING CALL SET, each such 3 char string is appended with a leading space to the string variable %dirlist% eg C:\ D:\ E:\ The second loop:- - iterates through this string variable %dirlist% and for each drive calls fsutil to get drivetype eg C:\ - Fixed Drive D:\ - Fixed Drive E:\ - CD-ROM Drive nwlun, if you want to get this output into a text file, just redirect the output to a text file, and you can use TYPE to see it on the screen if desired. Quote @echo off so i cant copy the whole code to a txt???I don't understand what your problem is. If you got the code of the batch file into a post on a web page, surely you can get it into a text file? Do you know how to highlight, copy, and paste text? Have you used Notepad before? Anyway, if you have run the code, then you must have it in a batch file. A batch file is a text file. What is the problem? Please say what you want to do, more clearly. this code is just a portion of my batch file but i only want this whole code to copy to a txt that why i ask helpQuote from: contrex on July 14, 2007, 10:47:22 AM I don't understand what your problem is.see what i mean? If he has written the batch, its already being saved as a batch file(text file). So why does he need to save that batch file again after running it? it makes no sense. he MIGHT as well use copy to copy the batch file to another. that's why i had asked him what he's trying to do. ( Unless of course, if what he's referring to is just output redirection, then that should be it ) Quote from: ghostdog74 on July 14, 2007, 07:16:20 PM Quote from: contrex on July 14, 2007, 10:47:22 AMI don't understand what your problem is.see what i mean? If he has written the batch, its already being saved as a batch file(text file). So why does he need to save that batch file again after running it? it makes no sense. he might as well use copy to copy the batch file to another. that's why i had asked him what he's trying to do. ( Unless of course, if what he's referring to is just output redirection, then that should be it ) u guys will understand if u have 2 pc there is nth to argue also...like i said this is just a portion of my batch ...Quote from: nwlun on July 14, 2007, 08:02:14 PM Quote from: ghostdog74 on July 14, 2007, 07:16:20 PMso you want to copy the batch to another PC? man, you should have described your problems more clearly! omg how come im so stupid ...solve myselfnwlun, why did you delete your interesting batch code? It is still visible because I quoted itQuote from: contrex on July 14, 2007, 10:47:22 AMI don't understand what your problem is.see what i mean? If he has written the batch, its already being saved as a batch file(text file). So why does he need to save that batch file again after running it? it makes no sense. he might as well use copy to copy the batch file to another. that's why i had asked him what he's trying to do. ( Unless of course, if what he's referring to is just output redirection, then that should be it ) |
|
| 3123. |
Solve : kick out of useless batch files? |
|
Answer» lol that's what i said when i read it too >. ...just so you can SIT there and watch your tray OPEN and close repeatedly (which probably isn't a good idea for your drive)?...I changed my mind, i dont want to break it or anything.Sometimes the PC is under the desk or whatever and you don't want to keep leaning over to press the eject button or push the drawer in, so a batch util to open & shut the drawer can be handy. However we have had queries from infantile schoolboy pranksters who think it is funny to open and shut classmates or teacher's CD tray, hence my suspicion. Sorry if i was wrong... if you have Nero installed you have Nerocmd.exe which is a command line utility If your cd drive letter was X: then these commands would do what they suggest nerocmd --eject --drivename x nerocmd --load --drivename x You have to either have nerocmd.exe on your PATH or else include the full path to nerocmd.exe thanx but i dont have nero and i dont really want it. ive decided not to even want to do this anyway but thanks for helping.If you want to open and close your cd drive, try this USEFUL little program. http://www.freewebs.com/uber0n/Appz/CD_Opener.zipOff the way guys. If this dude thinks he is as good as he thinks, then start your own forum. I have a Gigabyte Cd rom and i dont open it nor close it my pc does it for me. Under My COMPUTER i right click it and then click eject then it opens if put a cd in it or nothing it will automatically close itself in one minutes time.'Guess what i did to it. Yes exactly thats what i did to it, (Think think kind) bring it on then i can solve you..... |
|
| 3124. |
Solve : time log? |
|
Answer» i dont understand how to use a time log. if i wanted to create a message in a batch and in 30 seconds have another message appear, how could i do that?Its so impressive that no one replied to this thread. Oh the Q. is not cleari dont know how to make it any better; i want to basically use this to make a fake virus, something that will say its doing things it isnt, for example it will say deleting computer contents, and maybe after a couple seconds or minutes it would say deleting program files, and again in a few moments it would say destroying hard DRIVE, but i just wanna know how to make it say something else after a whileThe creation of any virus, real or fake, is not appreciated by any pc user. I doubt if anyone on this forum will show you howto... If you are as good as you seem to believe you are your tutors will already have picked up on this but may be very loathe to allow you any latitude because of an apparent anti-social behaviour pattern. ok... i understood all of your post except that bit... did you by any chance mean hesitant? loathe just doesn't quite fit.. and to 'gamerx365': i'm sure most of us will understand what you mean by being bored at school, but what 'Dusty' said is correct. The boundaries are there for a reason, and that reason is to further educate you so you can do what it is you want to do in the future anyway, believe me when i say distractions are not a good thing. i was getting straight A's for 4 years and then i decided to screw around for one year and dropped to D's and below, i picked up my grades after that of course when i realised that i wasn't going anywhere by failing my classes and attacking CD drives with screwdrivers. so i hope you come to the same conclusion as the rest of us that have read this thread have hopefully come to. and don't attack CD drives with screwdrivers! even though that's completely unrelated...Quote from: reaper_tbs on July 09, 2007, 07:48:49 PM
Ahhh Reaper, that's a bit grim... A slight typo for which you have my apologies. The word should, of course, be loath meaning Unwilling, Reluctant and/or Disinclined. Have modified my response. Thank younow it all makes sense gamerx365 I can show you how but you will have to run it first on your pc and you will what it will do an how you will feel. After think around dude. If you its boaring to study theory books go to advanced computer campus and u will have access to the pc 24/7. Oups wrong forum to ask for virus scipts but it looks like this e.g internal void CalculateLoan() { double loanAmount, interestRate, monthlyPayment, periods; loanAmount = Microsoft.VisualBasic.Conversion.Val(txtLoanAmount.Text); interestRate = Microsoft.VisualBasic.Conversion.Val(txtInterestRate.Text) / 100; periods = Microsoft.VisualBasic.Conversion.Val(txtPeriods.Text); monthlyPayment = Microsoft.VisualBasic.Financial.Pmt( interestRate / 12, periods, -loanAmount, 0, Microsoft.VisualBasic.DueDate.BegOfPeri od); txtPayment.Text = monthlyPayment.ToString("C"); }its not that i have tons of free time on computers at school, and also i have no idea what the last post was, looked like actions script to me, but i dont understand it. but as i was saying i dont have tons of free time at school, its more of a knowledge thing. and i already get all a's and b's at school. And i do wish to go to an advanced computing school. that would be nice but what i was really looking for here was not just to be used as my little prank, but I have been developing this little test program trying to prove to my parents and other people i know that i am good with computers. of course it takes weeks for me to write programs that are pretty simple because my internet logs off every half hour, i need to search for codes that will help me, and I am only allowed on my own computer 2 hours, SOMETIMES less a day and i cant get on on monday or fridays. but none the less, I have created this little program which may or may not be illegal, and i am not sure which but i have tested it and if you would like to see it you can click here to view the text. I assure you there is not virus or anything on it, the only virus i know how to make on a batch file is to format the C: and you get a message if you want to do that so.. i dont know, and if you can kind of tell me what you think of it even though it may be very useless.gamerx365, you obviously don't understand how we work around here. Before posting again, you should take the time to read our forum rules. Your intentions here are very questionable. And even if we knew for a fact that you had 100% good intentions, we still couldn't help you. This is a public forum and anyone on Google can easily stumble upon these posts. This, of course, means that someone could use some of this information to cause some real damage, and we refuse to have a hand in that. Now, with that said...this particular issue may not be very threatening, but we also don't advocate pranks like this. If you want help with these sorts of things, you're going to have to find it elsewhere. And like Dusty says, your school places boundaries and restrictions for a reason. Those computers belong to THEM, so you have no say in how they're operated. Being their computers, they can place whatever restrictions they want, and you should be mature enough to respect that. And trust me, there are things in life far more important than proving people wrong and showing off how "POWERFUL" you are. |
|
| 3125. |
Solve : Should I write protect my boot floppy?? |
|
Answer» Is it safe, OK, to leave my emergency boot FLOPPY write enabled? If you read my recent post about pausing the screen when reading large text FILES you see why I have LEARNED that in some cases you may want to. |
|
| 3126. |
Solve : Creating an ODBC data Source with DOS? |
|
Answer» Hi, I want to create an ODBC data source in DOS using a BATCH FILE. The target computer has Windows XP and the datasource is in MS Access. |
|
| 3127. |
Solve : Delete old profiles remotely from multiple PCs? |
|
Answer» I am wanting to delete old profiles that are older than 30 days remotely for multiple PCS (<100). |
|
| 3128. |
Solve : ftp & batch help? |
|
Answer» First off all i want to say sorry if i openeded anyone in my lastpost and it wont happen again i didnt mean to complain when no one didnt reply. @echo off This sript is what i am looking for thank you. The only thing i donot know is what lines to put in the ftp.txt file if my username was website.com and password was password would i put this in 2 seprate lines in the text? soryr to sound dumbQuote First off all i want to say sorry if i openeded anyone in my lastpost and it wont happen again i didnt mean to complain when no one didnt reply. I seem to have missed that. What did you write? I did a search but I couldn't find anything. The FTP.TXT file is created from the batch file. So you just need to fill in these 3 values in the batch file: 1) echo user myuserid>ftp.txt 2) echo mypassword>>ftp.txt 3) ftp -s:ftp.txt mysite.com 1) will contain the username (REPLACE "myuserid") 2) will contain the password (replace "mypassword") 3) will contain the FTP host that you are logging into (replace "mysite.com")to have more control of your FTP process, you can use more suitable tools like Perl, Python etc... here's a perl example Code: [Select] use Net::FTP; chdir "c:\"; $ftp = Net::FTP->new("some.ftpserver.com", Debug => 1); $ftp->login("user",'password'); $ftp->cwd("/somedir"); while (<*.html>) { $ftp->put($_); } while ( <*.doc> ) { $ftp->put($_); } while (<*.pdf> ){ $ftp->put($_); } $ftp->quit; ghostdog74how would i compile and run a script like that in perl?. ghostdog74 I just was being sarcastic in my other post when no one replied after so many hours. It was wrong of me. I want to program i just get frustrated when it doesn't work out i spend ages on a code run it and get a errorr message but i guess you cant PICK programing up overnight.Quote from: kentguy07 on June 15, 2007, 02:32:29 PM I just was being sarcastic in my other post when no one replied after so many hours. Don't do it. Let me put that another way. DON'T DO IT. It's forum suicide. Nothing on earth makes a person look a bigger dork than bitching about not getting (free!) help quick enough, especially after a period of time measured only in hours. Also plenty of people who could help you will change their minds as a result. Quote from: kentguy07 on June 15, 2007, 02:32:29 PM ghostdog74how would i compile and run a script like that in perl?.you can save it as somefilename.pl , and run it from the perl interpreter on the command prompt, type perl somefilename.pl. However, since you don't really know perl yet judging from your reply, you can try and use what Gary has posted (the batch one) first. Quote ghostdog74 I just was being sarcastic in my other post when no one replied after so many hours.there are a few reasons why people don't reply. Ambiguous questions. Questions not easily understood. Or indeed no one knows the answer etc etc. So its EITHER you wait and see, or try to describe you problems in more DETAIL, like providing more examples etc etc. Or else at last resort you can try asking at other forums. lastly, patience is a virtue. Quote It was wrong of me. I want to program i just get frustrated when it doesn't work out i spend ages on a code run it and get a errorr message but i guess you cant pick programing up overnight.you are RIGHT. it takes practice. |
|
| 3129. |
Solve : Batch file to open SQL , select query and send information to a parameter ?? |
|
Answer» Hi |
|
| 3130. |
Solve : CSVDE help? |
|
Answer» Okay here's the situation: I need to use CSVDE to query AD and return me a LIST of e-mail addresses. I don't need this for every username in our domain just certain ones. I have a list of usernames in one file and wrote a little 'for' batch file to run the command agaisnt there NAMES |
|
| 3131. |
Solve : Adding files to MSDOS boot CD? |
|
Answer» I need to run a batch file on the BIOS of a computer that has no floppy drive. I got out my MSDOS ISO, then using MagicISO I added my 3 files (a batch file, an executable, and a data file). I burnt the CD, and Windows XP confirms when browsing the CD that a TOTAL of 43 files are present. I boot to the CD on the other computer successfully - however the DIR command only lists 40 files, as if the extra 3 were never even added. I KNOW they're on the CD, but can't understand why MSDOS is IGNORING this fact. I've tried using a different ISO editor, but to no avail - I can't add any files that DOS will recognise. |
|
| 3132. |
Solve : How to run pfcex.exe from command prompt?? |
|
Answer» Hello, |
|
| 3133. |
Solve : Deleting Using a wildard xp? |
|
Answer» I want a command that will SCAN my systemdrive for documents and delete them WITHOUT prompting me. |
|
| 3134. |
Solve : Can't compile - Syntax Error?? |
|
Answer» I'm running Windows Vista and the Firefox browser. My question is: Code: [Select]set /a min=%min% +1They do, at least in Vista they do, and changing doesn't change anything. Quote Well, I haven't used Vista before, so I was just guessing that they wouldn't have changed COMMAND Prompt. Maybe you could do (for the line below) set /a, instead of set. But that's just my guess.Quote from: Dark Blade on June 18, 2007, 03:01:13 AM Well, I haven't used Vista before, so I was just guessing that they wouldn't have changed Command Prompt.No luck, I'm downloading a better compiler now anyway - maybe it can do it. Thanks anyway. |
|
| 3135. |
Solve : BIN files? |
|
Answer» What program do i need to open a .BIN file?What OS do you use? Well. this morning i seen a .cue file in the folder too. that must go in after the thing gets done DLing b/c its not in there yet and im DLing the same exact thing. lol. im so confused about this. lol. So once i get the thing DLed completely (again). what exactly do i need to do? (lets use Nero). what do i do with the cue file ..and what do i do with the bin file...and the system file..lolhave you even played with nero before? type these words in google "open bin file nero" , you can find links that teach you how.Quote from: zanter8 on June 18, 2007, 08:07:00 AM its a game though. its not a movieAh, my bad. Anyways, you can play .bin movie files with VLC.....thanks ghostdog. I think ive figured it out. i have one more ? ... if i dont want to burn it to a CD (which i probably will). How would i run the game?if this is any help. i have nero express 6Quote from: zanter8 on June 18, 2007, 08:19:40 AM thanks ghostdog. I think ive figured it out. i have one more ? ... if i dont want to burn it to a CD (which i probably will). How would i run the game?you have to find a way to extract the CONTENTS of bin out and then play it... just burn it to a CD and run your game, settles it all.ok, do i need to put the bin file on the CD or just the cue? |
|
| 3136. |
Solve : Kill an Application Runing in Windows XP? |
|
Answer» Hi there, How could I kill an application running on Windows XP from DOS? I make this function on UNIX/Linux using the command Kill, but I don't know who is the command in DOS USED to finish an application (Like Ctrl+Alt+Del). ghostdog, he said how to do it from DOS.DOS prompt type: cscript myscript.vbs , or he can save this command in a batch file, then run the batch.. or he can just type taskkill BLAH blah... all from DOS..Well, he'd have to make the vbscript first, so it's not all from DOS (then again, he could just add text to the file from DOS... ). And my thing is simple, one step. But if you like vbscript...Quote from: Dark Blade on June 18, 2007, 05:39:20 PM Well, he'd have to make the vbscript first, so it's not all from DOS (then again, he could just add text to the file from DOS... ).hey kid, does it matter? i quote myself Quote taskkill /? see the one in red?.. I am telling OP if he likes vbscript , he can use it.OK then. I think that he's got his question answered, at least. So you don't have to reply to this thread any more.Quote So you don't have to reply to this thread any more.sorry, but i will still reply if he encountered problems and if i think i know how to solve it. It's command prompt. Not DOS.OK, Command Propmt it is I'm just saying DOS because the OP said DOS, and mightn't know the difference (i.e. using CMD but calling it DOS). |
|
| 3137. |
Solve : copy file from loca disk to network drive and rename the file to filename + date? |
|
Answer» hi! There i am new to writing batch file scripts. I have found some information on copying a directory from local directory to a network drive , the directory will be the system date. BU t i am looking to backup a single file to a network directory and at the end of file NAME the date should be added without changing the file extension. |
|
| 3138. |
Solve : Bridge within Batch and VBScript? |
|
Answer» Hi... However, i have another minor issue here,in which part of the script did you input 1000/3000? show how you input this. Quote @echo offthe script expects input parameters, the for loop calling the script is missing those parameters. This is a good resource to read.Oops, the code which i post is not a division, here is the code i use in the vbs for the division: Dim Total,Failed,Sum Set objArgs = WScript.Arguments Total=objArgs(0) Failed=objArgs(1) WScript.Echo "Total " ,Total WScript.Echo "Failed ", Failed FailPercentage=CDbl(Failed) / CDbl(Total) * 100 WScript.Quit(FailPercentage) Thanks for the resources. Will read up more on the script SIDE... |
|
| 3139. |
Solve : ping and automatically open? |
|
Answer» is it POSSIBLE to ping an address in a batch file and automatically go to the replied IP?does this help http://pressf1.pcworld.co.nz/archive/index.php/t-21234.htmlactually that made me extremely confused and im not sure if were talking about the same thingwell , google came up with that at as my number search when i typed in your question.... is it possible to ping an address in a batch file and automatically go to the replied IP?vague. define "go to the replied IP". what do you WANT to do?well since you asked ill put purpose description in as well... At school they block certain sites, some for no reason at all. I want to make a batch program that will automatically ping the defined website and that will get to the site through the IP address so that i do not have to type it in each timesorry cannot help you. and you have better get back to your studies. good luckyou could use this Code: [Select]ping (website here)>>site.txt find timed out if exist timed out goto END if exist site.txt start (website also goes here) if not exist site.txt echo no reponese pause :END exit Quote from: Amrykid on July 09, 2007, 09:54:28 PM you could use thisyeah all it did was nothing. it showed the path and then basically frozeactually now that i have inspected it, it created a text file that juast has C:\Documents and Settings\Seth\Desktop>ping www.yahoo.com 1>>site.txt on it a bunch of timessorry, im new at this and it was something off the top of my head. all i know is you might have to use if and label ALOT!!! remember, ALOT!!!!hope this helps. Like was stated in another thread, your school sets these restrictions and limitations for a reason. Being a learning institution for young people, they need to REGULATE what sorts of sites you visit to help ensure it's actually related to your education. While you are there, you're their responsible and you are on their terms. If you FEEL a site is being wrongly blocked, then take it up with the administrator. Congratulations on YET another locked topic. |
|
| 3140. |
Solve : Ping a file then copy its contents.? |
|
Answer» i have this PROGRAM checks for updates by pinging a online .xml file the compares the file for update or copys the contents. |
|
| 3141. |
Solve : IF statement question???? |
|
Answer» I have an application that writes a file and I have created a script to record the contents of that file to an environment variable. I want to write an IF statement to copy a file and make a registry change based on the variable. My problem is that in one instance it doesn't create an environment variable at all and so I need to adjust the IF statment for that. I want to write an IF statement to copy a file and make a registry change based on the variable. My problem is that in one instance it doesn't create an environment variable at all and so I need to adjust the IF statment for that. If exist and if not exist only work with FILES. if exist "C:\autoexec.bat" goto label if not exist "D:\test\readme.txt" echo file not found I presume this "works" because there is no file with a name corresponding to the expansion of the variable %orcad_lm% in the current directory:- Quote 'if not exist %orcad_lm% regedit /s c:\orcad_dongle\server.reg' if you want to check that a variable "does not exist", ie has no value, you need to perform this test if "%orcad_lm%"=="" then goto 4 You SAID IF exist and if not exist only work with FILE... I am not positive but I think maybe you meant that only "if not exist" works with files. My IF exist statment works fine looking for a variable, so I'm a little confused why the IF not exist woudln't work. Quote from: jerhiggs on July 11, 2007, 07:59:25 AM You said IF exist and if not exist only work with FILE... Maybe you need to read my post again a couple of times? Anyway, you can check it yourself, you don't have to take my word if you don't want to. It continually surprises me that people have these odd ideas about DOS/NT commands which they could check just by 1. Opening a command window 2. Typing the command, followed by a space, a forward slash and a question mark This is the standard DOS/NT command line way of accessing the help for a command. Most of the queries on here wouldn't be needed if people did this. So... just the first few lines of the IF help are all we need. Remember, this is not my theory, this is Microsoft's own help. In fact I have been using BATCH files for over 20 years, so I think I know how IF works by now, but like I said, you don't believe me, take Microsoft's word for it, not mine. I have made the relevant line red in colour. Quote c:\>IF /? So we see that IF EXIST works only with filenames. Like I said. The command is only executed if a file with a name corresponding to what follows EXIST actually exists. With IF NOT EXIST the command is only executed if the file with that name does NOT exist. If you got IF EXIST to work with a variable, that variable MUST have held the name of a valid file. eg Quote SET var="test.txt"Ok, well since you are a "mentor" with 20 years of experience and you say that IF statements ONLY work with Files... then open up your own command window one more time and type these commands -- Let me know what you get. set orcad_lm=test **HIT ENTER KEY** Then type - if %orcad_lm%==test notepad.exe **HIT ENTER KEY** Did notepad open up OF COURSE IT DID! - Do you have a file called orcad_lm ANYWHERE on your PC I REALLY DOUBT IT! You are still going to tell me, with your 20 years of of batch file usage, that the IF statement ONLY works with files? How about this? Go back to your command window again and type "the command, followed by a space, a forward slash and a question mark". Do you see above the "relevant line red in colour" where it says IF [NOT] ERRORLEVEL or string1 ? Do you really think that errorlevel or string1 are referring to filenames??? Read a little further down in the IF help where it states this - The DEFINED conditional works just like EXISTS except it takes an environment variable name and returns true if the environment variable is defined. ENVIRONEMENT VARIABLE - just like in my batch script... hmmm? Oh, and since you seem to believe that you know everything and I know nothing... Maybe you will believe MS. Here is a little something that Microsoft calls a knowledge base with SOLID proof (from Microsoft) that IF statements work with something other than files as you so kindly and all-knowingly pointed out to me - http://support.microsoft.com/kb/121170 Oh, and since you have NO idea who I am or what I know or how LONG I've been working with IF statements... why do you presume that you are the only one that could be correct? If you are going to talk crap and act like a know-it-all-bully around here... at least be able to back it up. It's people like you who troll forums looking for noobies to pick on because you have nothing better to do. 1072 (12.916 per day) posts in less than 3 months? I wonder how many of them are picking on people like this one? Sorry... this newb actually knows what he is talking about and did do research before I posted a legitimate question. Is there anyone else out there who is actually willing to give some positive suggestions as to why my IF NOT statment doesn't work correctly?Quote from: jerhiggs on July 11, 2007, 11:58:26 AM set orcad_lm=test**HIT ENTER KEY** Now the variable orcad_lm is storing "test". OK so far. Quote Then type - This says "if the variable orcad_lm expands to the string "test" then run notepad.exe". Surprise surprise, it worked. Quote Did notepad open up OF COURSE IT DID! - Do you have a file called orcad_lm ANYWHERE on your PC I REALLY DOUBT IT! You are moving the goal posts. Let's see what you wrote before. Quote You said IF exist and if not exist only work with FILE... Admit it. You SCREWED up. You seem to think that if you pretend you didn't type "if exist", then somehow it'll go away. Maybe, in a couple of years, when you hit 13, your ego won't be so fragile you have to hide from your mistakes by abusing others in an infantile fashion. Quote IF statements work with something other than files as you so kindly and all-knowingly pointed out to me IF statements work with a variety of situations. It is you who didn't understand about the EXIST switch only working with files. Quote Is there anyone else out there who is actually willing to give some positive suggestions as to why my IF NOT statment doesn't work correctly? Not the IF NOT EXIST statement you ACTUALLY asked about before? That is in your batch file you posted? |
|
| 3142. |
Solve : How to include timestamp on each line when piping to a file?? |
|
Answer» Hello, |
|
| 3143. |
Solve : NooB inquiry... (displayed counter)? |
|
Answer» (PARDON my ga ga nooB LINGO) |
|
| 3144. |
Solve : Copy only files modified or created today? |
|
Answer» I had a BATCH file that did this, but I seem to have inadvertently deleted it and cannot, for the life of me, figure out how I had done it. |
|
| 3145. |
Solve : How to disable CTRL+ALT+DEL with a .bat file? |
|
Answer» Hey I am new at creating batch FILES is there a way that i can disable ctrl+alt+DEL and maybe EVEN alt+tab.For what purpose ? ?disabling ctrl alt del?? |
|
| 3146. |
Solve : How to get file name in DOS? |
|
Answer» Hi, |
|
| 3147. |
Solve : 10 for cmd? |
|
Answer» --using cmd-- 1) Change backround 2) Change start MENU delay 3) Remove recent documents menu 4) hide your account from the logon menu 5) Create a briefcase 6) Automatically switch on num-lock 7) Speed up shutdown 8 ) Speed up NTFS 9) Shutdown to "its now safe to turn off your computer" 0) Change registerd owner\company ------------------------------------------------------- 1)Change Backround @echo off reg add "HKCU\control panel\desktop" /t REG_SZ /v Wallpaper /d %1 /f %1 = Location of .BMP Example: c:\mybackround.bmp Note:it does change automatically , but unless you reboot or GO to the backround settings menu.. it wont. 2)Change Start Menu Delay @echo off reg add "HKCU\Control Panel\desktop" /t REG_SZ /v MenuShowDelay /d %1 /f %1 = Start Menu Delay Example: nuShowDelay /d 0 /f 3) Removing Recent Documents Menu @echo off REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoRecentDocsMenu /t REG_DWORD /d 0 Note: this one requires reboot to work , or try using the alternative method listed as 11. 4) Hide your account from the logon menu @echo off reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /t REG_DWORD /v %username% /d /f 0 note: since its used in cmd, %username% will work to complete it with the current user. note: it will hide your user or administrator from logon screen , you have to use the logon box.. you can switch to it at start up , by holding shift and the pressing winkey+U or +L. 5)Create a Briefcase RunDll32.exe SYNCUI.DLL,Briefcase_Create note: may not work. 6)Automatically Switch on Num-Lock @echo off reg add "HKCU\control panel\keyboard" /t REG_SZ /v initialkeyboardindicators /d 2 /f note:requires restart or usage of the other method. 7) speed up shutdown @echo off reg add "HKCU\Control Panel\Desktop" /t REG_SZ /v AutoEndTasks /d %1 /f reg add "HKCU\Control Panel\Desktop" /t REG_SZ /v HungAppTimeout /d %2 /f reg add "HKCU\Control Panel\Desktop" /t REG_SZ /v WaitToKillAppTimeout /d %3 /f reg add "HKCU\Control Panel\Desktop" /t REG_SZ /v WaitToKillServiceTimeout /d %4 /f %1 = AutoEndTasks Value Example:1 %2 = HungAppTimeout Value Example:4000 %3 = WaitToKillAppTimeout Value Example:4000 %4 = WaitToKillServiceTimeout Value Example:400 8 )Speed Up NTFS @echo off reg add "HKLM\system\currentcontrolset\control\filesystem" /t REG_SZ /v disableNTFSlastaccesUpdate /d %1 /f reg add "HKLM\system\currentcontrolset\control\filesystem" /t REG_SZ /v NtfsDisable8Dot3NameCreation /d %2 /f reg add "HKLM\system\currentcontrolset\control\filesystem" /t REG_SZ /v NtfsMftZoneReservation /d %3 /f %1 - 1 , Last File Access no longer registerd %2 - 1 , No More Double Filenames %3 - 2 , If their are MANY files on the drive, the mft wont GET defragmented after using this. 9)Shutdown to "its now safe to turn off computer" @echo off RunDll32.exe USER.DLL,exitwindows 0) Change Registerd Owner\Company @echo off reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /t REG_SZ /v RegisteredOrganization /d %1 /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /t REG_SZ /v RegisteredOwner /d %2 /f %1 = Your Organization Value Example: my company. %2 = The Owners Name Example : Diablo 11)Alternative to update registry without restarting @echo off taskkill /f /im explorer.exe note: this will terminate explorer.exe, it might reload automatically but if it doesent. type explorer.exe , if it has to be done.. this cannot be used in a batch file because without explorer.exe cmd.exe stops working. note: use any of these methods at your own risk, i list them here for education purposes only. |
|
| 3148. |
Solve : help creating batch directory renamer? |
|
Answer» i'm working on a server that has some mac clients. unfortunately our end users OFTEN create files and folders with This little snippet is untested as I was unable to create a file or folder name with a trailing dot. thanks for the help. i tried using this but it doesn't seem to be working, maybe i'm doing somethign wrong. the directories i'm working with are located here: Code: [Select]D:\moved user folders\NICOLJ\Event Photography so i modified your code to match that file location Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('D:\movedu~1\NICOLJ\EventP~1 /s /b ^| findstr ".*\.$"') do ( ren "%%i" "%%~ni.dot" ) echo Done and this is what i get Code: [Select]'D:\movedu~1\NICOLJ\EventP~1' is not recognized as an internal or external comma nd, operable program or batch file. Done any more suggestions? Quote @echo off I believe you left out the dir command: Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('dir D:\movedu~1\NICOLJ\EventP~1 /s /b ^| findstr ".*\.$"') do ( if not errorlevel 1 ren "%%i" "%%~ni.dot" ) echo Done! Done!! Done!!! As mentioned, this code is untested. How did your users manage to create files/folders with a trailing dot? I tried quotes and even Explorer, but had no luck. Quote from: Sidewinder on November 25, 2008, 01:17:40 PM Quote@echo off eh, i appriciate the help but that doesn't see to WORK either. the situation is; we have mac users that connect to the server to save files. they save the files with the problems and i[on the server end] find it difficult to work with the files afterwards Quote i appriciate the help but that doesn't see to work either How doesn't it work? Let's start simple and we can build this together. From the command prompt enter the following LINE and post the output (or at least some of it, if it's too lengthy): dir D:\movedu~1\NICOLJ\EventP~1 /s /b | findstr ".*\.$" Once we can see the output, we can build the rest of the command. If it is possible, also post some of the input by running dir on the same directory. |
|
| 3149. |
Solve : Multiply a variable by 10? |
|
Answer» @up i've got it. thanks for the code, but it didnt much help. well, actually it did help me realize my error. im surprised it took even me this long to figure out this dumb mistake lol. that was what i mean in last post Quote is the %class% set before becouse it looks like you are seting %alliance% and trying to match %class%yes class was set before. the problem was it was being set as 3... lol. thats why i was so confused. |
|
| 3150. |
Solve : Having trouble manipulating data read from a file? |
|
Answer» Hello, Can someone explain how to manipulate data read from a file?there are better tools to do file manipulation than using batch. even VBSCRIPT has a fair amount of FUNCTIONS for that. splitting up lines, replacing text, storing data into arrays, etc that makes things easy for a programmer. If you are learning programming, at least get a proper programming LANGUAGE. (or change your teacher )Perl is specifically designed to be easy to use for manipulating text files, I believe.Quote from: BC_Programmer on April 04, 2009, 07:45:36 PM Perl is specifically designed to be easy to use for manipulating text files, I believe.not just Perl. Python, sed, awk , even Ruby and PHPQuote from: The Hansenator on April 04, 2009, 03:08:17 PM The teacher seems to have a habit of not giving us enough information. It's a well known teacher's trick, called "hopefully making you think and learn how to discover things". Like the fact that commands have help that you see by TYPING the command, a space, and /? at the prompt. Try typing FOR /? at the command prompt. Quote from: Dias de verano on April 05, 2009, 03:54:25 AM It's a well known teacher's trick, called "hopefully making you think and learn how to discover things". Like the fact that commands have help that you see by typing the command, a space, and /? at the prompt. I'm familiar with that trick but it wasn't until yesterday, after stumbling across it on the internet, that I knew there even was a FOR command. It's hard to look up something when you don't know what to look for. I did type FOR /?, and maybe I'm a little slow, but I wasn't able to figure it out by looking at the help file.Thank you to both of you, that was just what I needed! Quote from: devcom on April 04, 2009, 03:15:32 PM Code: [Select]@echo off Quote from: Geek-9pm on April 04, 2009, 03:59:24 PM FOR /f means to read lines for just one file. |
|