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.
| 4501. |
Solve : Batch File Need Help? |
|
Answer» I have create this batch file: this is forum ... so i'm please to get the info or clue from all of you here. Dont get me wrong. But im still hope to find the solution from the expert outhere. Can expert help me? Expert already did. Read the posts.Have you gone to Command PROMPT and typed 'dir /?' yet?yup i already done dir /? Quote from: myusri on March 12, 2009, 10:02:56 PM yup i already done dir /? And what did you LEARN? |
|
| 4502. |
Solve : Invalid Directory? |
|
Answer» Working on a Vista machine that won't boot. It just goes to the repair and eventually indicates that it cannot perform a repair. This PC came w/ Vista installed and no disc, and the owner never created any CDs for installation or setup. try the Move command: Thanks Nick, but it doesn't. Move is NOT an internal DOS command. When I use it I get 'The command is not recognized. Type HELP....blah, blah, blah' Quote from: squall_01 on March 11, 2009, 11:48:45 AM i think copy would be best here. but then again I'm probably wrong. Gee, I've already used COPY to move stuff to the flash drive. I just was hoping for a way to enable wilcards, so I could type 'copy c:\BEHAVE*\*.* e:'Quote from: macdad- on March 11, 2009, 11:51:02 AM just have to wait what he says I don't know what this (partial) sentence means... Quote from: macdad- on March 11, 2009, 11:51:02 AM and besides Move is an internal command so it should work... MOVE is not an internal DOS command.Sounds like it's not the DOS prompt that the OP is in (not possible with an XP disk anyway) but the XP recovery console. This uses a limited set of commands, and, as has been noticed, does not support wildcards. I don't know where this came from, it's not part of XP command prompt anyway. Quote I used the SET command to AllowWildCards = TRUE, but it has no effect on copying files. Quote from: Dias de VERANO on March 11, 2009, 03:20:20 PM I don't know where this came from, it's not part of XP command prompt anyway. When I'm at a command prompt I can type HELP for a list of valid DOS commands. Set is one of them. If I type SET wihout any PARAMETERS, then it shows me various items that have been set. It originally showed SET AllowWildCards = FALSE. and I typed in SET AllowWildCards = TRUE. If I type in SET w/ no parameters it shows that SET AllowWildCards is EQUAL to True. But it makes no difference. I still cannot use * or ?... Delete.Quote from: boweasel on March 11, 2009, 04:19:08 PM When I'm at a command prompt I can type HELP for a list of valid DOS commands. Set is one of them. If I type SET wihout any parameters, then it shows me various items that have been set. It originally showed SET AllowWildCards = FALSE. and I typed in SET AllowWildCards = TRUE. If I type in SET w/ no parameters it shows that SET AllowWildCards is equal to True. But it makes no difference. I still cannot use * or ?... Like I already said, you are not at a regular command prompt. You are in the "Recovery Console". Compared to the normal command prompt, the Recovery Console is very limited. It only uses certain commands, and they don't all accept wildcards when AllowWildCards is set to TRUE. Copy is one such. http://support.microsoft.com/kb/314058 As you can see, the Recovery Console has very limited capabilities for copying files, mostly intended to manually restore a good copy of a system file to the Windows directory. Instead, think about booting your PC by something other than XP. A good choice would be a KNOPPIX "live" CD, which is a free download as an ISO image. It is a large download, about 700 Meg for the CD and a few Gig for the DVD. The difference is that the DVD has more applications. The CD will suffice for rescuing data. KNOPPIX is a flavor of LINUX, with very good intrinsic support for much hardware, in fact, better than XP itself. "live" means that it runs from CD without installing on the hard drive. KNOPPIX has a windows-like file manager, supports USB and firewire, and version 5 can write to disks formatted as FAT32 or NTFS, among others. Quote from: BatchRocks on March 11, 2009, 04:36:11 PM Code: [Select]move C:\<blah> E:\<whateverdrive> Ignore this. No MOVE command in Recovery Console.Sorry.Quote from: BatchRocks on March 11, 2009, 04:42:29 PM Sorry. Never mind. At least you were trying to help. A better recovery console would be a great idea, but sadly we have to turn to other solutions. |
|
| 4503. |
Solve : start a certain folder? |
|
Answer» ok what i need now is to start every batch file in a pacific folder then move them to a differnt folder. the starting folder name is start the second one is done. this is for a network drive just so i can exucute commands i DONT need the results(last part i need)Code: [SELECT]CALL <batchfilename>.bat |
|
| 4504. |
Solve : Batch file: getting only the last 2 digits of the year? |
|
Answer» Like in: for /f "tokens=1-4 delims=/ " %%d in ("%date%") do @echo %%f%%e%%d I think they want DD/MM/YY Hey! I've GOT this radical new idea! Let's have a look at the thread title and the original post! Thread title Quote getting only the last 2 digits of the year Original post Quote I want only the 09 out of 2009Wow! that is radical!Radical or not it seems to me to be a better assumption that, based on the OP's script, the OP wants to return the date in either ddmmyy or mmddyy format. Quote from: Woodman on March 11, 2009, 04:24:15 PM Radical or not it seems to me to be a better assumption that, based on the OP's script, the OP wants to return the date in either ddmmyy or mmddyy format. You may be right, I think I had the sarcsam dial turned to 10 or 11. It's going to be 09 for about... Another like 280 days. Echo '09' Heck, I won't keep a batch file for a date for 1 year. Works for me.He's right. This must be for some other reason !Iunno if it works Code: [Select]if %date%==*/*/2009 echo 09 IDK if it does.It doesn't work. It gives me the statement after if and says this wasn't expected. It appears that you are trying to abuse the use of wild cards. They can not always be used in such a manner.Or even: if %date:~-4% gtr 2008 if %date:~-4% LSS 2010 echo %date:~-2% Someone will put us out of our misery shortly...(code deleted) since some people(s) might get offended if code create a .com executable. please accept my apology for any inconvenience caused. |
|
| 4505. |
Solve : use PCMCIA card in DOS? |
|
Answer» I have an "elderly" notebook computer that does not have a built-in ethernet port. I'm using a TrendNet cardbus PCMCIA card instead. Works fine in Windows, but I'm trying to get it to load in DOS, with no luck so far. Not even lights on the card. I'm not sure but I don't think PCMCIA cards/drivers will work in a PC-Card slot- one would need PC-Card Bus drivers, and I doubt those are available for MS-DOS. Alright, now I'm more confused. You gave me tips on how to do this, but now say you don't think it can be done? PCMCIA cards/drivers and PC-Card cards/drivers are one and the same: PCMCIA is the association that defines standards for PC-Cards/slots. This must be able to work...you started saying you had an elderly laptop which now turns out to be a newer model. the newer models use PC-card. PC-Card can use PCMCIA cards. However- a PC-card bus needs a driver. a PCMCIA driver probably won't work. and DOS-based PC-card drivers likely don't exist for that particular laptop, if at all. they aren't the same; although my use of terms wasn't quite accurate. Major Features No matter which type of laptop you have, you can be sure that it has a somewhat standard set of components. Later in this book we will discuss these components in more detail. Processors There has always been a range of processors available for laptops, but one rule has almost always applied: The fastest laptop is almost never as fast as the fastest desktop. The problem is one of power. Fast desktop processors run on AC power, of which there is a relatively limitless supply available. Portables in most cases at least occasionally must run on batteries, which have to be small enough so that the laptop can be lifted. Portable systems are also smaller than most desktops, and the tighter confines mean that the ability to run a high heat-producing processor is more limited. Therefore, a mobile processor in general has a more limited amount of electrical power available. Intel has responded to the needs of mobile systems by offering low-power "M" versions of its most popular processors. Figure 2.1 shows the Pentium 4-M chip, the mobile version of the Pentium 4. These processors are generally similar to the desktop versions except they use lower voltages internally and can adjust their clock speeds depending on the user's requirements. By lowering their voltages and clock speeds, these chips can cut their power requirements and thus extend a notebook's battery endurance. Note also that the maximum clock speeds of these chips are almost always slower than those of desktop chips. Figure 2.1. The Pentium 4 Processor-M chip from Intel. (Photo courtesy of www.intel.com.) Table 2.3 shows a comparison of the clock speeds of various mobile processors from Intel. Table 2.3. Clock Speeds (in GHz) Available for Intel's Mobile Processor Chips Intel Mobile Processor Clock Speeds (GHz) Pentium M 1.0 to 2.26 Mobile Pentium 4 1.4 to 3.46 Celeron M 0.8 to 1.5 Mobile Celeron 0.65 to 2.8 In March of 2003, Intel introduced its Pentium M chip for laptops, a part of its Centrino platform. The Celeron M followed as a low-cost version of the Pentium M. Unlike previous mobile processors from Intel, these chips are not a variation on a desktop chip, but a Pentium-compatible processor built from the ground up for mobile applications. Intel claims that laptop designers can achieve 1040% longer battery endurance if they use this chip. In addition to the chips' energy conservation, Intel also claims that the Pentium M and Celeron M are faster than they may appear. Because they use a different internal architecture, they are able to squeeze out more effective work during each clock CYCLE. As a result, you cannot directly compare the clock speeds of Pentium M/Celeron M and other mobile Pentium chips. For example, Intel claims that a typical laptop running a 1.6GHz Pentium M chip will race through benchmark programs 15% faster than a Pentium 4-M running at 2.4GHz. Intel also claims that this same laptop's batteries last 78% longer on the Pentium M than on the Pentium 4-M. Another processor specifically designed for portable applications is the Efficeon chip from Transmeta. This chip promises very low power consumption but at the expense of processing speed. The Efficeon has a different instruction set than Intel Pentium processors, requiring it to perform extra steps to translate the Pentium instructions into a form that the Efficeon can understand. Thus, although the Efficeon may have clock speeds comparable to Pentium M chips, its performance is considerably slower. Unfortunately, Transmeta has yet to capture much of the market and is concentrating more on licensing its power-saving technology rather than selling processors. Some laptop manufacturers occasionally opt for the highest performance possible by using desktop processors. As can be expected, these power-hungry chips result in surprisingly short battery endurance. Note, however, that this quest for desktop performance is never completely successful. Overall system performance depends not merely on the processor but on several other components, and as a result these devices have yet to equal the performance of the fastest desktops. You can find more information on mobile processors in Chapter 4. Video Display Size and Resolution Ever since the days of the luggables in the early 1980s, the design of portable computers has been highly dependent on the latest lightweight displays. When low-power LCDs became available, the development of the battery-powered laptop finally became possible. Today, the size of the display is the single most important determinant of the size of the laptop. Currently, virtually all laptops use active-matrix color displays. These screens provide needle-sharp images of high contrast, in most cases better than the CRT displays that most desktops use. Indeed, many desktop users are now upgrading to flat panels. The prime impetus for this switch may be to save space, but the improved image quality is at least a partial factor. There are, however, a few drawbacks to LCD displays. The first is that they have a fixed or native resolution. CRT displays can easily switch to higher or lower resolutions. When LCDs are moved above or below their native resolution, however, the image becomes decidedly blurry or even distorted. The second drawback of LCDs is their limited field of view. These displays may present high-quality images, but only to viewers sitting directly in front of the screen. People who may be sitting a few feet to the right or left of that optimal position may see an image where the colors have been shifted and the contrast lowered. With the increasing popularity of LCD televisions, some LCD manufacturers are developing screens that are more suitable for wide-angle viewing. If you plan to use your laptop for informal presentations, you should take a look at laptops that advertise wide-angle capability. Of course, some people prefer a more limited viewing angle because it makes it harder for other people to read your screen when you are working in public. One other downside of LCD screens is that they are considerably more expensive than CRTs. The good news here, however, is that the prices of LCDs have continually dropped over the years and will continue to do so. Indeed, the popularity of desktop LCD displays should lead to increased volumes and lower prices for both desktops and laptops. Because the technologies used in today's LCDs are basically similar, the main differences among screens have to do with their sizes, their resolutions, and their aspect ratios. Chapter 11, "Graphics and Sound," includes more detailed information on displays. Screen Size Size is, of course, the most visually apparent property of an LCD screen. In general, as time progressed, screens became continually larger. There is, however, a size limit for laptops. As LCD screen sizes moved beyond 17 inches, measured diagonally, they became too large to be portable and were relegated to desktop use. In today's laptops, screen sizes vary from 7.2 inches (measured diagonally) for the smallest systems to 17 inches for the largest. The most common size is now 14.1 inches, which represents a good compromise between size and portability. In general, users are well advised to get the largest screen they can comfortably carry and afford. But note that for some screen sizes, there may be a choice of several different resolutions available. Choosing the wrong resolution may make the screen harder to read, or limit the amount of information that can be displayed. Screen Resolution The resolution of a screen depends somewhat on its size. As the size of the screen increases, it can comfortably accommodate more pixels, thus allowing for increased resolution. For 14.1-inch screensthe most common varietymost laptop manufacturers offer two choices of resolution: XGA and SXGA+. A few vendors also offer SXGA, but the unique aspect ratio (5:4) makes that size and resolution somewhat rare. The increased resolution of SXGA+ over standard XGA enables users to display nearly 87% more onscreen information such as folders, documents, web pages, and so on, at the same time. Increased resolution also increases pixel density (the number of pixels per inch of screen size), which in turn increases the apparent sharpness of photographs and graphic images. Some people even maintain that increased pixel density increases the readability of text. On the downside, however, increased resolution also decreases the size of standard text and icons on the screen. As personal preference varies, users should personally examine several different size/resolution combinations to see which seems best to them. Note that once you have chosen a resolution, it cannot be changed. A laptop's video circuitry can simulate a change in resolution, but the resulting image will be much less sharp than the image at the screen's original or native resolution. Table 2.4 lists common LCD screen sizes and the resolution they support. Table 2.4. Screen Size and Resolution: A Sampling of the Most Common Combinations Available for Laptops Screen Size (in.) Resolution Type Resolution Aspect Ratio Pixel Density (Pixels/in.) 12.1 SVGA 800x600 4:3 83 12.1 XGA 1024x768 4:3 106 13.3 XGA 1024x768 4:3 96 14.1 XGA 1024x768 4:3 91 14.1 SXGA 1280x1024 5:4 116 14.1 SXGA+ 1400x1050 4:3 124 15.0 XGA 1024x768 4:3 85 15.0 WXGA 1280x800 8:5 101 15.0 SXGA+ 1400x1050 4:3 117 15.0 UXGA 1600x1200 4:3 133 15.4 WXGA 1280x800 8:5 98 15.4 SXGA 1280x1024 4:3 106 15.4 WSXGA+ 1680x1050 8:5 129 15.4 WUXGA 1920x1200 8:5 147 17.0 WXGA+ 1440x900 8:5 100 17.0 UXGA 1600x1200 4:3 118 17.0 WUXGA 1920x1200 8:5 133 Screen Aspect Ratio The aspect ratio for most laptop displays is the same as that for desktops and televisions: 4:3 (that is, the height of the screen is 3/4 the width). In the distant past, some laptops, such as the IBM PC Convertible and the Toshiba T1000, used wider display screens because that was all that was available. When 4:3 LCD screens came out, the public quickly gravitated toward this standard shape. Now, however, with the popularity of DVDs and high-definition TV, many manufacturers are installing widescreen displays on their systems (see Figure 2.2). These displays have a wider aspect ratio of 8:5 (16:10). Note that although this is much wider than the standard computer display, it is not quite as wide as the 16:9 proportions of HDTV, but is able to accommodate a full 16:9 HDTV picture within a 16:10 display with only a small upper and/or lower border (often used by the DVD player controls). Widescreen laptops are usually sold as multimedia or desktop replacement systems, due to their larger (and clumsier to carry) sizes. As more people use their laptops in home entertainment systems or as personal DVD players, expect this number to grow. Figure 2.2. The Dell Inspiron XPS Gen 2, with its 17-inch WUXGA display. (Photo courtesy of Dell Inc.) [View full size image] One interesting thing to note is that having a widescreen display doesn't necessarily mean you get more resolution or desktop screen real estate. For example, many so-called "widescreen" laptops have 15.4-inch WXGA (1280x800) displays. Personally, I would rather have a standard aspect ratio 15.1-inch SXGA+ (1400x1050) display because even though it doesn't have the "widescreen" aspect ratio, it actually offers an overall wider and deeper image in pixels than the so-called widescreen display. At the higher 1400x1050 pixel resolution, you'll actually be able to fit more open windows (web pages, applications, and so on) both in width and depth than you could on a WXGA screen. In fact, the SXGA+ screen has nearly 44% more overall resolution, MEANING you can fit that much more content on the screen. The primary advantage of using a widescreen on a laptop is that human vision sees more peripherally than vertically, making wider screens better suited to what you actually see on them. Video Accelerators A crucial and sometimes overlooked aspect of computer performance is the speed of its video accelerator. This chip, shown in Figure 2.3, speeds up the process of moving pixels around the screen. Computer game players have been especially sensitive to the speed of their video processors because this can greatly influence the quality of their entertainment. But business users should also be aware that a video accelerator can impact tasks such as sales presentations. Figure 2.3. Video accelerator chips from NVIDIA. (Photo courtesy of www.nvidia.com.) Currently, the best laptop video accelerators are from ATI and NVIDIA. Note that as in the case of processors, laptop video accelerators are usually not quite as fast as those in desktop models. Typical video accelerators are listed in Table 2.5. Table 2.5. Typical Video Components and the Best Optical Drives Available for Different Laptop Types Laptop Type Screen Size (in.) Video Accelerator Video Memory (MB) Optical Drive Desktop replacement 15.4/17 ATI Radeon X300/X600 NVIDIA GeForce Go 6800 128/256 DVD/CD-RW or DVD+/-RW Mainstream 14.1/15 Intel Media Accelerator 900 ATI Radeon 9000 ATI Radeon X300/X600 64/128 DVD/CD-RW or DVD+/-RW Value 14.1/15 Intel Media Accelerator 900 64/128 DVD/CD-RW Thin & light 14.1 Intel Media Accelerator 900 ATI Radeon X300/X600 64/128 DVD/CD-RW Ultralight 12.1 Intel Media Accelerator 900 64/128 None In addition to the type of video accelerator used, laptop users should also pay attention to the amount of video memory installed. The amount of video memory used for laptop graphics chipsets currently varies from 64MB to 256MB. In most cases the video memory is dedicated memory (separate from main RAM) used to hold information that will eventually be displayed on the screen. However, systems with video accelerators built into the motherboard chipset (such as the Intel Media Accelerator 900) use shared memory, which means that the video accelerator borrows main system RAM for video use. Since there is no dedicated video RAM, this results in a less expensive design (which also uses less power), but sacrifices performance when compared to dedicated video memory designs. The more video memory available, the more colors the laptop can display and the faster the video accelerator can operate. Large amounts of video memory are also useful for 3D graphics such as in games. Purchasers should be CAREFUL to note the type of video chipset and amount of video memory in a potential new notebook. Although there are a few select models with upgradeable graphics, in most cases the video accelerator components cannot be changed. You'll find more detail about mobile video chipsets in Chapter 11. Spindles (Storage) The classic three-spindle laptop is disappearing. These systems generally had three forms of rotating memory: a hard drive, an optical drive, and a floppy drive. Now, because floppy disks are so rarely used, many laptop manufacturers have been leaving them off in order to save weight and lower costs. In some two-spindle systems, the floppy can be swapped into the storage bay normally occupied by the optical drive, but you can't run both simultaneously. In most cases, the floppy is relegated to being used as an external device that connects to the system via a USB cable. Since floppy drives aren't used much anymore, this doesn't seem to bother many people, which is one reason the three-spindle designs are fading. As average file sizes continue to grow well past the capacity of a floppy, this once familiar component may well disappear altogether. Currently, most vendors offer external USB floppy drives for laptops as a $50 option. The most important drive in a laptop is its hard drive. Currently, drive sizes range from 20 to 160GB. Many experts suggest that users get as much hard drive storage space as they can afford. When users eventually purchase a digital camera or start storing audio and video on their hard drives, they will soon take advantage of all the storage space they have available. External USB drives can also be used to extend the storage of a laptop, and are actually quite excellent for backup, but when mobile, you generally have to rely on the drive that is installed internally in the system. Some laptops have drives that rotate at higher speeds than other drives. The use of faster rotating drives will positively impact system performance by a significant amount. A faster-spinning drive enables the system to access information from the hard drive more quickly. Faster drives also have a major impact on startup (boot) times, as well as the time it takes to hibernate and resume from hibernation. For some time there has been a variety of optical drives available for laptops. Most systems today include either a DVD-ROM drive, a combo DVD/CD-RW burner, or a DVD+/-RW drive, many of which can also handle DVD-RAM as well. In most cases these drives are not nearly as fast as their desktop counterparts, especially where DVD burning is concerned. In most cases if you plan on doing any significant DVD burning, I recommend attaching an external USB desktop DVD burner. Chapters 9, "Hard Disk Storage," and 10, "Removable Storage," discuss storage options in more detail. Expansion Options Laptop components are so tightly crammed together that few expansion options are available. Often the only way to expand the capabilities of a laptop is to insert a PCMCIA (Personal Computer Memory Card International Association) card (see Figure 2.4). These cards, also known as PC Cards or CardBus Cards, were originally designed as memory cards but are now capable of providing a wealth of features. Almost any feature not provided on a laptop or not provided in sufficient quantity can be added via a PCMCIA card. Figure 2.4. A diagram of the PCMCIA PC Card. Note that there are two types of PCMCIA cards and three sizes. In addition to the older 16-bit PC Card, there is also a high-speed 32-bit CardBus Card that is required for high-speed wireless networking cards. The three sizes are Type I, Type II, and Type III, which mainly vary in thickness. "Cardbus" is likely the bus used by the expansion slots on any motherboard newer then about 2000; Although its possible the Cardbus interface itself will run via a 16-bit DOS PCMCIA driver, I highly doubt that and am fairly sure that even in that unlikely case that the use of the bus will be limited to 16-bit cards, of which network cards are not- netowrk cards are built to the 32-bit Cardbus standard. The fact that drivers for MS-DOS are not available for newer technology is not particularly surprising. |
|
| 4506. |
Solve : Extract? |
|
Answer» Hello DOS? You mean extract files in Command Prompt?I think feras is trying to ask for a command that will zip/unzip files in DOS...probably to do it automatically in batch.7-Zip can do this. http://www.codejacked.com/zip-up-files-from-the-command-line/Get Unzip.exe from http://stahlforce.com/dev/index.php?tool=zipunzip Use the following command style: Code: [SELECT]C:\unzip.exe -o -j C:\FILES\Downloaded*.zip -d C:\FILES\Hello sorry M.r Carbon Dudeoxide the server here can't open the link you put Thank you M.r Belgretor, but what if I don't want to install Unzip.exe I mean that I want to use it in batch file and I don't know if the users have Unzip.exe Thank you all tikbalang is right Quote from: tikbalang on March 10, 2009, 08:59:54 AM google for pkzip/pkunzip/pkware/. i think the package was "pk250dos.exe" since v2.50 was the last version (shareware). there is also a freeware version called "info-zip".The Unzip.exe is a small file, and you don't have to install it, just keep it in the hard-drive somewhere. There is no built-in SUPPORT in the command-line for extracting, as far as I know. If you're distributing the batch file, you can include the unzip.exe file too. This is how I do it.Why extract from DOS? http://articles.techrepublic.com.com/5100-10878_11-6134552.html ( All the following came from the above link. ) <<<" Take advantage of Windows XP's compressed folders extraction wizard Windows XP's compressed (zipped) folders work so much like folders that it is easy to forget that they are actually based on ZIP files. You may even remove files from a compressed folder by opening the folder and then copying and pasting the files to another folder. You may find it easier to use the compressed folders extraction wizard. Here's how: Right-CLICK the compressed folder and select Extract All. When you see the Welcome page of the extraction wizard, click Next. Click the Browse button to choose a destination. If necessary, create a new destination with the Make New Folder button. Click OK. Click Next. This will extract the files in the compressed folder. Select the Show Extracted Files check BOX and click the Finish button. the one billrich talking about is based on the dll that comes with windowsxp, zipfldr.dll example usage in command prompt: rundll32 zipfldr, RouteTheCall "test.zip" but this only open the zip contents for viewing in windows explorer, and i couldn't find the entry point to automate the extraction of .zip files. |
|
| 4507. |
Solve : run css server in background? |
|
Answer» before you jump to a conclusion IM NOT MAKEING A VIRUS i have already been BANED from a site because some people don't think!!! |
|
| 4508. |
Solve : Batch to run a python file? |
|
Answer» Hi, it's a pain in the *censored* writing "cd c:\rendertester\" to navigate and then write "python worker.py 192.173.5.6:8080" all the time in the cmd Code: [Select]@echo off cd c:\rendertester python worker.py 192.173.5.6:8080 Nope already tried that. that only starts python.exe and not the file. If I do it manually there is no problem. Quote from: KaizerKaizer on March 11, 2009, 02:10:47 AM Nope already tried that. that only starts python.exe and not the file. If I do it manually there is no problem. Try with full paths for both Python executable and script, using quotes if there are any spaces. google.py is an example script included in the Python 2.6.1 download from python.org. It takes a search term as a PARAMETER and runs it on Google in the system default browser. This works for me in a batch file (in the folder where google.py lives)... Code: [Select]"c:\Program Files\Python\python.exe" google.py Britney Spears ...and this works anywhere on my system... Code: [Select]"c:\Program Files\Python\python.exe" "C:\Program Files\Python\Tools\Scripts\google.py" Britney Spears Your paths may be different... well, that worked better...but still not as it should. It works as long as I don't add the "http://192.ip-address" in the end. I use python 2.5 with twisted how is worker.py importing the command line argument? |
|
| 4509. |
Solve : Batch to create a backup.? |
|
Answer» I want to create a batch file to copy my email profile every time I boot up my PC. If possible I would also like to just do one copy per day.how about this? |
|
| 4510. |
Solve : How to make a Batch file to create a directory & copy files to it as an archive? |
|
Answer» How would you go about making a batch file ( I understand that I could open notepad and just type the commands in, the only problem is I do not understand all of the commands or know of them) What I want to do is create a batch file in notepad and save the file as a .BAT. What I want to do next or before I save the file as a .bat is tell it to create a directory ( any REALLY ) and have it copy files to it as an archive. copy files to it as an archive.I am ASSUMING it is in reference to making a backup or archive, I assume copy all of the files that are in the directory once the directory is created. I am assuming i would use the archive command after I created the directory correct? I am new at this and I am doing this for a class so I am asking for guidance and all that was included in the instructions was "Create a Batch file to create a directory and copy files to it as an archive. The file name should be Archiveit." It doesn't help that we girls are not computer as computer advanced as you guys, lolwould this work for making the directory? md c:\directory1 And also do I have to write the echo off or on command prior to the md c: ******* And how would I copy files to it, would I just extract old files from another directory into it, and use the file attribute such as archive? Sorry this is a little confusingmaybe this will hep you understand it easier. Instruct your employees to create a Batch file to create a directory and copy files to it as an archive. So, when they are about to repair something, they can back up the appropriate directory by typing “Archiveit” after they have edited the batch file to include the source file and the destination. Usually assignments in class are to test what you have been TAUGHT by the teacher. Hasn't he or she covered this? Test the commands at the command prompt. When the commands work, copy the the commands to notepad and save as a archiveit.bat C:\>md archive C:\>copy *.* archive\ C:\>rmdir archive C:\>rmdir /? Removes (deletes) a directory. RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. /Q Quiet mode, do not ask if ok to remove a directory tree with /S C:\> C:\>md /? Creates a directory. MKDIR [drive:]path MD [drive:]path If Command Extensions are enabled MKDIR CHANGES as follows: MKDIR creates any intermediate directories in the path, if needed. For example, assume \a does not exist then: mkdir \a\b\c\d is the same as: mkdir \a chdir \a mkdir b chdir b mkdir c chdir c mkdir d which is what you would have to type if extensions were disabled. C:\>copy /? Copies one or more files to another location. COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. /D Allow the destination file to be created decrypted destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written correctly. /N Uses short filename, if available, when copying a file with a non-8dot3 name. /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless COPY command is being executed from within a batch script. To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format). C:\>copy *.* archive\ |
|
| 4511. |
Solve : Concept of application port in networking? |
|
Answer» Hi all, |
|
| 4512. |
Solve : Please help on this For loops? |
|
Answer» I am having a Text file (Certs.txt) which has paths of files like the one below copy "%%a" c:\CER_PEM || CALL:samplethis line is if copy is unsuccessfull then call sample subroutine, you sure? and you have to end every subroutine in the batch with this line "GOTO:eof", including your main sub. otherwise the code will just keep go on until end of line. |
|
| 4513. |
Solve : FTP and displaying a file? |
|
Answer» Hey guys! I need a script that can write to (and read from) a file on a ftp host. The ftp command in Command doesn't help at all. I tried doing "help ftp", doesn't work..."ftp /?" just says unknown host... The ftp command in Command doesn't help at all. I tried doing "help ftp", doesn't work..."ftp /?" just says unknown host... FTP is an environment. From command line type FTP, when the FTP> prompt appears, type help. Read is the get command, write is the put command. Quote I'm trying to get it to only display 22 lines (which works fine) and also auto-update every second. The latter doesn't work...For some reason, if a file contains less than 22 lines, then it will just repeat the lines untill there are 22 in display...and if there are 22 or more, it doesn't auto update... Explain auto-update. How is the testfilelines.txt file getting updated? From what I can see, the code counts the records in the file and displays the last 22. If less than 23 records exist, all the records are displayed. The file updates often (possibly less than a second per update), so I need to show the changes. But how do I actually USE the FTP command to read and write to files?This simplified version of the code may help: Code: [Select]@echo off setlocal :loop echo ----- set dx=0 set fname=testfilelines.txt for /f "tokens=* delims=" %%x in (%fname%) do ( call set /a dx=%%dx%%+1 ) set /a last=%dx%-22 if %last% LSS 0 ( for /f "tokens=* delims=" %%x in (%fname%) do echo %%x ) else ( for /f "skip=%last% tokens=* delims=" %%x in (%fname%) do echo %%x ) echo ----- ping localhost -n 2 -w 1000 > nul cls goto loop Concerning the other question, click in the left hand panel for the correct syntax of the FTP commands.Quote from: Sidewinder on February 04, 2009, 06:28:36 PM This simplified version of the code may help:Let's assume the following: my username is: fakename And my password is: notreal And my ftp server is: ftp.fakesite.com It doesn't say anything about AUTOMATICALLY LOGGING in to a FTP server and writing/reading a file.I always thought that forums are a vehicle for sharing information. I thought after you learned FTP, you would come back here and SHARE with us. That FTP link was to give you all the tools you would need to write your own script. A little research on the FTP command line and you should have been good to go. Code: [Select]ftp -s:myScript.txt ftp.fakesite.com myScript.txt Code: [Select]fakename notreal cd /files put file.zip bye The above script uploads file.zip to the files directory on the remote site. To answer the question not asked. I would not try to combine the ftp into the other script. Instead try running both simultaneously in different windows. Quote from: Sidewinder on February 05, 2009, 05:00:01 AM I always thought that forums are a vehicle for sharing information. I thought after you learned FTP, you would come back here and share with us.Is it possible to append a line of text to the end of say file.txt using FTP?Quote Is it possible to append a line of text to the end of say file.txt using FTP? Apparently. This very topic is discussed on the very FIRST page of the FTP link I gave you. If you need help with specific commands, enter ? command at the FTP> prompt. Unless you get very lucky, it's rare that your research will spell out exactly what you're looking for. More likely you can learn by example or gain enough knowledge to be able to proceed. any way to read out the contents of a file too?Code: [Select]open you.yourdomain.com username password get file.txt bye then in file.bat Code: [Select]@echo off type file.txt pause >nul That's sort of what I was thinking...Quote from: Sidewinder on February 05, 2009, 05:00:01 AM I always thought that forums are a vehicle for sharing information. I thought after you learned FTP, you would come back here and share with us.Sorry this is an old thread...but I've run into another problem. How can I run multiple FTP commands in the script, as in not in a seperate file? |
|
| 4514. |
Solve : Wait for command to complete before contining batch file? |
|
Answer» I have created a batch file with the following syntax this command is rewriting the inflation.bat file to read it's just an example to proof that call statement does wait for a batch file to finish EXECUTING before returning. if you can post the code of inflation.bat, maybe someone can help you.I think the code in Reply #4 should work for any code in the "inflation.bat" file. |
|
| 4515. |
Solve : No activity monitor in a folder? |
|
Answer» Hi Guys set /a r=%time:~3,1%-1 FBThanks for the all the reply . I was trying to do the VB script as sidewinder says and got the folloing error : C:\>cscript no.vbs C:\no.vbs(12, 1) Microsoft VBScript runtime error: Object required: 'stance' Is taht make any sence ? Sorry about that. The line in question was a comment. Code: [Select]strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceOperationEvent WITHIN 3 WHERE " _ & "Targetinstance ISA 'CIM_Datafile' and " _ & "TargetInstance.Drive = 'c:' And "_ & "TargetInstance.Path= '\\scripts\\'") Do Set objLatestEvent = colMonitoredEvents.NextEvent() Select Case objLatestEvent.Path_.Class Case "__InstanceCreationEvent" WScript.Echo "File Created: " & objLatestEvent.TargetInstance.Name Case "__InstanceDeletionEvent" WScript.Echo "File Deleted: " & objLatestEvent.TargetInstance.Name Case "__InstanceModificationEvent" WScript.Echo "File Modified: " & objLatestEvent.TargetInstance.Name End Select Loop This script was designed to issue a message whenever an event occurred in the c:\script directory. You will need to modify the script to monitor no events happening. One way would be to note the times any events OCCUR. When the time difference between two events exceeds 10 minutes, you'll have your period of inactivity. Mostly, monitor scripts (you can monitor most anything) are used to trigger another event or to create documentation of some activity. Hmmm, a new concept, a monitor script to monitor non-events. Thanks Sidewinder I am not that smart to do what you are saying as I am not from a computer background ...Is it possible to implement by you , what you are saying (One way would be to note the times any events occur. When the time difference between two events exceeds 10 minutes, you'll have your period of inactivity.) ..It might be very easy code for you and will take 5 mins but to me ..it seems very complex .. Thanks for helping me so far Hi Sidewinder Also with my other script I have ..I use bmail (which is command line mail ) to send me a email then exceed the thresold .I have used that in batch script before and working good .(Dont know how you can use that in VB Script) Is it also possible to send email using bmail program when there is no activity in the folder for 10 mins ...? This script will be very help full for me ...of what I am doing right the moment ... Sorry to be a pain for asking you so many things . Many Thanks in advance ... A monitor script is designed to wait for an event to occur and then do some work. In no event occurs, no work is performed. You can see the dilemma of monitoring non-events. I was able to get these two scripts to work in a controlled environment. The first script monitors and times stamps directory activity. The second script calculates the time difference between the last event and the CURRENT time. When the difference gets to ten, we have liftoff Script 1 Code: [Select]Const ForWriting = 2 strComputer = "." Set fso = CreateObject("Scripting.FileSystemObject") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceOperationEvent WITHIN 3 WHERE " _ & "Targetinstance ISA 'CIM_Datafile' and " _ & "TargetInstance.Drive = 'c:' And "_ & "TargetInstance.Path= '\\scripts\\'") Do Set objLatestEvent = colMonitoredEvents.NextEvent() Set f = fso.OpenTextFile("c:\temp\Timer.txt", ForWriting, True) Select Case objLatestEvent.Path_.Class Case "__InstanceCreationEvent" f.WriteLine Now Case "__InstanceDeletionEvent" f.WriteLine Now Case "__InstanceModificationEvent" f.WriteLine Now End Select f.Close Loop Script 2 Code: [Select]Const ForReading = 1 Set WshShell = CreateObject("Wscript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Do Set f = fso.OpenTextFile("c:\temp\Timer.txt", ForReading) strTime = f.ReadLine If DateDiff("n", CDate(strTime), Now) > 10 Then WshShell.Run "bmail ........",,True Exit Do End If f.Close WScript.Sleep 30000 Loop I'm not familiar with bmail so you need to fill in the dotted line. Good luck. Do not put the scripts in the directory being monitored.Thanks a Lot sidewinder .. My problem has been FIXED .. Thanks to all for putting suggestion and help me out .. This was my first post on the forum and I have started like this forum already , because of u all helping ppl over there .. Thanks again |
|
| 4516. |
Solve : Need help extracting file in DOS? |
|
Answer» Hi, I am working off of my laptop using XP and Won't WORK. XP uses version 6.0. See below Quote from: thinkbig Also, I'm not sure if there are different versions There are a number of different versions of shell32.dll. All Windows 98 systems have version 4.72. Shell32.dll is located in BASE4.CAB on the Win98 INSTALL CD. Thanks for responding!! So if I put the Windows 98 Install CD in the computer, do you know what I would need to type in to extract the file? Thanks again! Hi, I figured it out (-: What an ordeal!! I used the boot disk with cd rom support and was able to find the code to extract the file from the Win 98 CD. Thanks again for your help!!! |
|
| 4517. |
Solve : Creating separate error files in Batch? |
|
Answer» I need to create error FILES from running a batch file for each of the command used.I need the error file NAME same as that of the "*.sql" name but with extn "*.err". |
|
| 4518. |
Solve : check if a "." is in a variable? |
|
Answer» I know a similar question was ask but I did not understand the code nor did it work when I tried to modified it. for %%a in (%s%) do if not "%%~xa"=="" (echo dot exist) else echo dot not exists I like that lateral thinking, Reno, where you consider the string as a "filename" and see if it has an "extension". Dias de verano wrote: " . . .the string as a "filename" and see if it has an "extension" Don't all file names on XP have an ".ext" .txt , .wpd . doc , .pps . . .?Quote from: billrich on March 07, 2009, 12:49:18 PM Don't all file names on XP have an ".ext" .txt , .wpd . doc , .pps . . .? An extension is not mandatory in MS-DOS or any VERSION of Windows. Extensions are used by Windows to implement file "types", but it is perfectly possible to have filenames without an extension. The Hosts file is a WELL known example. Others include ntldr and cmldr. Quote from: Reno on March 06, 2009, 10:14:20 PM Code: [Select]for %%a in (%s%) do if not "%%~xa"=="" (echo dot exist) else echo dot not exists The code works great but I do not understand the code for the for loop one. Can you or anyone explain please. Where in the code does it say that you check for the "." Also, what does "%%~xa"=="" mean? thanksQuote from: locbtran on March 07, 2009, 06:15:59 PM Quote from: Reno on March 06, 2009, 10:14:20 PMCode: [Select]for %%a in (%s%) do if not "%%~xa"=="" (echo dot exist) else echo dot not exists I hope I am not pre-empting Reno by explaining his or her excellent ingenious [see below*] piece of scripting. 1. By typing FOR /? at the prompt you will see the help text which includes information about the "variable modifiers". 2. These consist of a tilde character ( ~ ) followed by one or more letters. 3. They allow the extraction of information from a string of text considered to be a filename. 4. Examples: If %%A [in a batch] is a filename, [or %A at the prompt] then %%~dA returns the drive letter and colon (e.g. "C:"), %%~pA returns the path, %%~nA returns the name, and %%~xA returns the extension if there is one, and an empty string if there is not. An extension is defined as a dot and at least one following character.* 5. The filename does not have to refer to any existing file. 6. Thus: Code: [Select]C:\>for /f "delims==" %A in ("hello.kitty") do @echo Result: "%~xA" Result: ".kitty" C:\>for /f "delims==" %A in ("hello.kitty.today") do @echo Result: "%~xA" Result: ".today" C:\>for /f "delims==" %A in ("hello.k") do @echo Result: "%~xA" Result: ".k" C:\>for /f "delims==" %A in (".k") do @echo Result: "%~xA" Result: ".k" BUT... Code: [Select]C:\>for /f "delims==" %A in ("hello.") do @echo Result: "%~xA" Result: "" C:\>for /f "delims==" %A in (".") do @echo Result: "%~xA" Result: "" C:\>for /f "delims==" %A in ("......") do @echo Result: "%~xA" Result: "" * We see by experiment that the method will not INFALLIBLY detect the presence of a dot in a string, since if the string contains a dot only in the last position, or if all characters are dots, then a false report is given. So to answer your questions Quote Where in the code does it say that you check for the "." It doesn't, as explained above, explicitly search for a dot. It attempts to exploit a feature of cmd.exe intended for another purpose. And will succeed in some, but not all cases. Thus I cannot recommend it. Quote Also, what does "%%~xa"=="" mean? It is part of an IF expression... Code: [Select]if not "%%~xa"=="" ... which tests the following: is the string formed by expanding "%%~xa" NOT equal to two quote marks? (i.e. is it NOT empty?) If the user enters the string, the user already knows the string has a "." The source of the string could be the file names on the computer. Do not list all the file names but instead provide a count of the file names. Also provide a count of the filenames without a "." Reno suggested the source of the string be filenames on the computer dir /s * | find /c "." 30353 dir /s * | find /v /c "." 13003Quote from: billrich on March 08, 2009, 06:18:28 AM
wc is not a standard Windows command, it is a Unix utility that needs to be downloaded. You should have made that clear. Also, it doesn't answer the OP's question. dias, that's too much, its just an ordinary script, and worse its buggy code. you have done a good job at explaining. if i had to do the explaining part, i am going to reply type for /? for more info i also just realized it wont work when the string contain space, so here is the fix: Code: [Select]for %%a in ("%s%-") do if not "%%~xa"=="" (echo dot exist) else echo dot not exist still the above code can't handle wildcard characters such as "*, ?", but the find example can with some fix. Code: [Select]echo "%s%"|find "." >nul 2>&1 && (echo dot exist)||echo dot not exist Quote from: Reno on March 08, 2009, 06:38:42 AM dias, that's too much, its just an ordinary script, and worse its buggy code. Scripts, whether ordinary or special, should be as error free as we can make them. My turn to roll eyes ahh.... sometimes I can bask in the glory of having Instr and InstrRev at my disposal...dir /s | find "." | wc -l dir /s * | find /c "." Number of strings with "." = 30362 dir /s * | find /v /c "." Number of strings without "." = 13003 Dias de verano wrote: "Wc is not a standard Windows command, it is a Unix utility that needs to be downloaded. You should have made that clear. Also, it doesn't answer the OP's question." The Original Poster ask us to find a "." in a string. All the file names on the computer are a string. ( When the user enters the string, the user already knows the string has a ".") We answered the question very well. find /c can find the count. wc -l is not needed. |
|
| 4519. |
Solve : Need help loading old dbase applications program to newer platform with DOS.? |
|
Answer» I have an old applications program written in dbase that is installed on an old Compaq Contura laptop with a DOS based system--the monitor on it is giving up the ghost and I need to continue to use this program (at least in the short term) for a customized list management program. |
|
| 4520. |
Solve : Wildcard query.? |
|
Answer» Okay, lets SAY I'm looking for files that start with ZZ, and in the middle, it can be anything, but then after that, I want it to end in 123. The extension would be anything that starts with the letter 'P'. Would it be this? Okay, lets say I'm looking for files that start with Zz, and in the middle, it can be anything, but then after that, I want it to end in 123. The extension would be anything that starts with the letter 'P'. Would it be this? Why don't you just try it out? Not meaning to be critical, but experiments are a good way of learning. I can say it won't WORK that way on pure DOS, since the Asterisk will match to the end of the name or extension- for example, *a.* would be the same as *.*, *a.txt would be the same as *.txt, and file.t*t would be the same as file.t*. I BELIEVE this "rectified" in CMD, though. |
|
| 4521. |
Solve : Extracting FileName in Batch File? |
|
Answer» How to extract FILENAME without extension from the absolute path in a BATCH file |
|
| 4522. |
Solve : batch file that lists folders that are NOT in a text file? |
|
Answer» Hi everyone, |
|
| 4523. |
Solve : Looking for help with the > switch? |
|
Answer» Looking for a bit of help trying to set up a batch file, where I can PING VARIOUS servers in the company I work for . We have approx 20 we ping every morning and I can write a batch file to ping them. |
|
| 4524. |
Solve : Redirect the output of command line into trsh.? |
|
Answer» I want to redirect the output of call command into trash i dont want to make any file and write output in that . |
|
| 4525. |
Solve : Regedit & CMD Variables? |
|
Answer» Hi all |
|
| 4526. |
Solve : Need help to create batch files? |
|
Answer» Hello..I just want to ask you all how to make batch files for this: Couldn't figure what stork meant. Well, Ahli Baru might know... Check out that line starting "password"... Code: [Select]macam mana nak buat batch files(FTP) untuk ni: start MENU > run > type: c:\putty\psftp stork login: odbms password: 7bAHy8XB lcd a:\ cd /u02/app/tsm/tsmdbbk get dsmserv.dsk get dsmserv.opt get devconfig.out get volhist.out bye |
|
| 4527. |
Solve : Making a list.txt of files.? |
|
Answer» I am trying to get a list to come out in notepad or word. I have files that I need to print out lists of but there are over 40 FOLDERS and 200 plus files in each. I have tried a batch file but I can not get it to work. |
|
| 4528. |
Solve : Filename into variable? |
|
Answer» I am setting up a batch file that (hopefully) will echo the NAME of ANOTHER file in the same directory. In the directory, there will be one (and ONLY one) file of the type .tlc perfect. You can have my baby |
|
| 4529. |
Solve : add files to 7z? |
|
Answer» Hello, |
|
| 4530. |
Solve : Letting a bat file show how many times it has been used? |
|
Answer» HI, i want a bat FILE to show how many times it has been used, is this possible? PLEASE post a sample! correction: CODE: [Select]set var=0 if exist TMP ( for /f "tokens=1 delims= " %%a in (TMP) do ( echo Times used: %%a set var=%%a ) ) set /a var+=1 echo %var% >TMPHow does that work exactly, macdad?alright im out. forget it. Yea it was a failure yea it was crappy yea im crappy so im out. i didnt take the time to WRITE it and debug it correctly ok dias. i deleted it. devcom is better at it then.chill, man!!!tyvm! sorry dias ive been kinda annoyed recently at school. but im really sorry for the yelling.No worries m8 hope you feel better soon |
|
| 4531. |
Solve : Find and Move a File? |
|
Answer» Hi Firstly - Search a location C:/Folder1 for a file prefixed with letters eg CH12345 So you're searching inside folder1 for any file that begins with CH ? Quote Secondly - Send that file to another location ie C:/Folder2 and remove it from orignal location. for this you would do: Code: [Select]move /-y C:/Folder1\Ch12345 C:\Folder2 That's how it works if I'm not mistaken. You can't send an email using plain batch file. Use Blat. If you don't want to download blat do: Code: [Select]start mailto:[emailprotected] Which will open up the email window. But the user must attach the file himself and click send. Thanks So you're searching inside folder1 for any file that begins with CH ? Yesalso start mailto: works but opens OUTLOOK, how can i get to open lotus notes Quote how can i get to open lotus notes Well if this is a program, you just WRITE the path to lotus notes instead of writing start mailto:. If it is a web program, using start type the url (link, found in address bar), then it will open the default browser. Quote So you're searching inside folder1 for any file that begins with CH ? Yes. In that case, do this: Code: [Select]move /-y C:\Folder1\CH* C:\Folder2 Which the * represents a wild card. If I'm not mistaken, the wild card will represent... Anything really. Hope that helped. C:/ should be C:\ above.I always forget which way the slashes go.Hi Folks Thanks for the help. However How can I move Multiple Files to one location; Move all files prefixed with TE to new location move "C:\Admin\Test Process Batch Files\Source\TE*.zip" C:\Admin\Test Process Batch Files\Destination ERROR is: Cannot Move Multiple Files to Single File How can I work around this, as I will always have multiple files prefixed the same that need moving to same locationQuote from: petreli on March 03, 2009, 08:47:18 AM Hi Folks this way how you want to move files Code: [Select]C:\Admin\Test Process Batch Files\Destinationmeans that they will copy to file Destination but with no extension so you must show that you want copy to dictory Code: [Select]C:\Admin\Test Process Batch Files\Destination\Quote from: petreli on March 03, 2009, 08:47:18 AM Hi Folks the basic syntax of move is move filespec destination So you do Code: [Select]move "C:\Admin\Test Process Batch Files\Source\TE*.zip" "C:\Admin\Test Process Batch Files\Destination"Hi I have tried this, I think the error I am receiving is means I cannot move files of the same prefix to the same location? "Cannot move Multiple files to a Single file" is the error What i'm trying to do is move multiple files to the same location not fileHmmm Me thinks that Copy is a better option, SEEMS to work better, but have to delete the files from source folder, but is safer if theres a problemQuote from: petreli on March 05, 2009, 05:39:20 AM Hi Does the folder called Destination exist? Hi Dias de verano Yes destination file existsQuote from: petreli on March 06, 2009, 05:29:29 AM Hi Dias de verano That is not what I asked. Read my question again. |
|
| 4532. |
Solve : Monitoring a program?? |
|
Answer» Hey, I was just wondering if it's possible to open a program from DOS, then wait until it's closed. I use Vista Sidebar, and when I play Starcraft it seems to change my resolution then mess up my apps. So, I was wondering if it's possible to kill the task, then open Starcraft (keeping the dos open) then once the program is done it reopens Vista Sidebar. Code: [Select]taskkill /F /IM sidebar.exe Thank you very much, this worked perfectly! Thanks to you to Reno.np |
|
| 4533. |
Solve : MS-DOS Verify command? |
|
Answer» I am creating a batch file to copy files from one DRIVE to another. I want to verify that the files are copied correctly. My question is what happens if I set Verify ON and there is a problem with a file? Does DOS just GENERATE a message or does it recopy the file until it gets it right? Or something else? Are messages/error codes generated that I can trap and use to control logic flow in the batch file? It was mostly used for unreliable floppy drivesGood point. Modern HDD has built-in features to insure proper write operation. If the HDD can not correct a problem in the background, you will get an error message even if verify is off. |
|
| 4534. |
Solve : Renaming program files folder? |
|
Answer» Hello, |
|
| 4535. |
Solve : need modification? |
|
Answer» @ECHO off |
|
| 4536. |
Solve : Wrapping a For command string. (Resolved)? |
|
Answer» Win XP Home. |
|
| 4537. |
Solve : need a help to create a batch file? |
|
Answer» Hi folks, Each CSV file contains many column.Quote from: chandrakala on March 23, 2009, 02:41:22 AM the above solutions are not working.huh? where is ghostdog? the vbs solution is working. except to read column 2 and 3, you change the echo line to this: Code: [Select]WScript.Echo splitted(1) , splitted(2)Quote from: Reno link=topic=79348.msg525766#msg525766 date=1237970543where is ghostdog? [/quote still here. just not going to waste my time asking back what's not working.Study this, and hopefully all will become clear Code: [Select]@echo off echo column 1, column 2, column 3, column 4, column 5> test.csv echo cat, dog, 12.445, Monday January 1st 2009, Zaragoza>> test.csv echo Ant, Bear, "Chicken", "Diana Smith", Egg Sandwich>> test.csv set filename=test.csv for /f "tokens=1-5 delims=," %%A in ( ' type "%filename%" ' ) do ( echo %%B,%%C ) Code: [Select]column 2, column 3 dog, 12.445 Bear, "Chicken" Hi ghostdog, The code is working fine.Thanks for you help. Sorry could not reply you early due to some reason.sorry again. Thank you for your help and time |
|
| 4538. |
Solve : Printing PDF files from DOS batch file? |
|
Answer» We have been trying to use the same commands we use for PCL FILES (PRINT, NPRINT, COPY) to print our new PDF files and all we get is garbage. |
|
| 4539. |
Solve : variables? |
|
Answer» hello |
|
| 4540. |
Solve : How to configure the DOS language from GERMAN to ENGLISH.? |
|
Answer» Hi Everone, To change the language used in Windows XP command prompt, what I did was download German SP3 and extract (it is an archive) cmd.ex_ Then I used expand.exe to expand that compressed file to German-cmd.exe. So then you could do it by replacing are PROGRAMS that have any German text, but keep the originals is that do not have German. The ones that are just pure binary with no ASCII in them. Like...er..uh IO.SYS and maybe one other?I think IO.SYS/IBMBIO.COM had STRINGS, but I'm not sure. |
|
| 4541. |
Solve : 16 bit ms-dos subsystem? |
|
Answer» Hi all, im a newbie here, this is my first post. |
|
| 4542. |
Solve : Newbie? |
|
Answer» Ok BC that was something else... No idea what you were saying.. break it down for me?I posted the big batch file that I did to show how the Windows (in fact, any) command language is mighty useful for automating simple TASKS that you do a lot. In this case it is because I download lots of tv programme FLV files from a TV station website and I need to convert them into either mpg or divx avi files so I can watch them on TV using my DVD player. The SCRIPT I posted will convert all or a subset of the video files in a folder. I feel this is a VALID answer to the question, "What is "DOS" (CMD) useful for?" |
|
| 4543. |
Solve : n00b need help . . . on converting *.ASK file format? |
|
Answer» this is shame to tell that during college time, lecture told me to study and i skipped thanks for reply guys....most probably you did not redirect to new file. Quote @ghostdog74,too bad.yup, as ghostdog suggest, redirect it to new file, example as below. Code: [Select]C:\>ask data42.txt>result.txt C:\>type result.txt [CERT_PROG_DATA_IN] RAP_PUBLIC_ID=175002152F416B5604FF78AD18A7EBFEA6DF897E APE_PUBLIC_ID= or if you want to create the new file from inside batch, you could modify the code. eg. >>result.txt echo [CERT_PROG_DATA_IN] |
|
| 4544. |
Solve : waiting? |
|
Answer» Shall I not get any hope to get a code to close windows media player That should work... If you know in advance how long the song is. Quote from: Dias de VERANO on April 01, 2009, 03:43:27 PM If you know in advance how long the song is. Yeah...but most likely you know the song beforehand.could add: Code: [Select]@echo off set /p length=What is the length of the song? wmplayer SONG ping localhost -n %length% -w 1000 > nul tskill wmplayer Quote from: macdad- on April 01, 2009, 04:58:44 PM could add: If you're playing the same song over and over again, then you won't want to ask for user input, just run it.But to use sleep you need to download extra stuff, and ping requires you to do none of that.I haven't tried starting WMP in command line, but I think you need to do the FULL file NAME (INCLUDING extension and path).heres the command line parameters and such for WMP: http://support.microsoft.com/kb/241422Quote from: joedavis on April 01, 2009, 08:51:56 PM That was the solution for about six threads on this subject So, alright- let's send the message, "remember, if you REALLY want something solved, start 6 TOPICS about it"Well it get's the message across faster I guess... |
|
| 4545. |
Solve : How can I stop for a specific time? |
|
Answer» How can I STOP the execution of the next commands for a specific time using |
|
| 4546. |
Solve : Batch with greater than sign? |
|
Answer» OK so I need to create a line of text in a new or existing file with a GREATER than sign Dias, do you have some powers we should know about? Beware my powers.... Quote from: Dias de verano on March 30, 2009, 12:18:21 AM Beware my powers.... Please...Please don't hurt me! You can have my watch, but just leave us alone!I have a wife and kids- eat them, mr.bear. oh- we aren't talking about a bear. Off topicness! The Thread! Presented and produced by - Helpmeh Co-Producer - Dias De Verano Star of the thread - BCprogrammer "Please enjoy this thread" ------------------------------------ Remember: | "Ignorance is Bliss"the thread concluded with the original poster's concluding statement: Quote from: Innerchaos on March 20, 2009, 02:12:14 PM excellent that worked great After that the TOPIC is either forgotten or off-topic banter ensues. this is an example of the SECOND case.Quote from: BatchFileCommand on March 30, 2009, 06:18:09 PM Off topicness! Lol... |
|
| 4547. |
Solve : what is the format to close the window? |
|
Answer» Thanks. I can play the song. But after the song is over the media player I'm fairly sure this was brought up before... Twice Quote from: joedavis on March 30, 2009, 05:50:25 PM Devduttaa, Couldn't you just REPLACE sleep with ping? Some people don't have sleep. |
|
| 4548. |
Solve : bat file error issue with programs? |
|
Answer» Is this the silence that ends a thread that means "I've realised what a *censored* I've been"?no i had to do other things. sorry. but I wont say anything about what you said I'll keep that to myself. well then, see- we just wanted a conversation. Just reminding ourselves what we WOULD do in particular situations that just happened to coincide with yours is all.So did you make the defrag work? do i need to check my paths on my trs-80 to run defrag? they should be the same right? Halouk says they should. Quote from: squall_01 on March 25, 2009, 02:14:49 PM the second works right off But your PATH variable is screwed. So NONE of the Windows utils that you see below will work from the prompt like they should. Code: [Select] actmovie.exe ahui.exe alg.exe append.exe arp.exe asr_fmt.exe asr_ldm.exe asr_pfu.exe asuninst.exe at.exe ati2evxx.exe Ati2mdxx.exe atmadm.exe attrib.exe auditusr.exe autochk.exe autoconv.exe autofmt.exe autolfn.exe blastcln.exe bootcfg.exe bootok.exe bootvrfy.exe cacls.exe calc.exe certreq.exe certutil.exe charmap.exe ChCfg.exe chkdsk.exe chkntfs.exe cidaemon.exe cipher.exe cisvc.exe ckcnv.exe cleanmgr.exe cliconfg.exe clipbrd.exe clipsrv.exe clspack.exe cluster.exe cmd.exe cmdl32.exe cmmon32.exe cmstp.exe CNAB4RPK.EXE CNMCP6e.exe CNMCP78.exe comp.exe compact.exe comsdupd.exe conime.exe control.exe convert.exe cscript.exe csrss.exe ctfmon.exe dcomcnfg.exe ddeshare.exe debug.exe defrag.exe dfrgfat.exe dfrgntfs.exe dfscmd.exe diantz.exe diskpart.exe diskperf.exe DivXCodecVersionChecker.exe DivXsm.exe dllhost.exe dllhst3g.exe dmadmin.exe dmremote.exe doskey.exe dosx.exe dplaysvr.exe dpnsvr.exe dpvsetup.exe driverquery.exe drwatson.exe drwtsn32.exe dsadd.exe dsget.exe dsmod.exe dsmove.exe dsquery.exe dsrm.exe dumprep.exe dvdplay.exe dvdupgrd.exe dwwin.exe dxdiag.exe edlin.exe esentutl.exe eudcedit.exe eventcreate.exe eventtriggers.exe eventvwr.exe exe2bin.exe expand.exe extrac32.exe fastopen.exe faxpatch.exe fc.exe find.exe findstr.exe finger.exe Firefox Setup 2.0.exe fixmapi.exe flac.exe accwiz.exe fltmc.exe fontview.exe forcedos.exe freecell.exe fsquirt.exe fsutil.exe ftp.exe gdi.exe getmac.exe GkSui18.EXE gpresult.exe gpupdate.exe grpconv.exe HELP.exe hostname.exe ie4uinit.exe ieudinit.exe iexpress.exe imapi.exe imdisk.exe imdsksvc.exe ipconfig.exe ipsec6.exe ipv6.exe ipxroute.exe java.exe javaw.exe javaws.exe jdbgmgr.exe jview.exe krnl386.exe label.exe licmgr.exe lights.exe lnkstub.exe locator.exe lodctr.exe logagent.exe logman.exe logoff.exe logonui.exe lpq.exe lpr.exe lsass.exe magnify.exe makecab.exe MAPISRVR.EXE mdm.exe mem.exe metaflac.exe migpwd.exe mmc.exe mmcperf.exe mnmsrvc.exe mobsync.exe mountvol.exe mplay32.exe mpnotify.exe mqbkup.exe mqsvc.exe mqtgsvc.exe mrinfo.exe MRT.exe mscdexnt.exe msdtc.exe msfeedssync.exe msg.exe mshearts.exe mshta.exe msiexec.exe mspaint.exe MsPMSPSv.exe msswchx.exe mstinit.exe mstsc.exe napstat.exe narrator.exe nbtstat.exe nddeapir.exe net.exe net1.exe netdde.exe netsetup.exe netsh.exe netstat.exe NICFIND.EXE nlbmgr.exe nlsfunc.exe notepad.exe nslookup.exe ntbackup.exe ntdsutil.exe ntkrnlpa.exe ntoskrnl.exe ntsd.exe ntvdm.exe nw16.exe nwscript.exe odbcad32.exe odbcconf.exe OggDSuninst.exe openfiles.exe osk.exe osuninst.exe packager.exe pathping.exe PDBoot.exe pentnt.exe perfmon.exe pgdfgsvc.exe ping.exe ping6.exe PMounter.exe PowerCalc.exe powercfg.exe print.exe progman.exe proquota.exe proxycfg.exe pxcpya64.exe pxcpyi64.exe pxhpinst.exe pxinsa64.exe pxinsi64.exe qappsrv.exe qprocess.exe QuickEdCleanReg.exe qwinsta.exe rasautou.exe rasdial.exe rasphone.exe rcimlby.exe rcp.exe rdpclip.exe rdsaddin.exe rdshost.exe recover.exe redir.exe reg.exe regedt32.exe regini.exe regsvr32.exe regwiz.exe relog.exe replace.exe reset.exe rexec.exe route.exe routemon.exe rsh.exe rsm.exe rsmsink.exe rsmui.exe rsnotify.exe rsopprov.exe rsvp.exe rtcshare.exe RTLCPL.exe runas.exe rundll32.exe runonce.exe rwinsta.exe savedump.exe sc.exe scardsvr.exe schtasks.exe sdbinst.exe secedit.exe services.exe sessmgr.exe sethc.exe setup.exe setupn.exe setver.exe sfc.exe shadow.exe share.exe shmgrate.exe shrpubw.exe shutdown.exe sigverif.exe skeys.exe slrundll.exe slserv.exe smbinst.exe smlogsvc.exe smss.exe sndrec32.exe sndvol32.exe sol.exe sort.exe spdwnwxp.exe spider.exe spiisupd.exe spnpinst.exe spoolsv.exe SpoonUninstall.exe sprestrt.exe spupdsvc.exe spupdwxp.exe stimon.exe subst.exe svchost.exe SymTdiRg.exe syncapp.exe sysedit.exe syskey.exe sysocmgr.exe systeminfo.exe systray.exe taskkill.exe tasklist.exe taskman.exe taskmgr.exe TaskSwitch.exe tcmsetup.exe tcpsvcs.exe telnet.exe tftp.exe tlntadmn.exe tlntsess.exe tlntsvr.exe tourstart.exe tracerpt.exe tracert.exe tracert6.exe tsadmin.exe tscon.exe tscupgrd.exe tsdiscon.exe tskill.exe tsshutdn.exe TweakUI.exe typeperf.exe tzchange.exe unins000.exe unlodctr.exe upnpcont.exe ups.exe user.exe userinit.exe usrmlnka.exe usrprbda.exe usrshuta.exe utilman.exe uwdf.exe verclsid.exe verifier.exe vmnat.exe vmnetdhcp.exe vssadmin.exe vssvc.exe vwipxspx.exe w32tm.exe wdfmgr.exe wextract.exe wiaacmgr.exe winchat.exe WinFXDocObj.exe winhlp32.exe winlogon.exe winmine.exe winmsd.exe winspool.exe winver.exe WISPTIS.EXE wjview.exe wowdeb.exe wowexec.exe wpabaln.exe wpnpinst.exe write.exe wscntfy.exe wscript.exe wuauclt.exe wuauclt1.exe wupdmgr.exe xcopy.exe XX293116.EXE XX2953.EXE XXCOPY.EXE XXCOPY16.EXE XXPBAR.EXE I'm on a network which mite be why with limitations.Quote from: squall_01 on March 25, 2009, 02:24:38 PM I'm on a network which mite be why with limitations. So this isn't your own computer? noQuote from: squall_01 on March 25, 2009, 03:12:23 PM no Duh! Like "Read this first!" "GIVE all information!" Now he tells us! Probably the admin has disabled users from starting defrags. yes, didn't expect it too..... was thinking of home but doing it here so its like ONE of those duh moments.Surpriseingly I got it work and it looks just like what you have posted. I kind of want it to be gui use. The help isnt all that helpful and I tried running it to no avial. Also, I want to know add avast and spybot but not sure what I have to point tooo..... I looked for an exe but its not anything that I can see right off that would lanuch the programs. |
|
| 4549. |
Solve : Need Help: How to replace Text string on File? |
|
Answer» Hi, Hi, if you are able to download stuffs, you can use SED (check my sig for link). Example for 1 file Code: [Select]c:\test> sed -i "s/1/A/g" file 2 3 4 A 2 3 A A 2 3 4 5 6 7 8 9 A example file multiple files Code: [Select]c:\test> sed -i "s/1/A/g" file*.txt what is "sed"?Quote from: jik on April 01, 2009, 06:50:14 AM what is "sed"?doesn't take much time to look it upQuote from: ghostdog74 on April 01, 2009, 06:54:03 AM doesn't take much time to look it up What he sed |
|
| 4550. |
Solve : How Do i open miscrosoft word?? |
|
Answer» Ok i using windows xp and one my college assignments is based around using MS DOS, for the final part of the assignment it says Open up MS Word using both interfaces. well oviously a 2 year old can do this in xp lol but i need the DOS command... i am trying to open microsoft word 2003 btw im struggling so much on this because i looked all over net but cnt find a useful sorce, alot of things say to enter *** (whatever) then the program name but it dont work. so can somone just give me the exact thing so its as simple as typing it stright in. its annoying cause i asked my tutor but he says look on the net, urgh i on the net for 3 hours for him in my night, it got annoying so found a forum and HOPING u guys can help me plz thanx people example open .doc file with default shell in windows nt cmd: c:\filename.doc i dont know how to open MS WORD in MS DOS, let me know if you somehow successfully install ms word in DOS.if you are using XP, then you are using DOS as in cmd.exe. the command line for opening word document is winword.exe "mydoc.doc". "winword" is the command to open microsoft word. of course it GOES without saying word must be installed.Quote from: Reno on March 31, 2009, 04:50:01 AM i dont know how to open MS WORD in MS DOS, let me know if you somehow successfully install ms word in DOS. Depends which version you mean... I used it for years. I preferred WordPerfect, but Word was OK. Microsoft Word 5.5 for DOS is still available, and it's free. (Legally). Microsoft is giving it away. Turns out Microsoft released a Y2K patch for Word back in 1999, and rather than try to sell it, they just posted the whole program on the web for anyone to take. It can run in real MS-DOS, in a DOS box under Windows, or in DOSBox under OSX or Linux. http://download.microsoft.com/download/word97win/Wd55_be/97/WIN98/EN-US/Wd55_ben.exe interesting, there is actually ms word for ms dos. back in ms-dos era, i remember using a word processor, forgot what it's called, only remember the interface is all in blue color. mostly use the 286 to play games, and using infinity.exe & norton to hack save game. the ol good days. as for windows version of ms word & nt cmd.exe Code: [Select]C:\>winword.exe 'winword.exe' is not recognized as an internal or external command, operable program or batch file.have to specify full path to it, or add it in %PATH%. but if you already have association of .doc file to winword, just typing the document name will launch winword. Code: [Select]C:\>assoc .doc .doc=Word.Document.8 C:\>ftype word.document.8 word.document.8="C:\Program Files\Microsoft Office\Office12\WINWORD.EXE" /n /dde C:\>test.doc Cheers guys i will try it wen i get to college 2morrow only problem is i gotta do it through there "H" drive cause there C drive is useless cause it got Congic on it ^^Quote from: Reno on March 31, 2009, 07:31:28 AM back in ms-dos era, i remember using a word processor, forgot what it's called, only remember the interface is all in blue color.Blue background was in a lot of word processors- including the built-in EDIT, as well as Microsoft Works. I think word had a blue background, but I never used it. Quote as for windows version of ms word & nt cmd.exe or: Code: [Select]Start winword Quote but if you already have association of .doc file to winword, just typing the document name will launch winword. true, but I myself have gotten into the habit of using START to explicitly state what I want done. They both end up calling ShellExecute() or ShellExecuteEx(), but for some reason I feel the semantics are different.When you go to C:\ just write those commands cd program files and press Enter you get C:\Program Files> cd microsoft office and press Enter you get C:\Program Files\Microsoft Office> cd office11 and press Enter you get C:\Program Files\Microsoft Office\Office11> now at the end of this just write WINWORD and press Enter The Microsoft Word will start. I tested this and worked to me. Cheers.I wonder why this doesn't work for me.. Oh I KNOW! I have word installed in my program files directory, which is on D:\. Start winword works regardless of the installed location because the winword is a registered ActiveX Server application. In fact, the logic above is as flawed as this: Code: [Select]public FUNCTION UPPERCASE(BYval strUpper as STRING) as String If strUpper="string" then uppercase = "STRING" else err.raise 13,"could not ucase, unrecognized value!" end if which is completely useless and stupid. it "works" but only with a very specific set of circumstances, namely, that the parameter is "string". This is a protracted version of your example, which assumes that everybody has their "program files" folder on their C: drive. this can differ based on roaming profile settings and also on the Windows install drive, not to mention, in my case, the use of TweakUI to change the folder to a larger drive.Quote from: dr_iton on March 31, 2009, 02:12:58 PM When you go to C:\ just write those commands tested and worked so easily thankyou haha i dunno if we was supposed to do it this way but if not me is awsome for smarter ^^ lmao nah really thankyou though. really good and easyit's NOT a good way of doing it. I already explained that. It only works in the default case. Not everybody has it installed in that specific location. another way could be through script, which completely side-steps any path issues whatsoever. Code: [Select]'in openword.vbs set word = GetObject("","Word.Application") Word.Visible=true Set Word=Nothing |
|