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.
| 5051. |
Solve : Batch File Transfer over wireless network? |
|
Answer» Hi please excuse me if I am asking a redundant question. fso.CopyFile objLatestEvent.TargetInstance.Drive = Z:\\Images\\transfers\\ Any reason you changed .Name to .Drive? The equal symbol is invalid in this context. If the Z drive is mapped you don't need double backslashes (the double backslashes are unique to the query); the output location can be treated as a local drive: Code: [Select]fso.CopyFile objLatestEvent.TargetInstance.Name Z:\Images\transfers\ But you can use UNC notation for the output location if you prefer: \\computername\Z$\images\transfers Not knowing what I was doing I made those changes the script fails at line: 14 char: 57 error: expected end of statement code: 800A0401, vbscript compilation error. It seems to have a problem with the Z, but that is the mapped drive. The map name is Images so I removed that name from the path since the mapping put us into that folder, however it made no difference. I tried it also using the unc but I got a syntax error at char 58 I guess some days are better than others. This should fix you right up. Sorry for any confusion. Code: [Select]strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set fso = CreateObject("Scripting.FileSystemObject") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " _ & "Targetinstance ISA 'CIM_Datafile' and " _ & "TargetInstance.Drive = 'c:' And TargetInstance.Path= '\\Photos\\'") Do Set objLatestEvent = colMonitoredEvents.NextEvent() Select Case objLatestEvent.Path_.Class Case "__InstanceCreationEvent" fso.CopyFile objLatestEvent.TargetInstance.Drive, "Z:\\Images\\transfers\\" End Select Loop Save script with a vbs extension and run from the command line as wscript scriptname.vbs |
|
| 5052. |
Solve : Piping the command output to a variable?? |
|
Answer» Is there a way by which i can do a piping of command output to a variable instead of file? |
|
| 5053. |
Solve : How to count the number of line in TXT file using DOS?? |
|
Answer» Hi Everyone,
i DIDNT wrote this it was set /a count=!count!+1 |
|
| 5054. |
Solve : Ignoring the Ampersand (&) in a Command Line? |
|
Answer» I'm trying to do a |
|
| 5055. |
Solve : how do I include my password file into another batch script?? |
|
Answer» Hi, |
|
| 5056. |
Solve : Net Send Command and Messenger Service? |
|
Answer» Does ANYONE know if there is a way to limit incoming windows messages from just certain computers? I would like to use the service but I do not want the spam. |
|
| 5057. |
Solve : DOS Find Hex String? |
|
Answer» Hi, |
|
| 5058. |
Solve : task manager?? |
|
Answer» HOWDY, just wondering how to either disable taskmanager directly from a batch file, or just the ctrl, alt del buttons. Im a real NOOB so please not too much "hahaha u r 50 n07 1337 pwned lawl" thanks If this isn't possible, how would i convert a batchfile into an EXE that cant be closed?Why do you NEED to disable Task Manager and what the heck does all that textspeak mean ? ?Well heres one option try this: CODE: [Select]taskkill /f /im taskmgr.exe |
|
| 5059. |
Solve : cmd.exe in limiter user? |
|
Answer» Hi, If I log is as a limited user, the batch file continues past the reply.com with an error: I'm not sure exactly what you mean by "the batch file continues past the reply.com " Please show us the command line you are using to start reply.com. It may be that we can TWEAK that line a bit. Is reply.com a freeware, or shareware program? If so please list the link, (or the program) so we can have a look. Can you explain the errorlevel scheme? It may be possible that someone here could DUPLICATE the program's functions without the need of the additional program. Quote from: llmeyer1000 on June 08, 2008, 08:04:10 PM I am not familiar with the C:\Ducuments folder structure. "C:\Ducume~1\Frank\Locals!~1\Temp". Me neither. If it quacks like a duc..I run Windows XP SP2. I deleted all files from the that temp folder. I don't think we need to go into the batch file itself yet because I found another major problem showing the same error. If I try to just launch command.com (not cmd.exe) as a limited user from the start\run but it fails to complete the launch and gives the same error message as before. No batch file being launched yet. While the error window is shown, the temp folder is still empty. I would like to paste the picture of the window here (but don't know how to). Frank PS. Just noticed trying to launch edit.com causes the same error.Frank, I just googled your error: A temporary file needed for initialization could not be created or could not be written to. (I've never included that many search words before!) and WOW! You are not the first to have this problem. It appears that your temp folder may be marked read only and according to others who have experienced this problem, you will not be able to remove the attributes from the folder. (at least without some good old registry editing.) Some of the threads I found point you to a couple of microsoft sites, so the information is probably good. I didn't read through it all, so I suggest that you do some diligent research yourself, before making any of the changes suggested. Do the google search and read up, before proceeding. Here are a few links that SEEMED appropriate: (Remember, I have NOT had this problem and cannot guarantee any favorable results. Be careful!) http://www.pcreview.co.uk/forums/thread-94210.php http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q256614 http://support.microsoft.com/?kbid=326549 llmeyer1000, I did what those websites suggested. No change. It looks like I cannot launch any .com program. I tried the Guest account - the same. I created a new limited user account - the same. I think the problem is deep inside Windows and I think it's broken. A few weeks ago I had a major virus attack - a rootkit. I had to get rid of it because when I restored a full backup of drive C:, the virus was still there. I found it, removed it with ComboBox. Then restored the full backup again. It all appeared to work. Since I always worked on the machine as an Admin user, I now decided to create a limited user to run the machine to increase security regarding future viruses. Unfortunately, I now have this problem. Maybe my only solution is going to do a fresh install of Windows and start again. What do you think? FrankA clean install is always good!, but it does take some time. And you have to remember to backup everything! It is so easy to lose data that you forgot about. If you can't fix it, I don't see where you have a whole lot of choice. Is there more than one partition on the HD? If not, it wouldn't hurt to also wipe the first part of you drive, to make sure that no corrupted data is carried forword.The only reason for doing a clean new install, in my case, is because I am unable to get the batch file to work properly. If I could replace a couple of 16 bit .com applications with 32 bit apps, my batch file would work. I would not require to run any other 16 bit apps. This is batch file (menu.bat). It is copied as a skeleton from a book called Supercharging MS-Dos published in 1986: @echo off echo {ESC}[m prompt :START cls rem menu\nocurs.com %dr% type menu\menu1.txt echo Press the required function key on the keyboard: :GET_REPLY menu\reply.com rem echo got here if errorlevel 69 goto GET_REPLY if errorlevel 68 goto F10 if errorlevel 67 goto F9 if errorlevel 66 goto F8 if errorlevel 65 goto F7 if errorlevel 64 goto F6 if errorlevel 63 goto F5 if errorlevel 62 goto F4 if errorlevel 61 goto F3 if errorlevel 60 goto F2 if errorlevel 59 goto F1 goto GET_REPLY :F10 cls goto :END :F9 cls goto START :F8 cls goto START :F7 cls goto START :F6 cls goto START :F5 cls goto START :F4 cls goto START :F3 cls goto START :F2 echo F2 explorer.exe goto START :F1 echo F1 cmd.exe goto START :END %dr% remmenu\normcurs.com rem promptrs exit There are 3 .com files. These were created by dos debug by scripts. reply.com by reply.scr debug < reply.scr a 100 mov ah,8 int 21 cmp al,0 jnz 10a int 21 mov ah,4c int 21 r cx e n reply.com w q nocurs.com by nocurs.scr debug < nocurs.scr a 100 mov ah,1 mov ch,20 int 10 int 20 r cx 8 n nocurs.com w q And nocurs.com by nocurs.scr debug < nocurs.scr a 100 mov ah,0f int 10 cmp al,7 jz 10d mov cx,607 jmp 110 mov cx,0b0c mov ah,1 int 10 int 20 r cx 16 n normcurs.com w q The nocurs.com does not work running cmd.exe. It does work on the other machine using command.com in dosonly in the config.nt. The reply.com I think I found a solution to the batch file problem. Found a fine called choice.exe (choice.com doesn't work for the same reason that the other .com programs don't). I need to change the batch file a little around the if errorlevel lines since choice.exe returns with different codes. One of the command line switches for choice.exe is the /c:?. Where the ? are keys that choice.exe will accept. What do I enter for keys like F1 or F2? Thanks FrankChoice does not work with the function keys F1 to F12. Thank you very much. I will just have to use the 0-9 keys About not being able to run .com files, I might ask the Windows Forum. Frank |
|
| 5060. |
Solve : How to determine the Vista OS in bat?? |
|
Answer» I am able to DETERMINE the system OS by using ver command, but not for Windows Vista. (The Vista version is 6.0 whereas the XP version is 5.1.)Thanks mate. It SOLVES my PBM to an extent.Don't check for text such as "XP" or "Vista", check for the number. |
|
| 5061. |
Solve : MS DOS LANGUAGE? |
|
Answer» Can anyone see whats wrong with this code? when you enter 1 number and enter to get that program up ALL of the programs come up! why? forgott its in swedish but i hope you can help me anyway ! The code appears to be falling thru all your logic after you go to a label. Try putting a goto :eof in every one of your labels: Agreed. Otherwise the code will just execute each line after the label until it reaches the end. Quote I don't recall a Program directory on any version of Windows. You've never seen Swedish Windows, then, in which "C:\Program" is the name of the folder called "C:\Program Files" in English language versions. You may be interested to know that there quite a few countries in the world where English is not the main language. Many of them have their own-language-version of Windows or other OSs available. Quote You've never seen Swedish Windows, then, in which "C:\Program" is the name of the folder called "C:\Program Files" in English language versions. Roll Eyes It's true I've never seen the Swedish version of Windows, and I'm well aware that English is not used everywhere. What is puzzling is why Microsoft would not simply translate "Program Files" (two words) into the local language rather than use "Program" (one word). Shouldn't it be "program ARKIVERA?" (two words)? Quote from: Sidewinder on June 10, 2008, 02:07:35 PM Quoteoops , quoted all nbut you see understans where i did write QuoteShouldn't it be "program arkivera?"(two words)? There are other ways to fix this, but this needs the least explanation. So much for that idea. Code: [Select]@echo off cls color A title Arams Understod echo Skriv vilken siffra du vill ha och sen ENTER echo skriv 1 for att oppna Kalkylatorn echo skriv 2 for att oppna Paint echo skriv 3 for att oppna Internet Explorer echo skriv 4 for att oppna Utorrent echo skriv 5 for att oppna Mozilla Firefox echo skriv 6 for att oppna Windows Update echo skriv 7 for att oppna Msn Messenger (dock inte 7.5 och gammlare) echo skriv 8 for att oppna Anteckningar echo skriv 9 for att oppna Diskrensning echo skriv 10 for att oppna Windows Media Player echo skriv 11 for att oppna Skarmtangentbord echo skriv 12 for att oppna Skarmforstoraren (dra den lite nerat sa den blir storre) echo skriv 13 for att oppna wordpad echo skriv 14 for att logga ut denna anvandare echo GJORD AV : ARAM set /p var=Skriv vilken siffra du vill: IF '%VAR%' == '1' GOTO calc IF '%VAR%' == '2' GOTO paint IF '%VAR%' == '3' GOTO internet IF '%VAR%' == '4' GOTO utorrent IF '%VAR%' == '5' GOTO firefox IF '%VAR%' == '6' GOTO update IF '%VAR%' == '7' GOTO messenger IF '%VAR%' == '8' GOTO notepad IF '%VAR%' == '9' GOTO diskrensning IF '%VAR%' == '10' GOTO mediaplayer IF '%VAR%' == '11' GOTO skärm IF '%VAR%' == '12' GOTO hjälp IF '%VAR%' == '13' GOTO wordpad IF '%VAR%' == '14' logoff echo GJORD AV : ARAM EXIT :calc %SystemRoot%\system32\calc.exe goto :eof :paint %SystemRoot%\system32\mspaint.exe goto :eof :internet "C:\Program\Internet Explorer\iexplore.exe" goto :eof :utorrent "C:\Program\uTorrent\uTorrent.exe" goto :eof :firefox "C:\Program\Mozilla Firefox\firefox.exe" goto :eof :update %SystemRoot%\system32\wupdmgr.exe goto :eof :messenger "C:\Program\Windows Live\Messenger\msnmsgr.exe" goto :eof :notepad %SystemRoot%\system32\notepad.exe goto :eof :diskrensning %SystemRoot%\system32\cleanmgr.exe goto :eof :mediaplayer "C:\Program\Windows Media Player\wmplayer.exe" /prefetch:1 goto :eof :skärm %SystemRoot%\system32\osk.exe goto :eof :hjälp %SystemRoot%\system32\magnify.exe goto :eof :wordpad "C:\Program\Windows NT\Tillbehör\wordpad.exe" goto :eof This should fix any problems. You don't actually NEED a goto in the :wordpad label, but it may prove useful for future expansion. THANK YOU SO MUCH MATE! IM SO FKIN HAPPY RIGHT KNOW!!! |
|
| 5062. |
Solve : nested for loop and set command? |
|
Answer» Hello, |
|
| 5063. |
Solve : Artificial Intelligence Project? |
|
Answer» I built my basic AI but I am thinking up new THINGS to add to it. Like for example: |
|
| 5064. |
Solve : Rename folders?? |
|
Answer» is it possible to make a batch files that just remove a piece of the name? is it possible to make a batch files that just remove a piece of the name? This little snippet will remove the space on the right. You can modify it to remove the space on the left. Code: [Select]@echo on setlocal enabledelayedexpansion for /F "tokens=* delims=" %%x in ('dir /a:d /b') do ( SET input="%%x" set input=!input:cd =! ren "%%x" !input! ) Hope this helps. Quote from: Sidewinder on June 11, 2008, 03:12:20 AM Quoteis it possible to make a batch files that just remove a piece of the name? THANK You! it realy helped! +karma |
|
| 5065. |
Solve : Copy command not working? |
|
Answer» Everytime i put in the command to copy a folder it says its completed but i check the directory and still nothing. This is the script that im trying atm: Code: [Select]START %CURRDIR%\..\Backup.regWhen i do it like that it says it cannot find the file but when it has the "" it opens a cmd window and i dnt want that. is %currdir% set to some value? no, im trying to let it start the registry entry from inside its current directory. Its SUPPOSED to launch it from the folder E1 which would be in whatever directory the user copies it to.Please explain more fully. What is the purpose of the variable %currdir%? does it actually appear in the batch file? Why are you using it? What (and where) is the folder E1? Quote %CURRDIR%\..\Backup.reg Does this line actually appear in your batch? Just like that? Im not 100% sure what your asking for but ill try by best to explain. Im creating a cmd based installer to fix a problem with a printer for a few people and there is a registry key entry that they are missing which i have taken off my computer and put into the folder E1 and named it Backup.reg so if you extracted everything i gave you it would be Wherever you copied it to\Fix\E1\Backup.reg. Im trying to make it so that it will launch the registry entry from the folder during the installation process so im trying to use the START command which leads me to the problem i now have with getting it to work. Here is my full script so far, if theres a problem in it stopping it from launching let me know. Quote @echo off Nevermind i FIXED it, for some reason the command could not reach the file, probably because its a registry entry but i changed it to: Code: [Select]REGEDIT %CURRDIR%\..\Backup.regCode: [Select]%CURRDIR% What I am trying to find out is, why are you using this variable? It isn't a standard Windows thing. It exists on Linux/Unix systems though. What value is it supposed to have? Who told you to use it? Is this a batch file you copied from somewhere? Because if you wrote it yourself you would know what I am asking? Also, what are you expecting %0\..\ to be doing here? Code: [Select]IF EXIST "%0\..\E1.cab" I can see a few other things that need fixing, but if you could answer my questions above for now? I just started to learn cmd programming and im putting this together from basic things i remember so thats why im not 100% on what your asking. The script you see was written by me from scratch and with the help of this website http://www.ss64.com/index.html . As for "%0\..\" i placed it there under the influence that when cmd looks for the file it will search all directories (acting as something like a wildcard) until it finds the file. Im trying by best to explain because im new to this, and since you found some problems if you dont mind could you please point them out so i dont make the same mistake again. Edit* Also if this not too much, is there a way for this batch file to create a report and send it to my computer from someone elses?Well, these are the points that spring out at me, after you have fixed these it might be nearer to working @echo off color 04 REM Corrected spelling of 'soldiers' title Fallen Soldiers Release: Fix For Printer V.02 Echo .:,,,,,,,,,,,,, .,,,,,,,. Echo ;s # Echo ;; @ Echo ; : H [emailprotected]@ Echo ; : B [emailprotected]@ Echo ; : # [emailprotected]@ Echo ; : @ [emailprotected]@ Echo ; : @ [emailprotected]@ Echo ; : @ @ Echo ; : @ .:,,,;r Echo ; : @H2SiiSXX Echo ; ##: @ Echo ;r , ,,. ..,;@ Echo ;r S95SS5; [emailprotected]@ Echo ;; @ [emailprotected]@ Echo ;. @ [emailprotected]@ Echo ; # [emailprotected]@ Echo ;: @ [emailprotected]@ Echo ;r :@r Echo Fallen Soldiers Release: Fix For Printer V.02 echo. :BEGIN echo 1. Install echo 2. Uninstall echo 3. Exit :B2 set /p choice=What do you want to do? if "%choice%"=="1" goto Install if "%choice%"=="2" goto Uninstall REM Where is the :end label??? (I can't find it in your code) if "%choice%"=="3" goto End REM You don't need this, because if choice was not 1,2 or 3 you are going to wind up here anyway REM Also, you are testing for %choice% being a single space, which is a waste of time. if "%choice%"==" " goto False :False REM that was not how you spell 'correspond' and it should not have a capital C Echo That response does not correspond with a valid choice! goto :B2 : Install :I1 REM %0 is a special variable that means "the file name of this batch file" REM 2 dots .. means "the directory above this one" REM You need to specify properly where E1.cab is going to be IF EXIST "%0\..\E1.cab" (echo All Files Found. Press Enter To Continue...) ELSE goto CheckF IF EXIST "%0\..\E1" goto :I2 ELSE goto :I1 Pause Echo Running Extraction Process TASKKILL /F /IM explorer.exe REM see above EXPAND -r -F:* "%0\..\E1.cab" %TEMP% REM %temp% should really be "%temp%" REM Change "%CURRDIR%" to "%CD%" wherever it occurs Move %TEMP%\E1 "%CURRDIR%" :I2 Pause START %CURRDIR%\Backup.reg SET COPYCMD=/Y xcopy "%0\..\E1\system32" C:\test2 /v /y /e /i /c START C:\Windows\explorer goto :BEGIN :CheckF Echo File Checking has failed! Pause goto :BEGIN :Uninstall Echo Currently Uninstalling All Files... REM not sure why this is being done DEL /s /q "%0\..\E1" RD /s /q "%0\..\E1" RD /s /q "C:\test2" Pause goto :BEGIN Ok i made the changes and the uninstallation part is to let the batch file delete all the files it has extracted and placed on the computer. RD and DEL are there because when i run it on this computer it says "access is denied" even when it has been elevated to run as admin but i removed DEL and left RD now which removes everything including the folder. Is there a way for cmd to create a report and send it to my computer from the users? |
|
| 5066. |
Solve : HELP!!!!!!!!!? |
|
Answer» Quote from: rhoads on April 29, 2008, 08:17:42 AM last nite i got a call back from a friend of a friend lol, who i tried to contact to help out with this and he told me that i didnt need to use a for loop to do this.........that i could accomplish the same thing by using the set command..... I'd appreciate it if you post your friend of a friend's solution on here. no i just spoke to him on the phone....he lives in diff state and sort of explained what i had to do and that i was trying to FIGURE out the for command and he just told me that set command could just be used.......i ALMOST CRIED lol, j/k....but seriously i thought i had to use for and that is why i have been trying to figure this out for so long.Well, I am very surprised that your friend's friend thinks there is an easy way to get three items out of %1 just using SET, and I believe he is probably wrong. Without proof of his method then it is just something a guy told you on the phone. On the other hand, my batch file actually works. i dont KNOW, he has a bachelors in computer science....i dont know him that well but he sounded confident, lol........he said i could use set after i told him i could only use %1 and that i can only use 2 EVars (Fname and Lname) in the batch file.....im not sure lolHey, if your friend is right, we might all learn something (as much as I try to avoid that.. )LOL yes but UNFORTUNATELY like i said he is out of state and i will probably never know....i worked on this for a couple hours last nite to no avail....then again i am a newbie.....i set fname=%1 but then to get lname and dept to work i dont knowQuote from: rhoads on April 30, 2008, 06:38:14 AM i set fname=%1 but then to get lname and dept to work i dont know You said you were allowed only 2 "evars" (whatever they are, I presume you meant variables) and to get Fname, Lname and Dept you will need 3. Are you sure you have posted the assignment exactly as you were given it? I am sure, i rechecked my original post. I am thinking that obviously set is not the only command i need, i might not need for but just set i dont think will do it.....im losthave you got your assignment in writing? How do you know what it is you are supposed to be doing? Is it a work thing? A school thing? |
|
| 5067. |
Solve : How can i use AND or OR in IF condition?? |
|
Answer» hi ... |
|
| 5068. |
Solve : Help with .bat and IF / ELSE commands? |
|
Answer» Hey all notice I added "/i" this will make the if statement compare them as integers. No it won't; using if with the /i switch makes the comparison case-insensitive, or makes it ignore case if you prefer. Since numerical digits don't have "upper" or "lower" case, it will have no effect whatsoever. Quote I've also added the " " around the values we're comparing Good practice Quote and I stuck it on one line cos I reakon it's easier to read. Ditto This is an alternative Code: [Select]if "%variable%"=="1" (start test.bat) else goto test2 Quote from: Dias de verano on May 09, 2008, 10:50:00 AM Quote from: blastman on May 09, 2008, 08:30:06 AMnotice I added "/i" this will make the if statement compare them as integers. I may have miss understood the explaintion for the help option. "and the /I switch, if SPECIFIED, says to do case insensitive string compares. The /I switch can also be used on the string1==string2 form of IF." and the bit that confused me... "These comparisons are generic, in that if both string1 and string2 are both comprised of all numeric digits, then the stings are converted to numbers and a numeric comparison is performed" I guess I thought that last section was part of the explation of the /I switch. oh well. as long as it works eh??? Quote from: blastman on May 09, 2008, 01:41:19 PM the bit that confused me... That means decimal (or lesser base) integers (the only numbers that don't contain punctuation or letters) are compared as numbers, everything else as strings. (Numeric comparisons are made as if all the numbers were base ten, so comparing an octal and a decimal number would often give wrong results.) Thanks for the reply guys and it works |
|
| 5069. |
Solve : folder in the desktop? |
|
Answer» how to copy a file when my FOLDER is in the desktop?for example,i will create a folder in DOS cmd,then it will appear in the desktop,and i want to copy a file in my new create folder,what should i do?LIKE just about everything else the Desktop is contained in a folder. If you want to copy a file to your new desktop folder using Dos or the Command PROMPT you should use the Copy command e.g. |
|
| 5070. |
Solve : Batch command for renaming and moving file to other directory with suffix.? |
|
Answer» hi, |
|
| 5071. |
Solve : Delete a virus using .bat file. help!? |
|
Answer» Hi |
|
| 5072. |
Solve : Folder creation and numbering issue.? |
|
Answer» Hey all. To create as many folders as required, in this case student names - e.g.: John, Jake, Peter etc. Code: [Select]@echo off setlocal enabledelayedexpansion set count=0 set /p name=Skriv elev navn(e): for %%v in (%name%) do ( call set /a count=%%count%%+1 md %%v echo ^<!count!^> ^<%%v^> >> %%v\%%v.txt ) Enter all the names, each separated by a space, at the prompt. (ie. John Jake Peter) Quote @echo off Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('dir /b /a:d %1') do ( rd "%1\%%i" /s /q ) You might want to add a prompt for the directory name, rather than passing it along the command line. Good luck. Excellent. I've got it working now. So, the other query. Any way I can get a batch file to delete all folders in, for EXAMPLE, C:\data\project\blah - and leave the other files in that directory intact? All the methods I've tried, have either deleted the whole folder, or just deleted my files and left the directories alone. I would only need to keep two batch files in the root, everything else should go. The "Make folder" batch and the "delete all dirs" batch file. Thanks a bunch guys!Quote So, the other query. Any way I can get a batch file to delete all folders in, for example, C:\data\project\blah - and leave the other files in that directory intact? This was asked and answered in the previous post: Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('dir /b /a:d %1') do ( rd "%1\%%i" /s /q ) As mentioned previously, you may want to prompt for the directory name instead of passing it along the command line. Prompt for directory name? It should delete all folders in that directory, including their contents - without removing files in the root directory.. The two batch files, and whatever .txt files may be present. Quote @echo off In your original code you referenced the %1 variable which in most cases is defined as an argument on the command line. Quote Prompt for directory name?Yes, just like you did in the other batch file: Quote set /p name="Skriv elev navn(e): " If batch file is to run against the current directory, remove the reference to %1 Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('dir /b /a:d') do ( rd "%1\%%i" /s /q ) Oh my GOD! I love you! YOU ARE MY NEW BEST FRIEND! That piece of code works FLAWLESSLY.. I mean, WOW! |
|
| 5073. |
Solve : Hacking and Dos? |
|
Answer» Friends can u please suggest me some forums/websites regarding hacking and dos We aren't your "friends" here if you are a hacker. You won't get any help here, the only thing I think that needs to be said is.... goodbye! The ........File contains a bunch of definitions of the term ‘hacker’, most having to do with technical adeptness and a delight in solving problems and overcoming limits. If you want to know how to become a hacker, though, only two are really relevant. So if you want to become a hacker or a cracker first study programming techniques in depth. Good luckCouldn't of said that better *tears forming in eyes*Back in the 80s, we used to say that a hacker's computer was one with a built in ashtraythat PARAGRAPH moved me Quote Back in the 80s, we used to say that a hacker's computer was one with a built in ashtray It's probably not politically correct, but I have this vision of a PC smoking a Marlboro. Back In my Day Windows 1.0 was a MAD skittled Operating Systemn and It still is no one wants To Do All FLIPPITYJIBBITYJABBERYBUZZ! Crap of the Screen making It all Blocky and 3d Thats Dumb Microsofts used to be awesome...Quote from: Carbon Dudeoxide on April 02, 2008, 11:44:02 PM Couldn't of said that better *tears forming in eyes* I would cry... if i could. I sir, am a man!Quote from: NOT ADMIN :P on April 30, 2008, 08:31:46 PM Quote from: Carbon Dudeoxide on April 02, 2008, 11:44:02 PMCouldn't of said that better *tears forming in eyes* I'm not so I'm flooding with tears. P.S. Congratulations for being a man NOT ADMIN |
|
| 5074. |
Solve : MSDOS batch file - del wildcards? |
|
Answer» At our SCHOOL we want to be able to delete all the contents of the My Music, My Pictures and My Videos folders on the computers with a batch file. I know there's |
|
| 5075. |
Solve : How can I boot with floppy and get external usb cd to load xp? |
|
Answer» Hello external cd drive is recognised but gives cdr103 not high sierra. That is an MSCDEX message. CDR103 : Disc in drive is not High Sierra. All CD-ROM discs on a DOS or Windows-based system need to be in High Sierra or ISO 9660 format. The message could therefore mean that the disk is: * an audio disc. * a disc configured for an Apple Macintosh. * a damaged or bad disk. Try another disk and see if it is readable. This may help... http://www.bootdisk.com/usb.htm cd should be ok as its my xp disk, all give the same. Site looks good spoiler, thanks. Just going to try a few, I may be sometime.Spoiler is right in that you need to load drivers on your floppy to recognise the CDRom drive. Reason: Older computer bios's were not USB ready. First choice: Look for information that came with your USB drive, or from their website for instructions to create a bootable floppy with the cdrom drivers. Second choice: Use information from Spoiler's site to create a bootable floppy with drivers for your USB CDRom drive. That should get you to the point of recognizing the disk. But, ... I doubt that you will be able to use the CD in the USB drive to load XP normally. The reason you will probably have trouble is this: During setup, Windows need to reboot one or more times. When you reboot, it will be without the drivers on the floppy, thus no cdrom will be present. (Bad News! ) You will need to get the XP setup files on the HD and setup from there. Here is the way I would go: 1. Boot with floppy & CDRom drivers. 2. Copy I386 folder from CDRom to your hard drive. Command line: Code: [Select]xcopy /s /e /v D:\I386\*.* C:\I386\ (Assumes that cdrom is drive D: & that you have xcopy.exe on your floppy.) 3. Remove CDRom from drive. You won't need it again. 4. Run winnt.exe Command line: Code: [Select]C:\I386\WINNT.EXE /S:C:I386 /T:C:TEMPDRV5. Setup will proceed normally! The /S switch specifies the source location of the setup files. The /T switch specifies the location for the temp files during setup. If you want a complete list of the switches for winnt.exe that will explain the command line above, type C:\I386\WINNT.EXE /? Edited: Note: I added the switches /s /e /v to the xcopy command. (I forgot the first time.) It will take 20 minutes or so to copy the I386 folder & sub folder to the HD, but you will save most of that time during setup, which will go much faster than it does from the CDRom. Most interesting IImeyer2000, havent heard of winnt.exe before. It will probably be easier if I copy i386 directory from the cd to the dells hdd, but on another pc with a cd drive then return it and do as you recomend.Quote from: number7 on June 10, 2008, 04:18:48 AM Most interesting IImeyer2000, havent heard of winnt.exe before. It will probably be easier if I copy i386 directory from the cd to the dells hdd, but on another pc with a cd drive then return it and do as you recomend.That will work even better. Windows will copy the folder & sub-folder at least twice as fast. Don't feel bad about not KNOWING about winnt.exe. I suspect that a large majority are in the same boat. The only time you really need to know about this is when installing on an older computer. Note this quote: Quote A Win98 boot disk ... can be used to install these OS's. (Windows 2000 and XP)I found that quote on this site: Clean Install Windows XP I just ran across this, which I forgot to mention, on the same site: Quote smartdrv.exe must be added and loaded manually before running WINNT.EXEIf I remember correctly, You will get an error telling you to load smartdrv first if you try to run winnt without it. When you are done with the installation, you can delete the I386 folder if you need the space, but, if you don't, just leave it there. (It's like having the CD in the drive permanently) Edit: I just ran across another site that explains winnt.exe & lists a lot more switches than I was familiar with. I don't think you will need anything more than I what I posted before, (I have used the command line as posted a number of times, and it works very well as is.) but if you want to be informed, here it is: Installation of Windows XP PS: Divide my name by 2. Thanks.That seems to work fine. Setup started and said couldnt find smartdrv on the computer did I want to exit or continue. I did load smartdrv in the config.sys of the boot floppy. Its still loading so thats brilliant, thanks Im realy impressed after all these years. |
|
| 5076. |
Solve : C Drive space? |
|
Answer» Hi, CHKDSK command does not help me to do so It should. All the information you need is produced by chkdsk. Code: [Select]@echo off for /f "tokens=1-2" %%i in ('chkdsk c: ^| find /i "total disk space"') do (echo Total Space: %%i %%j) for /f "tokens=1-2" %%i in ('chkdsk c: ^| find /i "kb available on disk"') do (echo Free Space: %%i %%j) Be careful what you wish for. This batch solution eats up some clock time. hey thanks sidewinder.. Ok so u suggest VB RIGHT..but i have no prior knowledge of VB. I wanted to write a script that will connect to the sever os and check the c drive space on the server machine...will VB work there?If the server's C: drive is mapped to your system, the VBScript solution that was posted should work fine after changing the drive letter. If not, the FileSystemObject is available only for local drives. Instead you'd need to use the Windows Management Interface (WMI). Oh god these terms are Greek to me... you don't speak greek, doesn't mean you can't speak greek. Quote from: Sidewinder on April 30, 2008, 08:34:24 AM Code: [Select]@echo off Less time if you make chkdsk run once, REDIRECTING its output to a file, and do all the fancy FIND stuff on the file, a LOT more time if there are any errors on the disk that need fixing. PS He asked for used space as well df1.bat... Code: [Select]@echo off REM show available space free space and utilized space. REM informative message to user echo Running chkdsk c: (please wait) REM Redirect output to file REM Avoids running chkdsk 3 times chkdsk c: > chkdsk.txt echo Completed chkdsk. echo Displaying desired output echo 1. Total disk space: REM use FIND to show desired lines of text type chkdsk.txt | find "KB total disk space" echo 2. Available space: type chkdsk.txt | find "available on disk" | find /v "allocation" echo 3. Used disk space: type chkdsk.txt | find "files" | find "KB" Code: [Select]D:\>df1 Running chkdsk c: (please wait) Completed chkdsk. Displaying desired output 1. Total disk space: 26724095 KB total disk space. 2. Available space: 11980504 KB available on disk. 3. Used disk space: 14527556 KB in 106148 files. I'm posting this for all our Greek members: Code: [Select]On Error Resume Next Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 Const GroupDigits = -1 strComputer ="servername" 'Change to server name Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk Where DeviceID = 'C:'", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems WScript.Echo "Drive: " & objItem.DeviceID WScript.Echo "Size: " & FormatNumber(objItem.Size,0,,,GroupDigits) WScript.Echo "Used: " & FormatNumber(objItem.Size - objItem.FreeSpace,0,,,GroupDigits) WScript.echo "Free: " & FormatNumber(objItem.FreeSpace,0,,,GroupDigits) Next Remarkably, it's a trade off. Either batch code that looks like hieroglyphics from King Tut's tomb or VBScript that looks like Greek. Thank you everybody for your valuable inputs..I am soon going to learn to speak greek..yes and you are right " If i dont speak greek does not mean i can't!!" Sidewinder the code you provided me with is checking space on server side using WMI??? CheersQuote Sidewinder the code you provided me with is checking space on server side using WMI??? Yes, you'll need to replace servername in this line: strComputer ="servername" 'Change to server name To get the data from the local machine, replace servername with a dot (.) otherwise you can use the name of any computer on your network. KEEP the quotes. Most of the code in a WMI script is BOILERPLATE. The challenge is to find the class that contains the data you need. Good luck. Thank you so much.........just one question is it possible to create this script using Batch files?Quote from: sd on May 01, 2008, 11:11:46 AM Thank you so much.........just one question is it possible to create this script using Batch files? ghostdog74 doesn't "do" batch files. Even if that's what you asked for. Do try to keep up! Quote from: sd on May 01, 2008, 11:11:46 AM Thank you so much.........just one question is it possible to create this script using Batch files? Batch code is not designed for remote execution although there are third party programs like psexec in the PS-Tools toolkit that may help. On a network, it may be worth your time to investigate what VBScript or any of the other Windows script languages offer in the way of remote communications. In answer to your question, you could use a batch file to launch the VBScript. Good luck. PS. VBScript and JScript come free as part of Windows. Most of the others are free but need to be downloaded. |
|
| 5077. |
Solve : How to read properties from a property file using batch file vice versa?? |
|
Answer» Hello all |
|
| 5078. |
Solve : anyone help? |
|
Answer» i am trying to write a batch to delete the temp folder contents from path |
|
| 5079. |
Solve : only execute permission for a file? |
|
Answer» is there any way to give only EXECUTE permission(no read permission& no WRITE permission) to afile using DOS COMMAND prompt |
|
| 5080. |
Solve : Shortening.? |
|
Answer» Is their anyway to reduce the size of this code? Code: [Select]for /L %%N in (40,-1,1) do if exist data\level%%N.sas set level=%%Nmy code sets to the highest level. i swapped it around a few hours ago because it was reading the highest value last so if level2 was there it would read that last and set it to level2. i tried your code and it needs to be swapped around so it reads the lowest last not sure how, but mine works fine, just your shortened VERSION says level2 if level 2 and level 40 are there. when it should says level 40.Sorry, you are right. I was too hasty. This is what you need Code: [Select]for /L %%N in (1,1,40) do if exist data\level%%N.sas set level=%%N This starts at 1 and works up to 40, setting the level to the last (highest) numbered file found.Quote from: Dias de verano on June 07, 2008, 08:19:08 AM Sorry, you are right. I was too hasty. Thanks very much, even i am confused about the order now thanks again I read the title and thought this was about Crisco...Quote from: patio on June 07, 2008, 10:43:10 AM I read the title and thought this was about Crisco...Pardon? In English, "shortening" also means any fat or oil used in baking like BUTTER or lard. Crisco is a US brand of cooking fat. Quote from: Dias de verano on June 07, 2008, 11:46:33 AM In English, "shortening" also means any fat or oil used in baking like butter or lard. Crisco is a US brand of cooking fat.I'm English, and i did not know that, so thank you. |
|
| 5081. |
Solve : Batch file opening one autorun.exe after another?? |
|
Answer» Here is the file I am using. |
|
| 5082. |
Solve : Ansi characters in Wordpad? |
|
Answer» I would like to make a menu in a dos window. To do this I need to ENTER Ansi characters such as Alt-201 into an editor to save as a file. Then use the Type file.txt to display this file in the dos window. |
|
| 5083. |
Solve : Creation of GUID? |
|
Answer» How do I create a new GUID from .bat file? THANKS in advance.Do you mean Globally Unique Identifier? |
|
| 5084. |
Solve : Positioning the cursor in a batch file? |
|
Answer» I have read everything and tried every combination, I know you can do it because I've done it in the past! How do you execute (echo) the cursor position escape sequences? ANYONE??What is your OS? Back in the DOS days, you could load the ansi.sys driver and various escape clauses could be used for printer controls, cursor controls and colors in the shell. |
|
| 5085. |
Solve : String manipulation in a batch file? |
|
Answer» How do I manipulate a string from within a batch file? I need to know if a file_name entered in %1 has a dash (-) on it to change the course of processing Code: [Select]@echo off echo "%1" | find "-">nul && goto yes goto no :yes echo filename contains one or more DASHES goto NEXT :no echo filename does not contain any dashes :next Well done, SummerDays. I want to thank you both cuz I learned a lot today. What .bat_man said, tho it didn't really solve my problem, helped quite a lot, but you got to the point. Quote from: fermat73 on June 08, 2008, 02:17:58 PM Well done, SummerDays. You are the first person who said they understand my screen name! It's a song by Amaral. i didn't understand ur question correctly and thats bad for me put i am happy that u had something useful from my responce and what a good meaning Dias de verano |
|
| 5086. |
Solve : error in batch file1? |
|
Answer» If I put the following statement in the RUN of VISTA it works property. However, if I copy the data from the RUN window and put it into a batch file created in WordPad I get the errors shown and can't understand why. |
|
| 5087. |
Solve : Using batch script to check if a service is running? |
|
Answer» Finally, I found a forum for DOS. I hope you guys can help me. I've never taken any shot at batch script, so I hope you can help me with this simple task. |
|
| 5088. |
Solve : Fixing Enter Goes To Random Thing.? |
|
Answer» Okay, i have this menu: Strangely the pause doesn't work and it goes to somewhere random... Which version, mine or Carbon's? or both? That code works on my system. Wierd: if i type anything that isn't 1, 2, 3, 4, 5 or 6 such as lol or hehe it works. (AFTER THE ABOVE) if i THEN type nothing and press enter it works. BUT if i go straight there and enter nothing and press enter it goes random. very weird...Did you just COPY your previous post? Quote from: Carbon Dudeoxide on June 07, 2008, 09:27:55 AM Did you just copy your previous post?he quoted me, so he might not of seen that i changed the old post. so i posted again just to be sure. btw, www.sassurvival.co.nr I have a few suggestions: 1. Add this code at the beginning of the original code you posted. (This will allow you to return to the menu if an error is encountered.) Code: [Select]@echo off :Start 2. Add choice #7 Exit 3. Add this code before the set /p command in the original code you posted. (This will remove (or delete) the environment variable choice, if it exists.) Code: [Select]set choice= 4. You should test to see whether or not an entry was made, even if it was wrong. If no entry was made, you should set the variable "choice" at this time so that you can display the proper error to the operator. Add this code at the end of the original code you posted. The first line is true if you fail to enter anything at the set /p command Code: [Select]if '%choice%'=='' set choice=No Selection! echo. echo MENU ERROR&echo.&echo.&echo. echo You must make a VALID selection:&echo. echo "%choice%" is not valid!&echo.&echo.&echo. echo Valid selections are: 1 2 3 4 5 6 or 7.&echo.&echo. echo Type The Rank Of The Regiment You Wish To Join. echo Press Enter to continue.&echo.&echo. echo Press any key to return to the menu.&pause >nul cls&goto Start 5. Add this code at the end of the original code you posted. Code: [Select]:End exit 6. Add single quotation marks around the variables in the "if - goto" statements. I do not know the technical reason for this, but it is shown this way in the examples in the help on this site. They surely had a good reason for using the single quotes in the example. I do know this. When I try to remove them from a working test file, it starts to behave badly. I suggest that you use the quotes as shown. Note the single quotes in the example from the help page below: Code: [Select]if '%choice%'=='1' goto hello Microsoft DOS set command Dias, (If you are not too mad at me from another recent post), could you explain the reason for the eratic behavior without the use of the single quotes. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Finally, here is your code modified as I suggested, & working good! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Code: [Select]@echo off :Start cls&echo. echo Current Available Regiments: echo. echo Rank Name echo ------------------------------- echo 1 The Dogs echo ------------------------------- echo 2 British echo ------------------------------- echo 3 Revolution echo ------------------------------- echo 4 SWAT echo ------------------------------- echo 5 Americans echo ------------------------------- echo. 6 Smiths Unit (Default) echo ------------------------------- echo 7. Exit echo -------------------------------&echo. echo Type The Rank Of The Regiment You Wish To Join. echo (Valid selections are: 1 2 3 4 5 6 or 7 - Press Enter to continue.)&echo. set choice= set /p choice= [Regiment Rank]: cls if '%choice%'=='1' goto TheDogs if '%choice%'=='2' goto British if '%choice%'=='3' goto Revolution if '%choice%'=='4' goto SWAT if '%choice%'=='5' goto Americans if '%choice%'=='6' goto SmithsUnit if '%choice%'=='7' goto End :: The following line tests if no entry has been made. if '%choice%'=='' set choice=No Selection! echo. echo MENU ERROR&echo.&echo.&echo. echo You must make a valid selection:&echo. echo "%choice%" is not valid!&echo.&echo.&echo. echo Valid selections are: 1 2 3 4 5 6 or 7.&echo.&echo. echo Type The Rank Of The Regiment You Wish To Join. echo Press Enter to continue.&echo.&echo. echo Press any key to return to the menu.&pause >nul cls&goto Start :TheDogs echo.&echo TheDogs&echo. pause>nul&goto end :British echo.&echo British&echo. pause>nul&goto end :Revolution echo.&echo Revolution&echo. pause>nul&goto end :SWAT echo.&echo SWAT&echo. pause>nul&goto end :Americans echo.&echo Americans&echo. pause>nul&goto end :SmithsUnit echo.&echo SmithsUnit&echo. pause>nul&goto end :End exit Quote from: llmeyer1000 on June 08, 2008, 01:49:29 AM I have a few suggestions: Good. Already suggested. See posts above Quote 2. Add choice #7 Exit Good. Quote 3. Add this code before the set /p command in the original code you posted. Good. Quote 4. You should test to see whether or not an entry was made, even if it was wrong. Very good. Quote 5. Add this code at the end of the original code you posted. Good. Quote 6. Add single quotation marks around the variables in the "if - goto" statements. It is so you can accurately define what you are testing for. cmd.exe "expands" variables to their value at runtime. Pressing Enter at the set /p prompt results in an empty string, (i.e. "nothing"), and the only way to test for it is to use delimiter characters. if %choice% is empty, then... if %choice%==1 goto label expands to if ==1 goto label (causes an error) whereas, using quotes or other delimiters, it expands to if ""=="1" goto label (does not cause an error) You can use single quotes, double quotes (which is what I am used to), in fact any delimiting characters you like, except the usual suspects like <>^&. They must be the same both sides though. Double quotes have a special meaning in connection with filenames, so sometimes people prefer to avoid them, and in fact many people prefer to use what I call "SPIDER brackets" but I think in the US they are called "braces" - these characters { }. See here. If quotes are used, note that single on one side and double on the other side will not work as expected, (i.e. the test will give the "not the same" result), and mixing them before/after the variable doesn't work at all, and actually throws an error message Code: [Select]C:\>set test=egg C:\>if "%test%"=="egg" (echo yes) else (echo no) yes C:\>if '%test%'=='egg' (echo yes) else (echo no) yes C:\>if '%test%'=="egg" (echo yes) else (echo no) no C:\>if q%test%q==qeggq (echo yes) else (echo no) yes C:\>if a%test%b==aeggb (echo yes) else (echo no) yes C:\>if {%test%}=={egg} (echo yes) else (echo no) yes C:\>if "%test%'=="egg' (echo yes) else (echo no) (echo was unexpected at this time. Quote Dias, (If you are not too mad at me from another recent post), could you explain the reason for the eratic behavior without the use of the single quotes. I hope you are not too mad at me about the nanosecond thing!! I hope the above explains it. i will add this at a later date, thanksQuote from: Dias de verano on June 08, 2008, 02:51:50 AM Quote from: llmeyer1000 on June 08, 2008, 01:49:29 AMHow about the option to exit when you type 'exit.Quote2. Add choice #7 Exit if %choice%==exit goto :endQuote from: Carbon Dudeoxide on June 08, 2008, 06:05:06 AM if %choice%==exit goto :end did you read all of my post? if {%choice%}=={exit} goto :endUhh......It was too LONG Sorry man. |
|
| 5089. |
Solve : Making New Users Via .bat? |
|
Answer» HEY There I'm just wondering how do I Make users with a batch file also how to change PASSWORDS =] thank you =) |
|
| 5090. |
Solve : Dos Sort - ?Advanced¿? |
|
Answer» *JAW drops* |
|
| 5091. |
Solve : Error Log? |
|
Answer» Hi Everybody, |
|
| 5092. |
Solve : move file to email...? |
|
Answer» New here. Not too savvy with this area, but I was wondering if any ONE MIGHT know a SCRIPT to GET a file off of a floppy (raw text) and move it to an email FOLDER... eg |
|
| 5093. |
Solve : Opening a link? |
|
Answer» Can you open a LINK through a batch file? i'm assuming it would be something like this: Code: [Select]start C:\Documents and Settings\CE User\Start\Programs\Internet Explorer"Link Here" You're nearly there... Code: [Select]start "" "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://www.google.com 1. After the START you NEED a title string which can be blank 2. The path to IEXPLORE.EXE needs quote marks if it contains spaces 3. You have to actually include the name of IEXPLORE.EXE explicitly 4. Put a space before the url Thank you very much for your HELP Dias |
|
| 5094. |
Solve : how to combine multiple files?? |
|
Answer» i have multiple .flv files and i want to combine all these file to make a SINGLE .flv file You can convert the files to a .wmv/.avi file and then put them together in Windows Movie Maker. and how to convert to .wmv/.avi using DOS commonds?? i am using windows xp sp2this is not a simple matter of using "commonds". You need software. Google for an flv to avi converter and learn to use it. I use this one: http://www.nbxsoft.com/files/flvconverter.exe You can only use it once or twice before it locks itself and you can't use it anymore. |
|
| 5095. |
Solve : Converting all the lines of a text file into a variable.? |
|
Answer» I have created a text FILE by interrogating an ORACLE database using sql. |
|
| 5096. |
Solve : Disable cursor? |
|
Answer» XP Home SP.2 Just curious but why are you playing Where's Waldo with the cursor? It's just an appearance thing, I have brilliant blue background with BRIGHT white lettering and this darned cursor blinking, a real distraction. I've already looked at ANSI.SYS and a few others without success. Thanks for responding. I was playing around with something similar a while back. I never got it TOTALLY worked out but maybe you can tweak it in. The following opens the JPG in "Windows Picture and Fax Viewer" while the batch file waits in the background.(Picture with no cursor) The batch file waits until you close the viewer with the "X", and then continues. Code: [Select]START "" /wait /max "Test.jpg" If you get it working in full screen, PLEASE let me know. Thanks! Thanks llmeyer1000 - this leaves the batch script running but what I want is to have the message in the script displayed without the cursor. Even running something minimized doesn't seem to work. If the cursor is a window I could run it Hidden in CMDOW but I don't know what name it would be... Thanks again. |
|
| 5097. |
Solve : Download file?? |
|
Answer» Does anyone know how to download a file from the INTERNET to you pc with batch under winxp? E.G. If you have a tekstfile and you have the link, let the textfile appear on the desktop. As far as I know there is no standard function for that in the command line, but googling for it didn't help me either. Perhaps someone of you guys can help me?There is a well known command line program called wget. There is a well known command line program called wget. But that ain't for WINDOWS, is it. From the install notes from wget: Quote To build Wget, your system must support a Unix-like command-lineBlackberry, there is a tradition among some Linux users to compile software from source code. You have quoted from the compile instructions for wget. Wget is a C program that can be compiled for various platforms, such as Linux, Mac OS X, Solaris, OpenVMS (!!!) and 32 bit Windows. Unix-like development tools are necessary to compile it from source code, but why do that? Most people get their win32 software of all kinds ready compiled. Wget compiled for Win32 is extremely available. e.g. here http://users.ugent.be/~bpuype/wget/ Quote from: Dias de verano on May 02, 2008, 10:09:44 AM Blackberry, there is a tradition among some Linux users to compile software from source code. You have quoted from the compile instructions for wget. Wget is a C program that can be compiled for various platforms, such as Linux, Mac OS X, Solaris, OpenVMS (!!!) and 32 bit Windows. Unix-like development tools are necessary to compile it from source code, but why do that? Most people get their win32 software of all kinds ready compiled. Wget compiled for Win32 is extremely available. My bad. Thanks for the link Like it says on that page, get a version later than 1.8.2, I have been using 1.9.1 for some while now, and I have no complaints. I hope you find it useful. I do. |
|
| 5098. |
Solve : how to change color prmanently?? |
|
Answer» I have tried using color command to change the text color of dos shell but when i close the session it resets to default white color. would anyone suggest how to change text color parmanently? thanks in advanceUsing the gui, click on the little dos box in the top left corner and change the default values. If you WANT to AUTOMATE this, dump a copy of the registry before and after, a DIFFERENCE will tell you which keys need changing, you could export those explicitly and LOAD them up on multiple machines Graham ok...after opening windows registry where to navigate?? i dont know the setting for dos in windows registry regards sanRight click the the top left of the Command prompt window and select defaults.dude!! i have done that already now i want to know how this setting make chages in window registry as gpl said. but i dont know where to navigate after opening registry editor? i am using windows xp sp2please someone help me out i am using windows xp sp2 regards sanok to change the color permantely, open command prompt, right click on the title bar, and select properties, then hit the colors tab on the properties window and there are your color settings.Maybe what is not clear from the above is that changing the colours ("colors" for N. Americans) by setting them in the Properties dialog of the command windows, does in fact change the registry. Provided you select "Save properties for future windows with this name" on exit. so im right???Quote from: macdad- on May 13, 2008, 02:21:18 PM so im right??? You're right that to change the colours permanently, you can access the command window properties. I would add that before clicking OK, you have to select the radio button for "Save properties for future windows with same title", if you want the settings to persist and be saved in the registry. The above is the easy way. Below is another way to achieve exactly the same thing. The value DefaultColor controls the foreground and background colours used in command prompt windows. It has a default value of 0, for standard white text on a black background. You can replace this value with a two-digit hexadecimal number, in which the first digit selects a background colour and the second a foreground colour. The hexadecimal codes are: Hexadecimal value Colour 0 Black 1 Blue 2 Green 3 Aqua 4 Red 5 Purple 6 Yellow 7 White 8 Grey ("gray" to Americans) 9 Light Blue A Light Green B Light Aqua C Light Red D Light Purple E Light Yellow F Bright White A value of F0, for example, would give black text on a white background, and 1E would yield yellow text on a blue background. The change should take effect the next time you open a console window. Registry Settings: User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor] Value Name: DefaultColor Data Type: REG_DWORD (DWORD Value) Value Data: (0 = default) ok, i wuz kinda nervous that san would try to grab my neck. (not really an lol)Quote from: Dias de verano on May 13, 2008, 03:25:32 PM
i have changed color parmanently as u stated using windows gui but your claim, that this change will be shown in system registry, has not been verified rather its still having default valueslook san, if it works...it works there is no need for extra work, the registry key that changes may be hidden from user view, so just accept it as it is. |
|
| 5099. |
Solve : how to check a text file if it is empty or not by using batch command?? |
|
Answer» hello |
|
| 5100. |
Solve : removing reg keys? |
|
Answer» hey guys, Search all subkeys below HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Delete any associated subkeys that reference: "Symantec Endpoint Protection". how can I achieve this?If you know the specific keys you want to delete: Quote To delete a specific registry key from the registry: After you get your *.reg file set up, you can start the reg file from a batch file, or simply run the reg file. You do know that you only need to edit the keys in the branches: [HKEY_CURRENT_USER] & [HKEY_LOCAL_MACHINE] The rest are mirrors and will be updated as well. The easiest way (that I know of) to create the reg file is to search for the keys, then export the keys to a file (or files.) and then edit the file (or files). You can combine the data from several different exports into one reg file, for easier handling. RegSeeker: http://www.snapfiles.com/get/regseeker.htmlvbscript. Not tested. (always do backups of registry before meddling with it) Code: [Select] 'Step 1: Stop Symantec Services. strComputer = "." Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service") For Each objService in colListOfServices If objService.Caption = "Symantec Endpoint Protection" Or _ objService.Caption = "Symantec Event Manager" Or _ objService.Caption = "Symantec Network Access Control" Or _ objService.Caption = "Symantec Settings Manager" Or _ objService.Caption = "Windows Installer" Or _ Then WScript.Echo objService.Caption objService.StopService() objService.StartMode="Disabled" End If Next 'Step 2 : End task ccApp.exe Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'ccApp.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next ' Step 3 point 4-7,9,14-15: Delete registry keys ' Not including those optional ones Const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") strRegKeysFile = "regkeystest.txt" Set objFile = objFSO.OpenTextFile(strRegKeysFile) key = "HKEY_LOCAL_MACHINE\" Do Until objFile.AtEndOfLine strKeyPath = Replace(objFile.ReadLine,key,"") WScript.Echo "Deleting " & strKeyPath oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath Loop ' Step 3 - point 8 strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" DeleteSubkeys HKEY_LOCAL_MACHINE, strKeyPath Sub DeleteSubkeys(HKEY_LOCAL_MACHINE, strKeyPath) oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys If IsArray(arrSubkeys) Then For Each strSubkey In arrSubkeys If InStr("Symantec Endpoint Protection",strSubkey) > 0 Then WScript.Echo HKEY_LOCAL_MACHINE, strKeyPath & "\" & strSubkey 'oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath 'Uncomment to use End If DeleteSubkeys HKEY_LOCAL_MACHINE, strKeyPath & "\" & strSubkey Next End If End Sub 'Steps 3: point 10-13 not done as I don't have testing environment for that. 'Step 4: restart computer. WScript.Echo "Wanna restart computer ? (y|n)" 'probably want to use InputBox instead Set StdIn = WScript.StdIn strChoice = StdIn.Read(1) If strChoice = "Y" Or strChoice = "y" then Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems objOperatingSystem.Reboot() Next End If 'Step 5: Do it manually 'Step 6: Do point 5 and 6 yourself. strFolder = "c:\Documents and Settings\All Users\Application Data\Symantec\" strFolder1 = "C:\Documents and Settings\All Users\Start Menu\Programs" strFolder2 = "C:\Program Files\Symantec and delete the Symantec Endpoint Protection" strF1 = strFolder & "SavSubEng" strF2 = strFolder & "SPBBC" strF3 = strFolder & "SyKnAppS" strF4 = strFolder & "Symantec AntiVirus Corporate Edition" strF5 = strFolder & "SRTSP" DeleteFolder strF1 DeleteFolder strF2 DeleteFolder strF3 DeleteFolder strF4 DeleteFolder strF5 Sub DeleteFolder(strPath) For Each objFile In objFSO.GetFolder(strPath).Files objFile.Delete Next For Each objFolder In objFSO.GetFolder(strPath).SubFolders If objFolder.Name <> "SrtETmp" Then DeleteFolder(strPath) End If Next objFSO.DeleteFolder(strPath) End Sub [recovering space - attachment deleted by admin]Cheers for all the replys guy's. I managed to get script written by the pervious owners IT dept that removed it for me. Sadly, the PC's have celeron processer's so it takes about 2 hours!! but it gets the job done. Cheers again for your helpIs the working script too LONG to post? I'd like to see it after all. It's in servarl parts and is very long, I'll slap it on rapid share if you like. Sadly I don't have it here (at home) and it'll have to wait till tuesday when I'm back in the office. |
|