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.
| 6101. |
Solve : Importing password to batch script? |
|
Answer» I am a beginner - please be patient. I work for a small firm that UTILIZES about 100 batch files to pull data from a main database. Database requires a user name and password each time when CONNECTING via ftp. We have been listing the user name and password in the ftp script file and they work fine until we need to change the password again. Then it is a tedious task to open all 100 files and change the password. Is there a way that the batch file can look up or import a password from one location thus eliminating the need to open all the batch files when the password changes? Thanks in advance for your help!Are you saying that you have multiple FTPs and each has a different log-in name/pass?Multiple FTPs pulling different data but with the same user name and password..I don't know if batch can be set to automatically change like that but you may be able to have a batch log into all of the FTPs and change the the batch their. I don't know if that is actually possible but I am shour someone knows if it is, and how to do it, if it is. Was that confusing?If you dont mind the password being held in clear text, store it in a 1 line file (call it password.txt) then have this line |
|
| 6102. |
Solve : Booting from USB to DOS - how to logout? |
|
Answer» Hi, I have CREATED a bootable USB great - I can also run Ghost from this USB great. However when I'm finished I still have a C prompt and I haven't been able to work out how to "logoff" or if I need to. I am not booted into XP/Vista/Wind 7 just using dos from my USB which gives me access to the NTFS disks (VIA NTFS4DOS or Ghost) and the cd drive. So what do I do not sure if just powering off is safe. The boot is done using the Win98 boot disk files on the USB. I see there are commands logoff and shutdown although neither are listed in my XP dos help but anyway these are to shutdown windows I'm not running windows, Anyone know the answer to this, Cheers, GrahameYou should be able to just power off your computer and restart.The proper way to shut down from DOS is to save any FILE you are working on, then exit back to the prompt from whatever app you are running (you can only run one at a time) and FINALLY switch off. We used to listen for HDD activity to stop. Of course, if you wish to reboot the MACHINE, you can do Ctrl-Alt-Delete or even press the reset button. This might be handy if you want to first remove the USB drive so that the machine will reboot from the next drive in the boot order list. |
|
| 6103. |
Solve : Backup Files under another users profile? |
|
Answer» THANKS for taking the time to read my question. I've made a .bat file that I can run that backs up folders under my user profile, and All Users. My .bat file however, does not back up my wife's folders. I have the security on, so I'm guessing that's why it doesn't work. Is there a way I can put her PASSWORD in the .bat file so that it will reference it, and then back her FILES up? Thanks, BradQuote My .bat file however, does not back up my wife's folders. ... or a colleague's or business rival's? hmmm, hadn't thought of that. I suppose my only option is to assign admin privelages back to my wife and I. Thanks for the help??? BradHere is an idea. Log on as the Administrator. Set up a scheduled task to start that batch under the Administrator. Switch user to your account. Leave the administrator "logged in" and let the computer run unattended. At the right time the backup well start automatically. I have not personally TRIED this. Maybe SOMEONE else has a better idea. |
|
| 6104. |
Solve : Is there any way to Install the Application by default ?? |
|
Answer» Is there any way to Install the Application by default without user intervention or Automatic installation by passing the Exe in command line ,or Autoinstaller kind of thingFor what reason? Insufficent information. |
|
| 6105. |
Solve : Eject Pen drive? |
|
Answer» hi, how i eject pen drive thought DOS. if possible or not ??Why do you need it through batch? Can't you just go to, file > eject?Download eject.zip I did not make that. Look here for help with it: http://quick.mixnmojo.com/usb-disk-ejector [attachment deleted by admin]You can't "eject" a USB drive; there is no way to push the plug out. The right word is "stop". Then you can PULL the plug out by hand. You can bring up the Safely Remove Hardware box from a batch file with this code Code: [Select]RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll Usually my pen drive wouldn't eject when some virus affected with it. At that time when i like to eject it won't allow, even any application isn't ASSOCIATED with. Is there any command to eject safely at that time in dos. kalraj, see above. Salmon Trout is 100% correct on the Eject/Stop front... but in defence of Deadly D's question, if you have a Pen Drive plugged in and you right click on it under my computer, you are presented with 'Eject' as an option. |
|
| 6106. |
Solve : Generating one batch file from another? |
|
Answer» Folks, |
|
| 6107. |
Solve : move a hidden folder? |
|
Answer» how can i move a hidden folder using ms dos batch command move i TRIED but it worked only with unhidden folder please help thanksTry using xcopy then deleting the original. You may change the attributes of the hidden files and FOLDERS: C:\>attrib /? Displays or changes file attributes. ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename] [/S [/D]] + Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. [drive:][path][filename] SPECIFIES a file or files for attrib to process. /S PROCESSES matching files in the current folder and all SUBFOLDERS. /D Processes folders as well. C:\> The copy and delete method suggested above is safer. |
|
| 6108. |
Solve : Auto run .exe file and answer yes to questions? |
|
Answer» Except with %1, %2, etc. anyway, no biggie. Quote from: Helpmeh on September 20, 2009, 03:24:02 PM Except with %1, %2, etc. anyway, no biggie. That's with batch files, not EXE's.Batch files CONVERTED to exe?Quote from: macdad- on September 20, 2009, 03:21:33 PM Besides piping, you cant send KEYS to an exe. If it is a console .exe which takes input from stdin, you can sometimes redirect stdin like this program.exe < input.txt Quote from: Helpmeh on September 20, 2009, 03:27:24 PM Batch files converted to exe? Exactly. Well YES, but still haven't checked into Batch-To-Exe, from prior testing it had a few bugs. |
|
| 6109. |
Solve : How to copy & run batch file remotely? |
|
Answer» I have created one batch file on server, such that - you could try the following: Dear wbrost, I have created batch file on my server m/c, The operation of my batch file is like this, 1) I have log file in my server which records client login logout time, For particular user if the logout log is not exist(means application is still on & it is consuming license from the license server) then i am reading the clients last login time & date, 2) Checking the date & time difference with current date & time 3) If the time difference is greater than 8 hrs & date difference is greater than 1 day 4) Then, copy the killprocess.bat file from server to client machine & execute that batch file on client machine remotely to kill that perticular process. ----- killprocess.bat file has one liner code, cd\ taskkill /F /IM processname.exe ------ Issues/ Problem i am facing are, 1) for copying killprocess.bat from server to client machine requires shared folder on client pc. as said earlier my domain restrictions doesn't allow me to share folders in client pc. 2) even if i manage to copy the killprocess.bat file somehow, for executing that batch file remotely using PSEXEC command also requires the shared path where the killprocess.bat is located - How can i execute process remotely without having shared folder in client pc? is there any alternate to execute batch file remotely? I thing now i have explained my problem in more detailed. Eagarly waiting for the reply, Thanks in advance. 1) if you have access to the system you can map a network drive using the administrative share. example: \\computername\c$ this will give access to the root of the c drive on the system computername 2) using the at command you can schedule a remote task to execute at a specific time. The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command. AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]] AT [\\computername] time [/INTERACTIVE] [ /EVERY:date[,...] | /NEXT:date[,...]] "command" \\computername Specifies a remote computer. Commands are scheduled on the local computer if this parameter is omitted. id Is an identification number assigned to a scheduled command. /delete Cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are canceled. /yes Used with cancel all jobs command when no further confirmation is desired. time Specifies the time when command is to run. /interactive Allows the job to interact with the desktop of the user who is logged on at the time the job runs. /every:date[,...] Runs the command on each specified day(s) of the week or month. If date is omitted, the current day of the month is assumed. /next:date[,...] Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, the current day of the month is assumed. "command" Is the Windows NT command, or batch program to be run. if you still have questions please let me know.Dear wbrost, You are correct, but as i said earlier my domain client pc doesn't have share folders, instead the sharing permission is not exist. and i suppose the mapping drive is possible only if the client machine has the shared folders in it. pls correct me if i am wrong.there is actually a shared folder by default. This is called an administrative share. The administrative shares can be accessed by putting a dollar sign ($) after the drive letter. example for the administrative share for the C drive would be: \\computer\C$ to see if the system has the administrative share active do the following: Right click on my computer click on manage expand shared folders click on shares.Dear Wbrost, I'm getting following error while accesing those folders, Error 5: Access Is Denied. Is there any other alternate to copy file remotely (without sharing) ------ Can i make use of FTP for pushing batch file? But i suppose FTP doesn't pushes anything, somebody has to push data to him & Pull data from him, pls correct me if i am wrong. (If above happens through FTP, i can make use of AT command to schedule that batch script as suggested by you.)How are you thrying to access the computer when you get the error message? you can test access out side the command line by doing the following: click on start click on run type in \\computername\C$ when prompted enter the following: user name - computername\accountname password - password for account you need to make sure you are connecting as the account on the remote system. please see the below command switches for reference: NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]] [/USER:[domainname\]username] [/USER:[dotted domain name\]username] [/USER:[[emailprotected] domain name] [/SMARTCARD] [/SAVECRED] [[/DELETE] | [/PERSISTENT:{YES | NO}]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}] |
|
| 6110. |
Solve : How to run a command in bat file..??? |
|
Answer» Dear All, C:\Program Files\PrintFile>prfile32.exe /s:c:\test\*.txt Why are you using the redirection symbol > should this not be a backslash? Quote from: Dusty on September 18, 2009, 04:23:33 PM
It's not a redirection symbol; it's the last character ($g) of his console prompt. =Code: [Select]@echo off cd C:\Program Files\PrintFile\ prfile32.exe c:\test\*.txt Rem Or REM cd \ REM C:\Program Files\PrintFile\prfile32.exe c:\test\myfile.txt Rem Test ONE file first and then use wildcard * print32.exe is a third party program not on my machine and I cannot test the above. I do not want to download. Might work better with linux?Quote from: billrich on September 19, 2009, 01:47:17 AM Might work better with linux? You cannot run .exe files in Linux. (except with WINE) Quote from: Salmon Trout on September 19, 2009, 02:10:32 AM You cannot run .exe files in Linux. (except with WINE) It worked ok with Hieneken Beer. Quote from: Salmon Trout on September 19, 2009, 01:24:32 AM It's not a redirection symbol; it's the last character ($g) of his console prompt. Did I misunderstand the OP's request or is it just a language interpretation thing? Quote from: BRSHRINET on September 18, 2009, 08:58:43 AM Quote from: Dusty on September 19, 2009, 04:59:54 PM Did I misunderstand the OP's request or is it just a language interpretation thing? It seemed clear to me that the OP had either copied and pasted or else typed afresh what they could see in the command window: C:\Program Files\PrintFile>prfile32.exe /s:c:\test\*.txt The prompt shows that the CURRENT directory is C:\Program Files\PrintFile. Having logged into that directory, the OP then issued the command prfile32.exe /s:c:\test\*.txt The default prompt format that which is obtained by issuing the command PROMPT $P$G, where $P means the current drive letter, path and folder, and $G means the > character*. That is where your "redirection character" comes from. Code: [Select]C:\>prompt /? Changes the cmd.exe command prompt. PROMPT [text] text Specifies a new command prompt. Prompt can be made up of normal characters and the following special codes: $A & (Ampersand) $B | (pipe) $C ( (Left parenthesis) $D Current date $E Escape code (ASCII code 27) $F ) (Right parenthesis) $G > (greater-than sign) $H Backspace (erases previous character) $L < (less-than sign) $N Current drive $P Current drive and path $Q = (equal sign) $S (space) $T Current time $V Windows XP version number $_ Carriage return and linefeed $$ $ (dollar sign) Quote from: Salmon Trout It seemed clear to me that the OP had either copied and pasted or else typed afresh what they could see in the command window: Ahhh, darnit, why didn't I think of that? Seems Billrich didn't either as he also suggests replacing the > char with the \ char. Thank you for your clarification. Quote from: Dusty on September 19, 2009, 09:55:00 PM Ahhh, darnit, why didn't I think of that? Seems Billrich didn't either as he also suggests replacing the > char with the \ char. But Billrich was on the right TRACK. Consider: You have a command window in a folder, D:\Path\folder. Here is the prompt that you see: (1) Code: [Select]D:\Path\folder> You want to run a program called Program.exe (which is in that folder) so what do you type at the prompt? Why, its name (and extension probably). So, just before you hit Enter the command window looks like this: (2) Code: [Select]D:\Path\folder>Program.exe You want to supply it with with a PARAMETER string: /a:b:\cdef\*.ghi so you add that after the program name: (3) Code: [Select]D:\Path\folder>Program.exe /a:b:\cdef\*.ghi Now: how do you put all that in a one line batch file so that you can just e.g. plonk it on your desktop and thereafter double CLICK its icon when you want to perform the operation? Why, you need the path to the program, its name and extension, and the parameter string: (4) Code: [Select]D:\Path\folder\Program.exe /a:b:\cdef\*.ghi The only difference visually between (3) and (4) is that the final > character from the prompt has been replaced by the final \ character of the program folder path. What Billrich needed to add were the double quotes necessary because "Program Files" contains a space. Code: [Select]"C:\Program Files\PrintFile\prfile32.exe" /s:c:\test\*.txt Ahah! Thank you again for the clarification... |
|
| 6111. |
Solve : help with some things in dos? |
|
Answer» C:\>type htmldrive.bat Code: [Select]REM htmldrive.bat E @echo off %1: For /f "delims=" %%a in ('dir /B /s *.htm') do echo %%a Output: C:\> C:\>htmldrive.bat E C:\>REM htmldrive.bat E E:\bookmark.htm E:\ETRUST EZ AntivirusS.htm E:\maukiegrey.htm E:\signature.html E:\so.htm E:\South.htm E:\upgrade.htm E:\walkthetalk_swf.htm E:\CH.pps\aP LITE Flash\index.html E:\CH.pps\PowerPoint\index.html E:\> |
|
| 6112. |
Solve : Batch sounds.? |
|
Answer» Quote from: BC_Programmer on September 19, 2009, 12:10:51 PM
The three letter mnemonic for CTRl-G, ASCII 07, is actually BEL, and it goes right back to teletypewriters (TTY) which predated (any) computers by some decades, although the ASCII code set only superseded Baudot in the 1960s. Quote author=Boozu link=topic=92191.msg623779#msg623779 date=1253384501] Billrich wrote: I was able to hear by running beep.bat on my machine ( see above post )Quote from: Boozu on September 19, 2009, 12:21:41 PM Salmon TROUT: the built in one may not be standard but if the pc has any speakers then you will hear SOMETHING. Nope. I don't hear CTRl-Gs through my external speakers linked to the sound card, and never have. I think you may be mistaken?Ya I was. I thought you ment something ells.Quote from: Boozu on September 19, 2009, 12:34:10 PM Ya I was. I thought you ment something ells. I just tried it & got QUITE excited in case it would work... |
|
| 6113. |
Solve : Problem with FTP? |
|
Answer» So wouldn't that be the first clue that the school has locked down FTP access to any server ...or am i missing a minute detail not yet provided ? ? A test file. It says "Hello World". But it says connection closed by the host. I don't see any filename specified in the batch file...Quote from: Helpmeh on September 17, 2009, 05:35:19 PM THIS ISN'T AT SCHOOL! I said that the script was to test if the host works properly under normal conditions. Aparently not. You may not be doing this at school right now but according to the below quote taken from reply #19 you do plan on using this at school. Quote There is currently no rule against using a computer to communicate to an other computer. And this was at home. I want to make sure it works before I check it at school to see if its blocked. If you want to see if it is blocked at school ask the teacher if it is blocked. If they don't or wouldn't know you can turn this into a class project to see who can write the batch file to find out. Heck if you get the right teacher you might even be ABLE to get extra CREDIT for it. If you don't want to bring this up to the teacher then you need to give us a good reason why as it sounds like you are trying to do something you shouldn't be.Quote from: Helpmeh on September 07, 2009, 02:19:14 PM @echo offTry reading the bolded text. Mroilfield, NICE idea. I would do that if the teachers knew how to find out what sites are blocked without checking by hand. I ALSO don't have a comtech course this year , nor do I have a death wish. I don't know about highschools you went to, but here, if you're smart, you only show it on tests. Or else. Quote from: Helpmeh on September 18, 2009, 08:25:44 PM Try reading the bolded text. How silly of me to not trust what you are trying to do just because you named a txt file "Test" Quote from: Helpmeh on September 18, 2009, 08:25:44 PM I would do that if the teachers knew how to find out what sites are blocked without checking by hand. Once again here is your own reference to the fact that you are tying to circumvent something that you think might be blocked at school. Here is a little educational fact for you: If the school has it blocked then they don't want you to use it. Hence any attempt to get around it would be violating school policy.If it is blocked, and the host works normally, then I would use it outside of school, which would be fine too. I'm trying to find out if the host works properly. Quote from: BC_Programmer on September 17, 2009, 07:41:56 PM I don't see any filename specified in the batch file...This was why I said read the bolded text, not to you mroilfield. |
|
| 6114. |
Solve : copying a directory to an other one using a batch file? |
|
Answer» Hi Guys |
|
| 6115. |
Solve : Setting IE Proxy Server? |
|
Answer» Is ther any way to SET IE Proxy Server setting thro COMMAND line ( MS DOS) Option. |
|
| 6116. |
Solve : Geting command on .txt file:)? |
|
Answer» that's better. but some countries in latin america speak portuguese. So it's simply extending the blanket. Re: Geting command on .txt file:)We need to know if the version of Windows he is using was sold in Latin America. That WOULD make a BIG difference in the BAT file. -Right? Oh, I mean ¿Cierto? ahh muy ciertoCuándo el poder del AMOR vence el amor de enchufa el mundo sabrá la paz Cuándo Infierno se hiela Del dicho al hecho, hay mucho trecho.Je déteste tout le vous, avec votre Espagnol. Je me demande également quand j'ai appri le français…I THOUGHT Americans said "GeeBus". Quote from: billrich on September 15, 2009, 11:03:04 PM Cuándo el poder del amor vence el amor de enchufa el mundo sabrá la paz se supone que ser una broma?Quote from: BC_Programmer on September 15, 2009, 10:37:28 PM Additionally neither mexicans, nor any other spanish speaking person I know pronounces it that way In Chile and in the Rioplatense dialect spoken in parts of Argentinia J becomes like German 'ch' in ich when it precedes palatal vowels [i, e] for example: gente, jinete. |
|
| 6117. |
Solve : [SOLVED] Question about FOR? |
|
Answer» I REALLY HATE seeing that dumb question smiley you get when people type ???. Why can't people just use ONE question mark? In FACT I hate smileys in general*. There's NO NEED for that weeping sad face, we KNOW you're upset your computer doesn't WORK! |
|
| 6118. |
Solve : How to find automatically the path for an appli ?? |
|
Answer» Hi all! That works well, but what if it's not installed here ? To scan the whole disk is the only solution ?i am afraid so. you can try the vbscript posted, or do the same with batch Code: [Select]dir /B /S /A-D | findstr /I "yourfilename.ext" You search like that? An alternative would be (in a batch file): Code: [Select]for /f %%I in ('dir "C:\file.txt" /s /b') do echo %%IYou can just use one % if you do it directly from Command Prompt. If you want to just find the path (not to DISPLAY the filename), do this: Code: [Select]for /f %%Iin ('dir "C:\file.txt" /s /b') do echo %%~dpIQuote from: Dark Blade on June 18, 2007, 05:27:30 PM You search like that?yes, that's my way of doing it when i have more search requirements that can't be accomplished just by cmd.exe's wildcard globbing.Okay, thanks! for /f %%I in ('dir "C:\testasgi.txt" /s /b /p') do echo %%~dpI I'm near the solution, now. I still have a problem with spaces. If the program is installed in "Program Files", the echo %%I display only "C:\Program" which is not very nice, at least from my point of VIEW... Any idea ?Quote from: rekam on June 19, 2007, 01:47:03 AM I'm near the solution, now. I still have a problem with spaces. If the program is installed in "Program Files", the echo %%I display only "C:\Program" which is not very nice, at least from my point of view... You need to set a DELIMS switch appropriately to avoid the FOR command halting at the first space. like this for /f "delims==" %%I in ('dir "C:\testasgi.txt" /s /b /p') do echo %%~dpI Type FOR /? at the prompt for more information. Also, do you REALLY need the /p switch with DIR? This does not always work well in batch files. I can't see what use it is, unless it's left over from debugging. You're trying to find one file, right? You're never going to have a screenful of information. |
|
| 6119. |
Solve : rename file with file counter? |
|
Answer» i wanted to rename all my img001.jpg files to a more descriptive name like bday_001.jpg, bday_002.jpg Just save as filename.bat... Thanks! it worked!!! However, after it renames the 10th file to BDAY_0010.jpg instead of BDAY_010.jpg. Is there a way that I can have it set to to start from 000 to 999. Thank you!how can i specify folder in loop, what command i have to use. for example i NEED to do this in c:\t3\test1.txt If not exist %~f1.\*.JPG (Echo no .JPG files found in %~f1 & GoTo Kindly do the needful. Regards, Mohamed Asif KPQuote from: MOHAMED ASIF KP on June 18, 2007, 04:53:40 AM Kindly do the needful. Mohammed, you need to note... You should start a new topic. This belongs to somebody else. In your new topic, post much more of your code. sorry ... kindly appologies.... me henceforth i will do it. Regards, Mohamed Asif KPQuote from: tads98 on February 14, 2007, 11:58:54 AM i wanted to rename all my img001.jpg files to a more descriptive name like bday_001.jpg, bday_002.jpgsorry no dos for you. But vbscript Code: [Select]Dim FSO,NewPrefix, OldPrefix, oDir, objFolder,NewFileName,counter NewPrefix="bday_" Set FSO = CreateObject("Scripting.FileSystemObject") sDir = "C:\temp" Set objFolder = FSO.GetFolder(sDir) counter = 1 For Each Files In objFolder.Files If FSO.GetExtensionName(Files) = "jpg" Then NewFileName = NewPrefix & Padding(3,counter) & ".jpg" Files.Name = NewFileName counter=counter+1 End If Next Function Padding(ValueToPad, TheDigits) theLen = Len(TheDigits) If theLen < ValueToPad Then Padding = STRING(ValueToPad-theLen,"0") & TheDigits Else Padding = TheDigits End If End Function if you want to use it, save it as somename.vbs, then on command prompt, type cscript somename.vbs. Of course, you must change the sDir value to suit your case. You did know, didn't you, that Windows Explorer has a built-in feature that will do 99% of what you want? Let's say you have these files in a folder img001.jpg img002.jpg img003.jpg If you highlight them ***all*** and invoke rename (by hitting F2 or by right clicking the selection and choosing rename from the context menu), the first file in the selection opens the rename box. If you type "bday(0).jpg", the others will be renamed bday(1).jpg and bday(2).jpg. I'm surprised, if you "code" in "UNIX", you don't know about Bash, which is very like DOS and NT, and you could then learn DOS command prompt in about 30 minutes. Or is this your homework? Sorry if I'm being cynical here. The NT prompt code for your logic above would look very similar to what you have written. May This Help : ..TESTED.. Code: [Select]@echo off REM set counter variable set first=0 set second=0 set third=0 set path=C:\Picture for /f "delims==" %%a in ('dir "%path%\*.jpg" /a:-d /b') do ( set pict=%%a call :next ) if /i "%first%"=="0" set first= if /i "%second%"=="0" set second= set /a third-=1 echo Total : %first%%second%%third% Picture was Succesfully Renamed pause exit :next if /i "%third%"=="9" set /a second+=1&&set third=0 if /i "%second%"=="9" set /a first+=1&&set second=0 ren "%path%\%pict%" "BDAY_%first%%second%%third%.jpg" set /a third+=1 goto :eof |
|
| 6120. |
Solve : Get fullpath of Process/Image? |
|
Answer» Hello... |
|
| 6121. |
Solve : connecting to remote windows system from DOS batch file? |
|
Answer» HI, I need to connect 20 remote systems very often by USING IP address and LOGIN credentials. Can you please suggest how this can be done using DOS batch file? how are you using your login credentials? Do you have an IDEA yet of using what technologies? FTP?TELNET? SSH?Network Mapping? etc... |
|
| 6122. |
Solve : copy file with success counter else failure counter.? |
|
Answer» HI All, |
|
| 6123. |
Solve : How to copy some information with DOS Commands to a specific line?? |
|
Answer» HELLO, I am trying to copy some information to a specific file that has already information (around 100 lines) but I only want to replace some strings in a specific lines without "touching" the rest of the file. ANYONE has ideas how to do this with DOS Commands? thxsee here for a start. I submitted a vbscript to replace strings in files. Also there are other batch SOLUTIONS on that thread. this will give you a start.There is also an MS-DOS utility called "fart.exe" (Find And Replace TEXT) which may do what you need. As far as I know it replaces all occurrences of one sub-string with another sub-string. I don't think you can specify a "range of text lines" to search, but it may do what you need. Goto http://fart-it.sourceforge.net and follow the sourceforge link. Hope that helps, JAMES |
|
| 6124. |
Solve : Tricky file rename -> using WinXP and Win 2003 server? |
|
Answer» Hello group. Hello group. (2) for /f "delims=" %%F in ('dir /b') do ren "%%F" "%%F.txt" Quote from: BryanRay67 on June 20, 2007, 07:57:13 AM
Code: [Select]Dim theFile Set objArgs = WScript.Arguments Set FSO = CreateObject("Scripting.FileSystemObject") theFile=objArgs(0) If InStr(1,theFile,".") > 0 Then Set objFile = FSO.GetFile(theFile) newString = Replace(theFile,".", "-") objFile.Move(newString & ".txt") End If save as myscript.vbs, type cscript myscript.vbs URNT40.d20061101-t182300 on the command prompt. Works for this file naming format. Quote (2) Thanks for your suggestion. This seems to work with the exception of it ALSO renames my batch file that is in the same folder. Is there a way to have this batch file in a parent folder and only call the rename for the CONTENTS of a specified CHILD folder? Thanks! Bryan method (1) This batch file excludes itself from its operation (thisfile.bat is whatever the batch file is called) for /f "delims=" %%F in ('dir /b ^| find /v "thisfile.bat"') do ren "%%F" "%%F.txt" method (2) place this or the the older batch file in a folder somewhere on your PATH, eg C:\Windows, and call it by name at the command prompt from the directory to be OPERATED upon. Thanks for your outstanding help!!!! Regards, Bryan |
|
| 6125. |
Solve : HOW TO READ INPUTS FROM FILE.? |
|
Answer» Hi all, Nothing. But if he wanted to do something with the lines, findstr would have to be used. Not necessarily. Code: [Select]@echo off REM create demo csv file echo eggs,flour,milk > demo.txt echo cream,butter,sugar >> demo.txt echo vanilla,lemon,chocolate >> demo.txt REM mmm...! REM show first item in each line for /F "delims=," %%L in (demo.txt) do ( echo %%L ) result... Code: [Select]eggs cream vanilla i am actually curious what OP is going to do with those lines being read |
|
| 6126. |
Solve : creating a log.txt for each command ??? |
|
Answer» a file that have been del, copy a file,TASKLIST PROGRAM, or etc.... |
|
| 6127. |
Solve : first lines of a file using type? |
|
Answer» Hi, You could download one of the many DOS/WIN equivalents to the Unix HEAD command or you could save this batch file somewhere on your path Tanks, it WORK beautiful, it as been a great help |
|
| 6128. |
Solve : Grabbing the directory name...? |
|
Answer» I'm writing a batch file that will copy a certain file into every sub-folder of a PARTICULAR folder. Here's what I have, but I'm not sure how to complete it: |
|
| 6129. |
Solve : Moving back dir? |
|
Answer» Ok i'm new to does my problem is say i i'm here in does: Ok i'm new to does my problem is say i i'm here in does:this part i'm not so sure about.. you might want to try rephrasing that Quote e:\folder1\folder2this part i think i get there's a yellow folder icon in the top left of the EXPLORER or ''my computer'' WINDOW that has an arrow going to the left and then up, which will take yout to the parent directory of the folder you're in, is that what you want? for example you will go from C:\My Documents\My Music to C:\My Documents does this help? Sorry ment in does command.cd.. That's the letters c & d and 2 dots goes up 1 level It's not 'does' it's DOS. Code: [Select] c:\batch\ftp>cd.. c:\batch>cd.. c:\> ahh... in DOS.. this can be CALLED a ''CD'' command , or just a ''CHANGE directory'' command. Once you have located the directory you want, you may move from directory to directory using the ''CD'' command (''change directory'') Example: * C> cd furniture * Moves you to the directory called 'FURNITURE' * C> cd \furniture\chairs * Moves you to the directory called 'CHAIRS' under the directory called 'FURNITURE'. * C> cd .. * Moves you up one level in the path. * C> cd \ * Takes you back to the root directory (c: in this case). Quote from: contrex on June 25, 2007, 01:54:18 PM cd.. hehe oops you got to it first Great thanks thats the one.Quote from: afcbob on June 25, 2007, 02:52:05 PM Great thanks thats the one. I see you said you are new to using DOS. You might like to bookmark these pages, for future reference. They really are helpful. >Click here< and >here,too< |
|
| 6130. |
Solve : flash drive backup batch file? |
|
Answer» I think this would be the right place for this. I think this would be the right place for this. You should use xcopy, which is designed for this task. Xcopy I:\*.* "C:\Documents and Settings\Desktop\blah\bla_bla\youGetThePoint\flash backup" /E /Y Many thanks. I'd never heard of the xcopy command (too much work with older computers, I guess) ,so I looked up the SWITCHES and syntax, played around with them, and now it's working quite nicely. However, log.bat isn't executing when called upon. Even when I changed the command to "call log.bat" since they are in the same directory. It works just fine when run by itself, so I must have messed up the call command syntax or something. I doubt this'll help with the problem SOLVING any, but the contents of log.bat have been changed for the better. log.bat echo @prompt set date=$d$_set time=$t$h$h$h > {a}.bat %comspec% /e:2048 /c {a}.bat > {b}.bat for %%v in ({b}.bat del) do call %%v {?}.bat echo %date% %time% >> bacuplog.txtThat batch file looks scarily complex. What is it meant to do? What's in the batch file that calls it?I didn't write log.bat, I copied it off of the batch file help page and changed the name of the text file at the end. Its purpose is to write to a text file (bacuplog.txt) the time and date at which I last ran the file. I came across it when I was trying to solve my earlier problem and thought, "Hmm, that might be a neat feature..."The problem I'm having is when, in backup.bat, I write "call log.bat" it doesn't call log.bat. Perhaps if I threw the text in at the end, instead of having it call on the file, it might work. I'll edit this post or make a new ONE (depending on if you beat me to the post) to tell you if that works, but I'd still like to know how I messed up a command with a 4-letter keyword. OK, this may take a little longer than I thought. Since the call command line is at the end of the batch file, I have to wait for the copy function to finish. I've got a PLETHORA of files on my flash drive, a binary smorgasbord. Weird... I executed backup.bat from the command prompt without making any changes from before, and the call command worked. Alright, now I really feel like an idiot. It works just fine. Thanks again for your time, your help, your effort, and INTRODUCING me to the xcopy command. |
|
| 6131. |
Solve : Trouble with DOS application installion on Pentium? |
|
Answer» I have a NUMBER of old DOS programming language programs and C++ libraries that I would like to archive and use, e.g., Turbo C++, Turbo Pascal, MASM, LISP, Ada, etc. I bought a new hard drive and formatted 100 MB with FAT and installed MS-DOS 6.22 with no problems. However, I cannot get the programs to install. When I try to install, e.g., Turbo C++ 3.1, the floppy drive will run but NOTHING will happen and I get the "C:\>" prompt back. With other APPLICATIONS, e.g., Microsoft Assembler, the machine will hang. I can look at the directories on the disks and perform other DOS functions. If I try to install MASM from the "A:\>" drive, I get a "Divide overflow" message. The most puzzling thing is that I successfully installed the programs going to the command prompt in Windows XP home edition, and they seem to work in the LIMITED amount I have played with them, but would like to run in DOS (or at least know why it doesn't work). It must be something in the way Windows emulates the 16 bit environment. |
|
| 6132. |
Solve : cd-room not detected? |
|
Answer» Hi, I got an old laptop,which can use only cd-room or only floppy-drive. It has to be changed. I wanna install win98 OS on it. if I use windows startup floppy,then I cant use cd-room, if I change it, it will not detect it. I have to restart, but then I cant use floppy. I used sys c: command and now the computer can boot from hardrive, but cd-room cant be seen on dos prompt. Well, I hope I made this problem clear to understand, can somebody help me, pls?[/email]1st you gotta check the boot sequence in the CMOS. MAKE sure CDRom is the 1st in the sequence. While using win98 CD, it should prompt you 3 options to startup. choose the one run with CDRomQuote from: lisatka on June 23, 2007, 02:24:01 AM ... I used sys c: command and now the computer can boot from hardrive, but cd-room cant be seen on dos prompt. Well, I hope I made this problem clear to understand, can somebody help me, pls? So if you could boot DOS from the hard drive with CDRom support, then you'd be able to proceed - correct? If so, you need to install CD drivers while booting. Even THOUGH this references XP/2000, the principle is the same. >Click Here< Read it all, of course. But I think you've done everything down through section 2, step I. Examine the steps carefully, beginning with J. Basically, you need to locate the CD driver file on your bootable floppy, and COPY it to your hard drive. Then you need to edit config.sys and autoexec.bat on your hard drive - so that the driver is loaded during boot up. This is what the above linked page is stepping you through. You can get more info, SYNTAX, examples: >Click here< I hope this helps. Which version of Win98 ? ? If the CD is from MS it should be bootable...Quote from: patio on June 23, 2007, 09:39:41 AM Which version of Win98 ? ? The OP may be like me - my original is on a shelf somewhere for safe keeping. I use a copy I burned, that I keep handy. If it gets scratched, it is not the end of the world. It won't boot. I never really spent any time to figure it out. You need to burn an iso copy of the windows 98 bootdisk and an iso copy of windows 98 to a cd then use it bootable.hi all, thank you for your help! especially to willy, because I used his tip and it worked. I had known about this method, but I didnt remember exactly, so his commands were very helpful!now I am running installation of windows 98 and it saved me some money, because I was running out of ideas.Quote from: lisatka on June 25, 2007, 06:43:04 AM hi all, thank you for your help! especially to willy, because I used his tip and it worked. Excellent! It is always nice to hear success stories. Thanks for the follow up post. Quote ..., but I didnt remember exactly, It is also nice to know that I am not the only one that does this. Quote so his commands were very helpful!now I am running installation of windows 98 and it saved me some money, because I was running out of ideas. You came to the right place for ideas. Join us here whenever you like. |
|
| 6133. |
Solve : MORE file renaming help needed? |
|
Answer» For me to rename a set of rar files to remove a single space and replace it with a more compliant underscore so that I could then do a batch unrar to individual folders with names that I wanted to specify with a loop; |
|
| 6134. |
Solve : bat to exe program-exe file cannot run under DOS? |
|
Answer» after i CONVER my .bat file to .exe file,the file cannot run under DOS. |
|
| 6135. |
Solve : File Renaming help needed. (SOLVED)? |
|
Answer» I have a daily file from my system that comes like the following: You could do something like this:that won't really do what OP requested, although it can be done manuallyNo, that won't do. To make it simple this is what I want. Original file name "ttx_export_20070622.txt" I want a script to rename it to "01_20070622.txt" Tks Sometimes it is easier to do ONE file at a time. Code: [Select]@echo off for /f "tokens=1-3 delims=_"" %%i in ('dir *.txt /b /s') do ( ren %%i 01_%%k ) You really didn't give us enough info on your directory structure and your first request has no underscore in the renamed file but your last post does. I'll let you fix up the code as you see fit. Quote from: Sidewinder on June 22, 2007, 04:52:32 AM Sometimes it is easier to do one file at a time. Thanks for this help. Here is the directory info and my real file names. I would really appricate if you can help me on this: Directory = c:\bat\export Org File = ttx_export_20070622.txt Expected File = 0120070622.txtI just noticed my first reply was a little heavy on the keyboard. This might work for your situation: Code: [Select]@echo off for /f "tokens=1-3 delims=_" %%i in ('dir c:\bat\export\*.txt /b /s') do ( ren %%i 01%%k ) Good luck. I created a batch file CALLED do.bat with the following contents: Quote @echo off When I execute the do.bat file I am getting the following error: Quote The system can not find the file specifiedCode: [Select]@echo off for /f "tokens=1-3 delims=_" %%i in ('dir c:\bat\export\*.txt /b') do ( ren %%i_%%j_%%k 01%%k ) I need more sleep. Great, works file. Thanks a lot!This thread was useful for me to rename a set of rar files to remove a single space and REPLACE it with a more compliant underscore so that I could then do a batch unrar to individual folders that I wanted to specify numerically with a loop. Like this: Code: [Select]@setlocal @echo off echo renaming archives to remove spaces... for /F "tokens=1-3 delims=. " %%i in ('dir /b *.rar') do call :do_rename "%%i" "%%j" "%%k" echo extracting archives to separate directories... for /F "tokens=1,2 delims=." %%i in ('dir /b *.rar') do call :do_extract "%%i" "%%j" goto :eof :do_rename ren "%~1 %~2.%~3" "%~1_%~2.%~3" :do_extract echo extracting %~1.%~2 mkdir "%~1" unrar e -inul "%~1.%~2" "%~1" But what if I have filenames with an arbitrary number of spaces in the filename? Obviously I can't pass in an arbitrary number of parameters into the label call. Or can I? I would like to avoid parsing the data and storing count data in a temporary file. Ideally, it would best to do it all in a single loop traversal but is batch file processing that powerful? I am guessing it is but I don't know. Any help would be greatly appreciated. Have I made myself clear enough? Egads, Josh |
|
| 6136. |
Solve : Edit GPO from cmd? |
|
Answer» Is there any tools or FUNCTION with which i can EDIT Group POLICY (LOCAL or Domain) from COMMAND prompt. |
|
| 6137. |
Solve : P3P? |
|
Answer» I am looking to open the P3P file in the registry and remove the contents , I have done this before and I am unable to remember the COMMAND to make the contents VISIBLE . If anyone KNOWS the command to do so i WOULD be most grateful . |
|
| 6138. |
Solve : Command Prompt - add date? |
|
Answer» Hello all, Hello all,dude, you can do the date calculation in your Perl script. Code: [Select]$nowdate= strftime "%Y%m%d", localtime; add that into your perl script, and you don't need to use DOS to get the date.Quote from: ghostdog74 on June 23, 2007, 12:53:55 AM Quote from: gucci_406 on June 22, 2007, 02:01:55 PMHello all,dude, you can do the date calculation in your Perl script. Hi Mate, I am not really able to write in perl, the script was writtern by some one else, so i dont really know where to place it. I have tied a couple times, but get errors. Would it be possible for you to have a look. I have inculded the script below. #!/usr/bin/perl -w # w. ebisuzaki CPC/NCEP/NWS/NOAA 10/2006 # # simple script to download gfs files # inspired by Dan Swank's get-narr.pl script # this script uses the tecnique described in # http://www.cpc.ncep.noaa.gov/products/wesley/fast_downloading_grib.html # # ARGUMENTS: action YYYYMMDDHH HR0 HR1 DHR VAR_LIST LEV_LIST DIRECTORY # # action = inv (display inventory of 1st file) # data (get data) # # HR0, HR1, DHR: forecast hour parameters # do f_hour = HR0, HR1, DHR (fortran) # for (f_hour = HR1; f_hour <= HR1; f_hour = f_hour + DHR) (C) # # VAR_LIST: list of variable separated by colons, blanks replaced by underscore # ex. HGT:TMP:OZONE # LEV_LIST: list of levesl separated by colons, blanks replaced by underscore # ex. 500_mb:sfc # # DIRECTORY: name of the directory in which to place the files # # v1.0 10/2006 who is going to find the first bug? # v1.0a 10/2006 better help page # v2.0beta 10/2006 no need for egrep, get_inv.pl and get_grib.pl # v2.0beta2 10/2006 no need for egrep, get_inv.pl and get_grib.pl # v2.0beta3 10/2006 update messages, ignore case on matches #------------ user customization section ----------------------------------------- # location of curl $curl="curl"; # the URLs of the inventory and grib must be defined by $URL$inv and $URL$grb # symbolic variables supported YYYY MM DD HH FHR (forecast hour) # # grib2 files from www.ftp.ncep.noaa.gov $URL='http://www.ftp.ncep.noaa.gov/data/nccf/com/gfs/prod/gfs.$nowdate= strftime "%Y%m%d", $HH/gfs.t${HH}z.pgrb2f${FHR}'; # # grib1 files from www.ftp.ncep.noaa.gov $URL='http://www.ftp.ncep.noaa.gov/data/nccf/com/gfs/prod/gfs.$YYYY$MM$DD$HH/gfs.t${HH}z.pgrbf${FHR}'; # $inv='.idx'; $grb=''; # $windows='no'; $windows='yes'; #------------- guts of script --------------------------------------------------- $version="2.0beta2"; if ($#ARGV != 7) { print "get_gfs.pl $version\n"; print "\nget_gfs.pl action YYYYMMDDHH HR0 HR1 DHR VAR_LIST LEV_LIST DIRECTORY\n\n"; print " action = inv (display inventory of first file)\n"; print " data (get data)\n"; print " HR0, HR1, DHR: forecast hour parameters\n"; print " do f_hour = HR0, HR1, DHR\n"; print " VAR_LIST: list of variable separated by colons, blanks replaced by underscore or all\n"; print " ex. HGT:TMP:OZONE, all\n"; print " LEV_LIST: list of levels separated by colons, blanks replaced by underscore or all\n"; print " ex. 500_mb:sfc, all\n"; print " DIRECTORY: name of the directory in which to place the files\n"; print "\n EXAMPLES\n\n Reading an inventory\n\n"; print " get_gfs.pl inv 2006101800 0 0 0 all all .\n\n"; print " Downloading 500 hPa Height and Temp 0/3/6 hours forecasts to current directory\n\n"; print " get_gfs.pl data 2006101800 0 6 3 HGT:TMP 500_mb .\n\n"; print " Downloading PRATE 12/18 hours forecasts to current directory\n\n"; print " get_gfs.pl data 2006101800 12 18 6 PRATE all .\n\n"; print " Of course the date code will have to be current.\n"; exit(; } $action = $ARGV[0]; $time = $ARGV[1]; $hr0=$ARGV[2]; $hr1=$ARGV[3]; $dhr=$ARGV[4]; $VARS=$ARGV[5]; $LEVS=$ARGV[6]; $OUTDIR = $ARGV[7]; $YYYY = substr($time,0,4); $MM = substr($time,4,2); $DD = substr($time,6,2); $HH = substr($time,8,2); # check values if ($action ne 'data' && $action ne 'inv') { print "action must be inv or data, not $action\n"; exit(; } if ($YYYY < 2006 || $YYYY > 2012) { print "bad date (year) code $time\n"; exit(; } if ($MM < 1 || $MM > 12) { print "bad date (month) code $time\n"; exit(; } if ($DD < 1 || $DD > 31) { print "bad date (day) code $time\n"; exit(; } if ($HH < 0 || $HH > 23) { print "bad date (hour) code $time\n"; exit(; } if ($hr0 == $hr1) { $dhr = 3; } if ($dhr != 3 && $dhr != 6 && $dhr != 12 && $dhr != 24) { print "dhr must be 3, 6, 12 or 24, not $dhr\n"; exit(; } if ($hr0 > $hr1) { print "hr0 needs to be <= hr1\n"; exit(; } if ($dhr <= 0) { print "dhr needs to be > 0\n"; exit(; } if (! -d $OUTDIR) { print "Directory $OUTDIR does not exist\n"; exit(; } $VARS =~ tr/:_/| /; if( $VARS =~ m/ALL/ig ) { $VARS = "."; } else { $VARS = "$VARS):"; } $LEVS =~ tr/:_/| /; if( $LEVS =~ m/ALL/ig ) { $LEVS = "."; } else { $LEVS = "$LEVS)" ; } $URL =~ s/\$YYYY/$YYYY/g; $URL =~ s/\${YYYY}/$YYYY/g; $URL =~ s/\$MM/$MM/g; $URL =~ s/\${MM}/$MM/g; $URL =~ s/\$DD/$DD/g; $URL =~ s/\${DD}/$DD/g; $URL =~ s/\$HH/$HH/g; $URL =~ s/\${HH}/$HH/g; $output = ''; $fhr=$hr0; while ($fhr <= $hr1) { if ($fhr <= 9) { $fhr="0$fhr"; } $url = $URL; $url =~ s/\$FHR/$fhr/g; $url =~ s/\${FHR}/$fhr/g; $file = $url; $file =~ s/^.*\///; # # read the inventory # $line[] = wgrib inventory, $start[] = start of record (column two of $line[]) # if ($windows eq 'yes') { $err = system("$curl -f -s $url$inv -o $OUTDIR/$file.tmp"); $err = $err >> 8; if ($err) { print STDERR "error code=$err, problem reading $url$inv\n"; sleep(10); exit(; } open (In, "$OUTDIR/$file.tmp"); } else { open (In, "$curl -f -s $url$inv |"); } $n=0; while () { chomp; $line[$n] = $_; s/^[^:]*://; s/:.*//; $start[$n] = $_; $n++; } close(In); if ($n == 0) { print STDERR "Problem reading file $url$inv\n"; sleep(10); exit(; } # # find end of record: $last[] # $lastnum = $start[$n-1]; for ($i = 0; $i < $n; $i++) { $num = $start[$i]; if ($num < $lastnum) { $j = $i + 1; while ($start[$j] == $num) { $j++; } $last[$i] = $start[$j] - 1; } else { $last[$i] = ''; } } if ($action eq 'inv') { for ($i = 0; $i < $n; $i++) { print "$line[$i]:range=$start[$i]-$last[$i]\n"; } exit(0); } # # make the range field for Curl # $range = ''; $lastfrom = ''; $lastto = '-100'; for ($i = 0; $i < $n; $i++) { $_ = $line[$i]; if (/$LEVS/i && /$VARS/i) { $from=$start[$i]; $to=$last[$i]; if ($lastto + 1 == $from) { $lastto = $to; } elsif ($lastto ne $to) { if ($lastfrom ne '') { if ($range eq '') { $range = "$lastfrom-$lastto"; } else { $range = "$range,$lastfrom-$lastto"; } } $lastfrom = $from; $lastto = $to; } } } if ($lastfrom ne '') { if ($range eq '') { $range="$lastfrom-$lastto"; } else { $range="$range,$lastfrom-$lastto"; } } if ($range ne '') { $err = system("$curl -f -v -s -r \"$range\" $url$grb -o $OUTDIR/$file.tmp"); $err = $err >> 8; if ($err != 0) { print STDERR "error in getting file $err $url$grb\n"; sleep(20); exit $err; } rename "$OUTDIR/$file.tmp", "$OUTDIR/$file"; $output = "$output $OUTDIR/$file"; } else { print "no matches (no download) for $file\n"; } $fhr += $dhr; } print "\n\nfinished download\n\n$output\n"; exit(0); the perl script can take in variable date, not just the current system date. Therefore better not to change it. However, IF only you just need system date, insert before the $YYYY,$MM,$DD declaration. Code: [Select]... $time= strftime "%Y%m%d%H", localtime; $YYYY = substr($time,0,4); $MM = substr($time,4,2); $DD = substr($time,6,2); $HH = substr($time,8,2); .... the other way, is to somehow find a way to derefence the %fdate% batch variable from the DOS version. |
|
| 6139. |
Solve : what to code in the autoexec.bat & config.sys? |
|
Answer» i had created a bootable floppy disk in XP pro plaform, what should i code in the autoexec.bat & CONFIG,SYS files so that i can make a bootable CD to RUN an APPLICATION in MSDOS? example the application file name is run.exe |
|
| 6140. |
Solve : Can Batch file continue after reboot/restart?? |
|
Answer» I'm writing a batch file to install a few pieces of software, but each require a restart, and do the restart automatically because I have them doing the installs unattended/passive/quiet. They must stay unattended/passive/quiet and must restart before the next can begin for each to install properly in order. To give an idea, the software is Windows Service pack, Program, Program. |
|
| 6141. |
Solve : Heads up about gamerx365? |
|
Answer» See his posts here... and here... and here... i hate my school but i wouldnt wreck the computers. I am in 10th grade now and I am the best programmer in the grade. I want to keep learning to keep my status and so people can fear (and nerds to respect) my power and gift. That a 10th grader would write something like this sends a SHIVER up my spine..okay but im not doing illegal stuffz here, people dont need to be scared of me, i wouldnt bring a gun to school or anything, i just want to be a great programmer and help kids at my school that want to do the same things as I. No one at school like the fact that they block any website, and we already ping them, the thing is it just takes to long.Quote from: gamerx365 on July 09, 2007, 05:43:12 PM okay but im not doing illegal stuffz here, people dont need to be scared of me, i wouldnt bring a gun to school or anything, i just want to be a great programmer and help kids at my school that want to do the same things as I. No one at school like the fact that they block any website, and we already ping them, the thing is it just takes to long.Erm isnt is illegal to even metion this on the site im notifying a admin , i dont really care what your intentions this is illegal topic closed........ if i really wanted to screw up the schools computers i would have by now, i have a freind that shut down the server in 7th gradeQuote from: Richenstony on July 09, 2007, 05:59:44 PM Quote from: gamerx365 on July 09, 2007, 05:43:12 PMi wouldn't say that's illegal, and i'm sure this fella's made his intentions clear, but misunderstood. i also wanted to further my knowledge regarding computers to get around some basic security systems at school, for an entirely different reason though, main one being: the techs there can be notified of what is possible with the school computer system and find a way to block it. i think the fact that this child wants to be feared is more childish than scary. if you wanted to be feared, you should have done things differently and gone along the path Bill Gates did. i'm sure nobody wants to mess with him, despite the fact that he's generous and has rather high moral standards, so maybe you should just word things differently when you try to ask for help or try to explain your case.okay but im not doing illegal stuffz here, people dont need to be scared of me, i wouldnt bring a gun to school or anything, i just want to be a great programmer and help kids at my school that want to do the same things as I. No one at school like the fact that they block any website, and we already ping them, the thing is it just takes to long.Erm isnt is illegal to even metion this on the site im notifying a admin , i dont really care what your intentions this is illegal topic closed........ whether it has been done or not, i don't think there is much of a reason to notify admin, but that's not up to me.That last part you kindly added to your lovely reply wasnt called for , i notifed the admins due to a security risk / illegal talk on this fourm , i dont think any talk like this should be tolerated in anyway , going through slight secuirty or hacking or incriping of any kind on a school computer isnt just illegal you can face a prison or a fine ..... not only is DUSTY looking out for this fourm im also looking out for this kid under the grounds of getting himself into trouble with the school / law ... if that is wrong i wont do it anymore i will just shut up and i wont speak from now on........tell me im taking this a bit to harsh well im sorry but thats just what i do , i cnt seem to understand this at all........... I cant do jack about this thread but i can sure has *censored* give my opinion on it ......... i dont think any of this guys intentions are ligit.......no offence to him i have nofing agasint you what so ever , but as a member of this fourm i have the right to EXPRESS my opinion on this matter. Case closed we both have the right to express our opinions and i completely support yours Tony don't misunderstand what i said though, read through your post carefully, it seems as if you were saying that the issue with the ping was illegal? i hate to tell you... but it's not. i've been helping my school for 3 years now with dealing with internet security issues and that just sso happened to be one of the issues that came up, it is not recommended or approved of, but most certainly isn't illegal or punishable by law. i think maybe his school should just have a logging monitoring system but apart from that, i think this kid should be warned that any mal-intent is childish and immature, and should be discarded along with false pride. good work though Tony you're gonna need to be a strict person if you're having a child soon well ya know lol got to look out for the kids I just dont think its right is all......but like i said its my opinion ..... can you please find something in writeing to say it aint illegal , i dont dis-belive you but a guy from my school back in the day did the same thing and he got into deep doo doo........ I didnt miss read your post i just didnt like it when you challanged my authority to notify the admins......incase your wondernin when you did that you said you wouldnt have done it personally but as i said i just dont like it when stuff like this floats around on here.... PEACE PEOPLE NO FLAME NO WAR WANTED....... not to challenge your views once again but: Quote from: reaper_tbs on July 09, 2007, 07:34:12 PM whether it has been done or not, i don't think there is much of a reason to notify admin, but that's not up to me.i didn't say i wouldn't personally have done it, in fact, i probably would have, just because it would have been done eventually anyway. but, alas, you are older than me so challenging your opinions only brings discontented THOUGHTS i'm sure hopefully admin will get here soon and relieve us both of the pain of constantly correcting each other i also don't believe it's right that some things are illegal and others not, and i really couldn't be bothered going to the trouble of finding out anything regarding legalities, as i have had enough with the police for one day >.< (refer to my post about the car... my poor baby..) too right about peace maan... have some peeeace...Topic Closed. |
|
| 6142. |
Solve : Stop Device? |
|
Answer» I have to CREATE a bunch of THUMB DRIVES. I have a batch file that will write the necessary data to the drives but then I would like to stop the drives so they can SAFELY be removed so I can start the next batch of drives. |
|
| 6143. |
Solve : HELP PLS.? |
|
Answer» i know this may sound super EASY to you guys.. but can ANYONE show me how to format the diskette on the floppy drive using batch commands... PLS. pls. pls... thanksI WISH you had chosen a better title! HELP PLS is about as BAD as it could be. "How to format a diskette in DOS" would have been so much better. |
|
| 6144. |
Solve : Trying to batch copy a file into Program Files folder? |
|
Answer» Hello all. First post so PLEASE be gentle with me LOL I can't seem to get around the Read only attribute of Progam files and it's sub folders. I have never heard of that before. Who told you that? Mine certainly is not read-only. How would programs ever get installed if that were true? Thats Amazing! A little pair of quotes was my problem after all. Many Many Thanks for helping me out. I didn't know that an existing directory had to be in quotes. Sorry but I am very much a learner. As for the read only attrib point; I am right in thinking that when you right click on a file ot folder and select properties, if the read only box is coloured in, that means the attributes are set to read only? Is that not right then? I thought that was my problem. Kind regards for helpjng me and I look forward to the next time I may need help. Thank you Jimmy Quote from: Jamangie on July 08, 2007, 06:03:36 AM I didn't know that an existing directory had to be in quotes. A directory or folder or file name only has to be in quotes if it contains one or more spaces. However it is a GOOD habit to always use them. Quote from: Jamangie on July 08, 2007, 06:03:36 AM As for the read only attrib point; I am right in thinking that when you right click on a file ot folder and select properties, if the read only box is coloured in, that means the attributes are set to read only? When you right click an ordinary folder (not a file) (not a system folder) in Windows Explorer, and look at the "Attributes" section at the bottom of the "property sheet" (as it is called) that appears, the "Read-only" box is filled with the highlight colour, in a pale shade. This happens whether or not the folder is read-only. If you click the check box, you can make it go clear, (not read only) or you can get a check (tick) to appear in it (read only). If you click "apply" or "OK", you would think that the folder would get its attribute changed accordingly. It doesn't. Right click the folder again, you see the colour. This is normal Windows behaviour for folders. It is by design. (That's the way Microsoft designed things). You can't change this. If you want to change a folder from read-only to read-write, or vice versa, you have to do it from the command line using the ATTRIB command attrib +R "folder path\folder name" to make it read-only attrib -R "folder path\folder name" to make it read-write. Explanation here http://support.microsoft.com/kb/326549 A Great Explanation. Many Thanks again. Speak soon Jimmy |
|
| 6145. |
Solve : IF NOT EXIST? |
|
Answer» okay so what if I wanted to make a code for a batch FILE that WOULD delete a certain folder or folders if a certain file doesnt exist. I have tried in a DOS command window and found the commands that work for this, but when i compile this into a batchfile code it does not works. This is what I have: IF NOT EXIST key.txt In batch language you cannot WRITE multiline IF statements like that. The whole statement MUST be on one line, either an actual line or an extended line. On one actual line... Quote IF NOT EXIST key.txt DEL test.txt Or on an extended line. A line is extended with an open-parentheses character "(" and the extension is finished with a close-parentheses character ")". Quote IF NOT EXIST key.txt ( This works at the command line too, in win2K and XP Quote c:\>( Note: These are parentheses ( ). These are "brackets" { }. |
|
| 6146. |
Solve : ping replay? |
|
Answer» How do I get my computer to only log the ip’s that reply’s in a ping. I’m having the batch ping series of a computers and if it replays I want it to out put it to a file, would this be a for COMMAND with | find/i "reply" do echo>> text.txt How do I get my computer to only log the ip’s that reply’s in a ping. I’m having the batch ping series of a computers and if it replays I want it to out put it to a file, would this be a for command with | find/i "reply" do echo>> text.txt i assume you have a list of ips to ping. So you would do a for loop over these ips, then use the ping command. eg for ip in list_of_ips: ping -n 1 ips > NUL if errorlevel is 0 then echo "ip is alive" just a SUGGESTION... so how would i do this i have a veriable set for the ip the VAR is ip1 so how would i make this workQuote so how would i do this i have a veriable set for the ip the var is ip1 so how would i make this work have not done batch for a while.guess might be something like this @echo off FOR /F %%i in (file_with_ip_list.txt) do ( ping -n 1 %%i > nul if %errorlevel% == 0 (echo %%i is alive >> output_file.log ) ) think you that worked or to be simplier. @echo off ping (where every you want)>>log.txt |
|
| 6147. |
Solve : Rename file each time batch file runs? |
|
Answer» I am currenlty using a simple batch file: What do you mean by counter?it's just basically a file that contains the count. by naming the files with a number, it should be more clean than having to maintain this counter file.This didn't work: Name your output file with some sequence. eg c:\pdm_webstat01.txtQuote from: lsblanchard on July 06, 2007, 10:01:08 AM This didn't work:show what you have done.isblanchard, you need to use batch arithmetic. study the /a switch of the SET command. try this : Code: [Select]@echo off for /L %%a in (0,1,9) do for /L %%b in (0,1,9) do ( if not exist "c:\pdm_webstat%%a%%b.txt" ( pdm_webstat.exe -d > c:\pdm_webstat%%a%%b.txt exit ) ) Quote from: Fen_Li on July 07, 2007, 02:00:23 PM try this :have you considered what happens every time this batch is run?@echo off REM Two examples of variable file name REM Output to file with date/time stamp. Will work for files that are greater than one minute apart REM Get date and time and set to a variable for /f "tokens=1,2 delims=: " %%a in ('time /t') do set t1=%%a%%b for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do set t1=%%c%%a%%b%t1% REM Write output with date/time stamp pdm_webstat.exe -d > c:\pdm_webstat%t1%.txt REM Output file with sequential numbering. REM Self seed from script and maintain sequence of multiple runs REM Sequence file pointer SET Sequence=C:\Sequence.cmd REM Get current sequence if it exists REM MUST use CALL IF exist %Sequence% call %Sequence% REM Seed the sequence if it was not found, start at zero! IF not Defined NumTimes SET /a NumTimes=0 REM Add one to the sequence. This is why started at zero. SET /a NumTimes+=1 REM Store the value in a file for next time ECHO SET NumTimes=%NumTimes%>%Sequence% REM Output a sequenced file pdm_webstat.exe -d > c:\pdm_webstat%NumTimes%.txt REM NOTE that this does not clean up old files or ROTATE files. |
|
| 6148. |
Solve : how to start internet? |
|
Answer» im trying to start firefox w/ command prompt but i cant |
|
| 6149. |
Solve : Connecting to a drive help? |
|
Answer» how do you connect to the cd/dvd drive from cmd, to copy some files for it... i need to make a batch file the atomaticly COPIES the files into a specifyed location.. |
|
| 6150. |
Solve : *Solved* Making a autoinstall batchfile? |
|
Answer» Hello everyone. |
|