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.
| 7601. |
Solve : How to run another program several times with different input?? |
|
Answer» Hello, So, I want to make a batch file that calls the specific file I made in LINGO and runs it several times with different inputs that I will provide in the batch file. How will you provide the input? Are the numbers in a plain text file, one per line? This sort of thing could work. Code: [Select]@echo off for /f "delims=" %%a in (input.txt) do ( for /f "delims=" %%b in ( ' lingo.exe /switches %%a ' ) do ( >>file.log echo input was %%a and output is %%b ) ) |
|
| 7602. |
Solve : Power Plan import windows 7? |
|
Answer» Hi, @Echo OFF You know...., I wrote that up earlier but didn't end up even trying it because of this: http://www.sevenforums.com/tutorials/75562-power-plans-export-import.html This guide didn't have an option for just: powercfg -import "PowerPlan.pow" For the record I almost tried that! I will try it and post back. Thanks!Z:\Standard Install\Win7 Configs\Files for Scripts>powercfg -import "WonderGroup Desktop PowerPlan.pow" The file could not be found. Yeah, it didn't work unfortunately. I even tried the file without quotes. I looked at the parameters with the help flag and it states that you MUST specify the actual path: -IMPORT Imports all power settings from the specified file. Usage: POWERCFG -IMPORT Specify a fully-qualified path to a file generated by using "PowerCfg -EXPORT parameter". Any other ideas? Thanks for your help!Hmm, Powercfg must work differently on Windows 7. Windows XP says you need to use the /File switch to pull from an existing config file and it doesn't say anything about having to use the fullpath to the file name either. XP also uses slashes and not hyphens for the switches. I hate it when Microsoft keeps switching back and forth on that crap. They did that with FORFILES when Server 2003 came out. Ever here of the %CD% variable! C:\>pushd \\Server\volume\FTPTEMP Z:\FTPTEMP>echo %CD% Z:\FTPTEMPQuote from: Squashman on May 23, 2012, 08:25:10 AM Hmm, Powercfg must work differently on Windows 7. Windows XP says you need to use the /File switch to pull from an existing config file and it doesn't say anything about having to use the fullpath to the file name either. XP also uses slashes and not hyphens for the switches. I hate it when Microsoft keeps switching back and forth on that crap. They did that with FORFILES when Server 2003 came out. I'm not sure what you're getting at . How can I apply these commands to my batch?The %CD% variable is the full path to the CURRENT DIRECTORY you are in. You said you needed the full path to your Power Configuration file.Quote from: Squashman on May 23, 2012, 12:55:36 PM The %CD% variable is the full path to the CURRENT DIRECTORY you are in. You said you needed the full path to your Power Configuration file. Oh, I understand what you mean. I'm sorry, what I meant is I have the full path and it will never change... but the file path is located on a network drive so therefore I cannot include the path to the power plan file in the batch as indicated below: @Echo OFF powercfg -import "\\reagan\mis$\Standard Install\Win7 Configs\Files for Scripts\WonderGroup Desktop PowerPlan.pow" pause ~And the batch that we tried (below) didn't work because it needs the full path to the file whilst using the import command: @Echo OFF Pushd "\\reagan\mis$\Standard Install\Win7 Configs\Files for Scripts\" powercfg -import "WonderGroup Desktop PowerPlan.pow" pause I just need to import the "WonderGroup Desktop PowerPlan.pow" file using the powercfg -import command, but it doesn't work because it's a UNC path. I am not needing to Echo/Print/Show the path name in the batch file. I just need the batch file to import the file located on the UNC drive. Got it? . I hope I clarified my question! HAHAH. You are not understanding what the Pushd command does and what the %CD% variable is. The pushd command maps a drive letter to your unc path and then makes that drive letter and directory the current working directory! Powercfg -import "%CD%\Wonder Group Desktop PowerPlan.Pow" Do you see the light!Quote The pushd command maps a drive letter to your unc path and then makes that drive letter and directory the current working directory! Not quite. The pushd <directory> command puts the current directory on the stack and changes to the directory indicated. The companion command (popd) PULLS a directory entry from the stack using a last-in first-out (LIFO) method and makes that the current directory. Nothing is mapped. Pushd can be used to save the directory where the batch file originated, and popd can be used to restore it for the user. In between the batch file can change directories as needed without leaving the user lost in the directory structure. I think it would be better to use the net use command to map the UNC to a regular drive:\path notation and go from there. Code: [Select]net use Z: \\reagan\mis$ powercfg -import "Z:\Standard Install\Win7 Configs\Files for Scripts\WonderGroup Desktop PowerPlan.pow" net use Z: /d I know what PUSHD and POPD does, but trying to explain it to him for this exercise was becoming futile. I am trying to explain it to him in layman's terms so he understands because obviously he is not understanding. I do this all the time in my scripts where a command will not accept a UNC path. The only issue with using the NET USE command is that you cannot guarantee that DRIVE Letter is not already in USE unless you sit there and use a FOR LOOP to check what drive letters are already in use. PUSHD and the %CD% variable is the perfect solution for this problem.Thank you all for the help. I am no expert with CMD but I am familiar with the %CD% AND pushd/popd commands . 1. [Powercfg -import "%CD%\Wonder Group Desktop PowerPlan.Pow"] doesn't work as it throws an error (I tried it after your initial post) 2. net use could work, but as squashman notated - someone might have the drive z: already mapped So, I'm still stuck FYI: C:\Users\cfash>pushd "\\reagan\mis$\Standard Install\Win7 Configs\Files for Scripts\" Z:\Standard Install\Win7 Configs\Files for Scripts>powercfg -import "%CD%\WonderGroup Desktop PowerPlan.pow" An UNEXPECTED error condition has occurred. Unable to perform operation. You m ay not have permission to perform this operation.Well to make sure it really is not a Permissions issue, manually map a drive letter to that UNC path and then run the powercfg command. You should just be able to type all that at the cmd prompt without creating a batch file just to check if it is a permissions issue. We can use the NET USE command, it will just add a lot of extra code to your script. You can tell NET USE to map to the next available drive letter and then we can rerun the NET USE command inside a FOR LOOP to find out what drive letter got mapped to that share.As suggested, you can use "NET USE" to obtain a drive letter: Code: [Select]@Echo Off for /f "tokens=1-2" %%a in ('net use * \\reagan\mis$ ^| find "is now connected to"') do set netDrive=%%b powercfg -import "%netDrive%\Standard Install\Win7 Configs\Files for Scripts\WonderGroup Desktop PowerPlan.pow" net use %netDrive% /d Pause |
|
| 7603. |
Solve : Zip a single file using winzip? |
|
Answer» For some reason i can not figure out how to jsut grab one file zip it. This command line grabs everything in the folder and zips it. am i missing something... I just want to grab the a single .jpg file and zip it? @Salmon Trout All I did was type "winzip32.exe command line" into Google. I have always just used the command line add on client. http://www.winzip.com/downcl.htm Most of our automated batch files use this where I work. |
|
| 7604. |
Solve : How to write a batch file to copy directories recursively and then create a shor? |
|
Answer» Hi there, |
|
| 7605. |
Solve : Cmd to produce list of computers on domain that are turned on? |
|
Answer» Hi Guys |
|
| 7606. |
Solve : Batch file creation? |
|
Answer» Quote from: rossBNE on October 01, 2012, 08:45:25 PM c:\\dir\fort.exe <in.dat> out.dat Then this would be your batch file. Can you explain further? Try creating a new thread with descriptive title, RATHER than using someone else's thread. Code: [SELECT]@echo off c:\dir\fort.exe <in.dat> out.dat |
|
| 7607. |
Solve : Copy %CD% to server %username%? |
|
Answer» So were doing a server move and staff rename and didn't want to COPY all our staffs old files over to the new one. We wanted them to do it so were not storing old stuff they never use anymore. |
|
| 7608. |
Solve : CAN AN ASCII CHARACTER 0Dh OR 0Ah BE PLACED INTO A TEXT FILE USING A DOSBATCH?? |
|
Answer» I HAVE A TEXT FILE WITH MANY LINES WOULD ANYONE KNOW HOW TO GO ABOUT THIS? Yes. Please try turning of your CAPS LOCK and stop shouting at us. We are a peaceful tribe Most any script language can handle the characters found on any ASCII chart. Batch code, well not so much. Batch code can handle carriage returns however. Code: [Select]@echo off setlocal for /f "tokens=* delims=" %%i in (Text.txt) do ( echo %%i >> newText.txt echo. >> newText.txt ) File names and paths are your responsibility. GOOD luck. edited to add the word "please" |
|
| 7609. |
Solve : Is it possible to add or delete pagefile.sys size and partiotion with DOS?? |
|
Answer» Here is what I'd like to accomplish. I can do some DOS batch stuff, but other than that I am a brainless ol fart. |
|
| 7610. |
Solve : Using an Incrementing variable in a For /R Loop? |
|
Answer» I have a number of log files that all get named the same when created, but placed in different directories. I need to move and rename all the files to one directory, and have come up with a way to name them according to the computer name and time/date of move, but the batch executes so quickly that all the files end up with the same name still. Why did I need the /a? I suspect that's the major missing part. What does that tell DOS to do with the variable? 1. a (or A) is for Arithmetic. To find all the things that SET can do, type SET /? at the prompt 2. This isn't DOS. |
|
| 7611. |
Solve : copy all files and folders from current folder? |
|
Answer» Quote from: Sidewinder on April 02, 2012, 02:52:59 PM If you select a folder, and right click the mouse, what do you expect to happen? A context menu which includes Send To should appear, shouldn't it? Quote from: mioo_sara on April 02, 2012, 04:16:28 AM ... but cuz source folder is changing every day so program should find the source folder (that is my current folder) and copy any folder and files from there to destination folder (d:\backup) ...Why not get a freeware file synchronization/backup program such as Allway Sync - there are others but this is one I've used - and use it to achieve your objective? Seems to me this would be easier solution than trying to resort to some DOS technique. Quote from: soybean on April 02, 2012, 06:01:36 PM Why not get a freeware file synchronization/backup program such as Allway Sync - there are others but this is one I've used - and use it to achieve your objective? Seems to me this would be easier solution than trying to resort to some DOS technique.I agree. Some Sync utilities can be invoked with a template to automate a task. That might be called 'batch' programming, but it is not just plain DOS. Many programs run from a command line and run a script. Example:some programs are written in Excel and use VBA. Such business class programs backup and archive files that have been imported. Such are often paid only programs. Some are found on download.com and have free trial. But not knowing the intent of the OP, it is hard to know if giving bits and pieces of DOS code if he does not understand how to integrate the parts. And it not clear if he wants to invoke the DoS batch code from the GUI or the command line. IMHO the OP needs to read some tutorials on VBscript and Cscript. Using the command-based script host (CScript.exe)Quote As far as I know, this has to be done thru the registry. Is this what you did? yes i add it thru registry Quote But not knowing the intent of the OP, it is hard to know if giving bits and pieces of DOS code if he does not understand how to integrate the parts. And it not clear if he wants to invoke the DoS batch code from the GUI or the command line.its part of my flash project .unfortunately flash is so week for working with windows so i should do the rest with batch programing ! i used lots of batches and 80% of the job has done so i prefer to do the rest in this way Quote its part of my flash project .unfortunately flash is so week for working with windows so i should do the rest with batch programing ! Now I am totally confused. You want to flash the BIOS? No, you want to write a system utility using Adobe Flash. Huh? The natural choice for a Flash app is to extend it with Java. But C# would also work. Even current versions of Visual Basic CONTROL FLASH thing. I have never hears of DOS batch used as a supplement, extension or replacement for Flash. But there is a lot I don't know. Are you writing a Windows app or a browser app? Browser apps often use JavaScript, vb-scrip, ActiveX or even Java at the client side. The DOS batch stuff is essentially twenty years old. With a few improvements in recent years. IMHO it is not well suited for browser apps. It is suited for doing backups and archives and removing dead files. Not so good for doing anything visual. Only 80% of your code works? Did you model the code? You need to get up to 99 % of your code working before working on kinks. Have you verified the logic and sequence of your code? A practice of professional programmers is to write a large part of the code in the best programming tool that they can use. Then fill in the tough spots with things imported from other software tools. I am unable to visualize this with FLASH and DOS batch. Sorry I can not help you with your quest. But keep at it and eventually you will find a solution. It is not really impossible. Have you ever read books on structured programming? Or books about program design and incremental refinement ? Books on structured programming with C#Quote from: Salmon Trout on April 02, 2012, 03:43:30 PM A context menu which includes Send To should appear, shouldn't it?I agree. Putting it into the SendTo menu which doesn't require a registry edit works perfectly. I have done that with a few of my batch files over the years. Another option would be to just drag the source folder onto the batch file which would take it as input in the variable %1.OK. Last try. This goes back to the original question as I understand it or at least how I think I understand it. First up is a VBScript to allow the user the select a folder for the XCOPY operation: Code: [Select]Const RETURN_ONLY_FOLDERS = &H0001 Const WINDOW_HANDLE = 0 Const MY_COMPUTER = 17 Set objShell = CreateObject( "Shell.Application" ) Set objFolder = objShell.BrowseForFolder( WINDOW-HANDLE, "Select Folder", RETURN_ONLY_FOLDERS, MY_COMPUTER ) 'Check For Cancel Button; Nothing Returned ' If TypeName(objFolder) <> "Nothing" Then WScript.Echo objFolder.Items.Item.Path End If Save the script in any folder with any name and a VBS extension. Next up is the batch code. Replace the for statement in your existing batch file with the code below: Code: [Select]set target=D:\Backup for /f "tokens=* delims=" %%i in ('cscript //nologo drive:\path\scriptname.vbs') do ( if .%%i NEQ . (echo D | xcopy "%%i" %target% /e /c /y > d:\filelist.txt ) ELSE ( goto :eof ) ) Change drive:\path\scriptname.vbs to point to where you saved the VBS script. The user will be presented with a dialog allowing selection of any folder on the system. Only folders are shown to reduce clutter. Use the left mouse button to highlight the folder name and PRESS OK. The folder path will be returned to the batch file for use by the XCOPY operation. If you CANCEL the folder dialog, the entire batch file will terminate. A file will also be created with a listing of what was copied. (filelist.txt) Feel free to TWEAK the code as needed. If you find this useful, then great. If not, well then not so great. Exit stage left. dear Geek-9pm Quote you want to write a system utility using Adobe Flash. Huh yes . but i don't use latest version(adobe cs4 or 5) i'm using adobe flash 8 its rather old but unfortunately i should use it .in cs4 or 5 adobe added adobe air so you can work directly with the outside world throu java vb or lots of other scripting languages Quote I am unable to visualize this with FLASH and DOS batch adobe flash 8 has not allowed any command that even think about executing anything(except media ) even opening a window in windows explorer is a big problem ! and you should do lots of scripting tricks!! Quote Only 80% of your code works?no i never said that !! what i mean was my project has reached to 80% and its near to end by the way thanks for the link dear Squashman please read post below i think my bad English is the problem ! dear Sidewinder thanks for the time and script that you wrote for me its working very nice but wish it could act automatically it needs final user to specify the source folder . cant it be done by the program itself? please read my last post i pot another script and another explain i think cuz of my bad English i explain the situation awful!! ok guys i'm back again ! sometimes knowing a language is not enough and you should know how to ask ! Albert Einstein !!! first of all sorry for my bad English its my teacher's fault ! i think i explained a simple question in a very hard or bad way and i made the situation very hard and so i did not got what i wanted at the first place now forget about right click or any stupid idea that i said at the post #1( wish i could edit it) now i try to explain my question in a easy to understand way lets imagine we have a folder (named johns) and we want to copy all the files and folders(including sub folders)from johns to d:\backup that's all that's what i want !! so we copy a batch file to johns folder and run it.. now batch should start the copying process .is it that hard for even old fashion Dos base batch file to do? now the problem is that if i could put source folder name (johns) in batch script problem could be solved but cuz final program will use these batches and source folder name will be changed in a frequently time so i prefer that batch do this job for me i mean batch Dir from the current folder and copy any including object to the destination below you can see a simple batch that do this but instead of coping it moves the objects(i don't like this) Quote @echo off any idea ?If it is the current directory you wish to copy, you can specify the current directory using a period (.): For example, let us go with your example; let's say we have a folder Johns on C: drive; Let's say we are writing the batch file to run from within that folder (again, following your example scenario). if we want to copy all files and folders from the current directory, we can use xcopy and the period Code: [Select]xcopy . D:\backup /s /i There is something of a complication: this doesn't necessarily refer to the folder the batch file is in. If you want to always refer to the folder that the batch is in (as opposed to the current directory of the command prompt session running the batch file) you can use this instead: Code: [Select]xcopy %~dp0 D:\backup /s /i my my my dear BC_Programmer thank you very much it worked like a charm that was a simple but breath taking question ! you really help me thank again i was really becoming disappointed and thought its simple but its not possible with dos ! i pressed thanks button and if there was 200 more buttons there i would have pressed them for you ================= and other guys Geek-9pm ---Sidewinder---Squashman----Salmon Trout thank you all too you tried to teach me a lot i have a little problem i forgot to ask how should this batch file create a folder in destination and rename it to current folder's name before copying files and folders from current directory to it in another language 1-first create a folder in destination d:\backup\ and rename it to current folder's name= example johns(where my files and folders located now) 2- now copy files and folders from current directory(johns) fo d:\backup\ new destination folder (example=johns) thanks thanks its done above post has been solved thanks dear friends |
|
| 7612. |
Solve : Booting Windows (from HDD) out of DOS? |
|
Answer» Hi all, |
|
| 7613. |
Solve : Batch file - output " ...done! " after an operation?? |
|
Answer» Perhaps I'm just boneheaded and not seeing the obvious, but can someone please tell me how I'd get my batch to append " done! ", or similar, after an operation? You are looking for a way of appending something to the same line? Yea, that's exactly what I want, thanks! So, If I'm thinking this through correctly, I'd use your template above and simply replace your ping command for mine, yes? Can I assume that this method supports multiple commands? For example: Code: [Select] @echo off 0>nul set /p="Running CommandSet1... " ping www.google.com > nul ping www.sony.com > nul ping www.yahoo.com >nul echo done! Since experimentation is the key to learning, why don't you try that and see if it works? Just got done doing so and ANSWERED my own questions, thank you!Another thing to try: @echo off 0>nul set /p="Running CommandSet1" ping www.google.com > nul 0>nul set /p="." ping www.sony.com > nul 0>nul set /p="." ping www.yahoo.com >nul 0>nul set /p="." ping www.yahoo.com >nul 0>nul set /p="." ping www.yahoo.com >nul 0>nul set /p="." ping www.yahoo.com >nul 0>nul set /p="." ping www.yahoo.com >nul 0>nul set /p=". " echo done! Perfect, thanks! |
|
| 7614. |
Solve : CPU usage without wmic? |
|
Answer» Hi all! |
|
| 7615. |
Solve : Assistance creating backup script? |
|
Answer» I'm trying to create a batch script to enumerate user profiles on both Windows XP and Windows 7 workstations. The purpose of the script is to: |
|
| 7616. |
Solve : I need on screen keyboard load help? |
|
Answer» I'm working on a project with a graphics INTERFACE, the end product will not have It seems the osk command is always open as long as the keyboard is showing on the screen.Yes, use the START command START OSK To find which options will help you, do this: START /? ...and get a list of all the options for the start command.So far so good. Popped it right up. Now I have to find a way to always keep it on top. The software I'm using and the keyboard don't seem to like sharing the screen. When the keyboard is up and I roll the mouse to it it drops off the screen, kind of defeats the purpose for the keyboard! Thanks for your help.Are you doing a program in a language like Visual Basic or Visual C++ and need the OSK? You may be able to invoke it as a child process. Not sure. Bit in that case, it not LONGER is a DOS thing. The OSK has its own internal setting for Always on top. Is this set? Seems to work for all the programs I use.IT depends on where I call it from. I am doing a graphics interface that lives in its own world and the two didn't seem to be able to co-exist. I FOUND if I run the keyboard command in the startup folder for Windows it will do what I need. I just have to create a tag that tells the operator not to "x" out of the keyboard, just minimize it. If I call it up from the graphic software it will run but when I cursor over it it drops out. |
|
| 7617. |
Solve : deleting a drive mapping without knowing the drive letter? |
|
Answer» Hello |
|
| 7618. |
Solve : batch file lookup table?? |
|
Answer» hi, |
|
| 7619. |
Solve : Wallpaper? |
|
Answer» Is it possible to change an xp WALLPAPER via batch file?Code: [Select]SET TargetFile = Targetfilename |
|
| 7620. |
Solve : Batch script to rename a word in vbs file? |
|
Answer» I'm trying to write a batch script to rename a certain word ina .vbs file. |
|
| 7621. |
Solve : Batch File Help, using a wildcard(dynamic) directory? |
|
Answer» Hello! I need to count the NUMBER of files in a directory where one of the layers is dynamic, MEANING C:\level1\level2\{dynamic directory}\error. So, I need to count the amount of files in the error directory and they SAVE it to a text file. There are only 2 directories in the "dynamic" directory.I guess I would do something like this. |
|
| 7622. |
Solve : Please explain what this code is doing? |
|
Answer» Quote from: Salmon Trout on April 14, 2012, 11:27:52 AM 1. Check that the variables %driveletter% %wantedfolder% and %backupfilename% expand to what you think they do GOT it... MKDIR "%driveletter%:\%wantedfolder%" ) MOVE /Y "%backupfilename%" "%driveletter%:\%wantedfolder%\" Sorry, I missed the typos... So does it work now, or not? Yup. Thanks. |
|
| 7623. |
Solve : How to delete certain lines in a txt file by using bat?? |
|
Answer» I want to delete some lines in a TXT file BU using bat file. I want to delete some lines in a txt file bu using bat file. Is there a pattern to the lines or text that are being deleted? Show us a sample of the real text and explain what needs to be removed. We have experience but we need to see the real data, to spot where certain commands can be used. |
|
| 7624. |
Solve : cannot copy outlook.pst to server shared folder? |
|
Answer» Quote from: Uselesscamper on August 28, 2011, 07:42:15 PM right...thx. Welcome Aboard ! Who knows...they may return..... Quote from: desmond on October 16, 2009, 03:09:58 AM I try to write a script to copy Outlook.pst from my MS outlook2003 to a SERVER shared folder in C drive, but nothing is being copied I think there is low space on your server. You should check that the pst file is not oversized. If it has more than 2GB size then you need to split pst files. After you split it in small sizes, you could be able to backup to the server. Don't WORRY about the divided file. All such files can LATER be merged as original file.It generally occurs due to oversized pst file. If your pst file is larger than 2GB, then it may create problem in copying to the server. In such case the file may also get damaged. Therefore, you should first split pst files then try to copy to the server.Stop spamming the Forum... Topic Closed. |
|
| 7625. |
Solve : List Filenames and Date[SOLVED]? |
|
Answer» Hey, thanks for reading this |
|
| 7626. |
Solve : Command to activate block control panel feature in gpedit.msc? |
|
Answer» Hi, if this is for work, you should probably be using the domain group policy anyway... Exactly. |
|
| 7627. |
Solve : Win 7 command prompt Format 2nd Drive Access Denied? |
|
Answer» Placed this here vs Win 7 since its command prompt. C:\Users\frankenstein>format s: /fs:FAT32Did you try rite clicking command and select "run as admin ? ? How many Drives/partitions in this PC... Give us the lay of the land.This is part of my RAMdisk project. The RAMdisk has to be formatted upon every reboot since the formatting is wiped out when the system is shut down. So my plan is to write a batch file that performs a FAT32 Format so that the S: drive is ready to roll when the system is running. This batch file will be called by STARTUP and will perform this format when Windows 7 boots. This system is my test system with 1 physical hard drive 160GB IDE at C: and a virtual hard drive which is an allocated section of system RAM that is 810MB in size mapped as S: to the OS. Only other drive is DVD-RW as D: Digging in runas on windows 7 command prompt a google search suggested using an elevated trust level, but i only have 1 as shown below. C:\Users\frankenstein>runas /showtrustlevels The following trust levels are available on your system: 0x20000 (Basic User) C:\Users\frankenstein>http://social.technet.microsoft.com/Forums/en-US/w7itprosecurity/thread/cd82780b-6afa-4404-8515-5d646a5623de/ This link on google doesnt look too good with what i want to do, but there has to be a way to make this work. Attached are pics of before and after formatting it FAT32. Really hoping to be able to do this at start up vs having to manually format each time I want to use RAMdisk. [year+ old attachment DELETED by admin]What ramdisk driver are you using, and is it able to do a format on create? The ramdisk driver most likely requires administrative privilege to mount a device object and should be able to format it.AR RAM Disk V1.20 is no longer supported but if it works then the drive is automatically created on each boot.Yes its AR Ramdisk that I'm using. Played with it some and strangely that if the drive created is small in size it keeps its formatting such as a 24MB held the formatting as FAT32 after a reboot, yet 810MB loses its info on SHUTDOWN or reboot. I was impressed that it was written for XP and worked ok on Windows 7 32 bit. Was thinking that if I can Format S: /fs:FAT32 on each boot as part of startup that it would be almost like initializing this space to be clean and ready to roll. If formatting is lost it will ensure that its formatted and ready to be accessed at S:Try the different disk options. Is there an option for NTFS (I don't use a ram disk these days).NTFS not supported as this pic shows it doesnt like NTFS formatting. FAT32 works, but thats probably why i am getting security issue requiring elevated privilages, NTFS would probably allow it more than FAT32 through inherritance if NTFS would work. [year+ old attachment deleted by admin]AR RAM disk doesn't need formatting - if it's working ok. Maybe it's just not win 7 compatible. Try a different Ram disk.Try sizing it at or below 768MG...Do you have these options selected? The Ram disk option never worked for me. This is from the XP box... [year+ old attachment deleted by admin]Found a better solution. Went with different vendor for solution. Went with DataRAM Ramdisk VERSION 4.0.0 and this saves the formatting so no having to reformat each time etc and it has options to save to Hard Drive from Ram before shutdown as well as LOAD from HD to RAM on startup. So no batching required now I guess. Thanks Everyone for your input on this! Cool Beans... |
|
| 7628. |
Solve : Relative paths in .bat files disappearing?? |
|
Answer» Firstly, hi to everyone, this is my first post. I stumbled here after a rather frustrating Google tiki tour. |
|
| 7629. |
Solve : Viewing/showing special characters/computer language - how to?? |
|
Answer» I'm playing around with MS-Dos in a VMware Player virtual machine, I have a "for dummies" book, "DOS" and I'm looking for where this book tells me what commands to type if I'd like to see the computer language characters, such as the omega, alpha symbols, a heart symbol (on white playing-card like background), etc, but I cannot find this anywhere in this book. I even tried searching online but couldn't find anything - COULD you PLEASE help me? |
|
| 7630. |
Solve : ren command with wild cards? |
|
Answer» I am trying to rename multiple files in a folder, APPENDING a text to the end of each filename. for example, I am using the following ren command to rename 4 files, but it only renames 2 files correctly, says :"A duplicate file name exists" error for the 1 file: Just out of curiosity, why does the single line rename command (in my first post) mess up the file names? Thanks! The wildcard you used results in two files getting the same new name, so the second one causes an error, and is skipped. Study these and you will see how the wildcard works 1. SalesDigest_Atlanta.pdf becomes SalesDigest_new.pdf 2. SalesDigest_Atlanta_Reg.pdf becomes SalesDigest_Atlanta_new.pdf 3. SalesDigest_Natl.pdf becomes SalesDigest_new.pdf (this already exists because it was used at step 1) 4. SalesDigest_Natl_Trad.pdf becomes SalesDigest_Natl_new.pdf The syntax is ren [Drive:][PATH] filename1 filename2. You can use wildcards (* and ?) in either file name parameter. If you use wildcards in filename2, the characters represented by the wildcards will be identical to the corresponding characters in filename1. Expanding slightly, the syntax is ren file1 file2. In your ren command: file1 is *.* which means 'process every file'. file2 is *_new.* which is the specification for the new name and is interpreted as "everything in the original name up to the last underscore, followed by _new. followed by everything after the last dot in the original name" This means that these two original file names would get the same new name. SalesDigest_Atlanta.pdf - > SalesDigest_new.pdf SalesDigest_Natl.pdf -> SalesDigest_new.pdf The original name that sorts earliest is processed first, and gets the new name. The second one causes a name collision and is skipped with this error message sent to the console: C:\>ren *.* *_new.* A duplicate file name exists, or the file cannot be found. If anyone is interested, there is a good summary on Superuser http://superuser.com/questions/475874/how-does-the-windows-rename-command-interpret-wildcards |
|
| 7631. |
Solve : Merge CSV files then paste into a column in the master sheet? |
|
Answer» Hi, The code fox gave me works perfectly. It does delete the headers in the file, but not a biggie i can always grab the headers from a different file and paste them into the first row. It is supposed to create the headers for the new csv file, but remove all the headers of the individual files. If you want to keep the headers for all the individual files then remove skip=1 I also note now that the headers you have are too long for the set /p command. Try this: Code: [Select]@echo off for /f "delims=" %%a in ('dir /b *.csv') do ( for /f "delims=" %%b in ('type "%%a"') do ( >newfile.tmp echo %%b,File_Name goto :next ) ) :next for %%a in (*.csv) do ( for /f "skip=1 delims=" %%b in ('type "%%a"') do ( >> newfile.tmp echo %%b,%%a ) ) move /y newfile.tmp newfile.csv >nul |
|
| 7632. |
Solve : Working of DOS? |
|
Answer» Hi guys, i want to know how that the DOS and its commands are working. I mean CONSIDER a command md which makes a directory. In here what process in going . How DOS creates directory etc ... Like this For all commands i need explanation Your QUESTION is a little vague - and to explain the operation of the cmd prompt could take hundreds of pages. If the OP has already stated study of C++ or C#, he would do well to pursue his study. IMHO. The OP has stated study of C++/C#? I guess what I was really getting at was, if he needs to actually know how DOS worked to program something similar, that's one thing. KNOWING how 'DOS' (aka the command-prompt-that-people-think-is-dos-but-isn't) now works is something that is already indirectly covered in many programming tutorials (how to create folders, copy files, get directory listings, etc.) That's why I asked for what purpose he is researching this....and I don't think the OP is going to return either. 6 days, a number of posts, and no reply... |
|
| 7633. |
Solve : Batch File to Convert Txt files? |
|
Answer» Hi, Small change to fix the leading comma. Good thinking. |
|
| 7634. |
Solve : cmd line command and Unicode? |
|
Answer» Hi, I'm trying to obtain text files in Unicode format, via the command: Any hint about how to do that? I'm just going crazy Google "cmd change code page", but I'll tell you if you don't know how to do that. chcp 1252 Quote from: mauro012345 on May 14, 2012, 08:19:11 AM Hi, I'm trying to obtain text files in Unicode format, via the command:So you used a tip from the dostips.com website but then came here asking how to use it? Why didn't you just post on the dostips.com forums?Quote from: Squashman on May 15, 2012, 03:51:20 PM So you used a tip from the dostips.com website but then came here asking how to use it? Why didn't you just post on the dostips.com forums?Didn't know they have a forum Anyway my SOLUTION didn't work as I expected. In fact, I had to start from UTF-8 and reach the Unicode format and that's not so easy! This "è" is driving me crazy... I'll give a look to the Salmon hint, thanks.Quote from: mauro012345 on May 17, 2012, 08:34:32 AM Didn't know they have a forumClick the link you posted and SCROLL down!lol... there is forum there! |
|
| 7635. |
Solve : To be, or not to be, that is the question !!? |
|
Answer» hi myflash.rar source.fla newfile.swf movie.flv *.regif they are exist (mostly in source folder) go to finish and end but if there are not at least one of those files exist MOVE everything from source folder to extra folder important= 1-its not Necessary for existence of all of those files at the same time 2-but at least one of those should be in source folder 3-if there were not at lease one of those files move everything from source folder to extra folder my script is here but i dont know why its not working and how should i fix it Quote @echo off & setLocal EnableDelayedExpansionThis just looks like what you were trying to do in your previous thread. Why didn't you keep POSTING in that one?TOPIC Closed. See your other thread for replies. |
|
| 7636. |
Solve : if here are more than (..) file? |
|
Answer» hi dir "*.swf" | find /i "file" and it worked but below script is not working i dont know why Quote for /f "tokens=1 delims= " %%a in ('dir *.swf ^| find "File(s)"') do set var=%%aI gave you the code for when it is greater than 6 and the code for the FOR loop. You have refused to use both. Why? There is no such thing as a MORE compare operator. Open up a command prompt and type: if /? dear Squashman its too complicated for me ! CANT you do the rest believe it or not if i could figure it out myself i would have done that and something elas i tried this script and it did nothing why ? there were just 2 swf files !! Quote for /f "tokens=1 delims= " %%G in ('dir *.swf ^| findstr /R /C:"File(s) .* bytes$"') do (please helpYou don't need a :EOF label to go to. GOTO :EOF is the same as using the exit command. Your goto for step 2 does not work because your label has 2 colons in front of it.ok now i tried this one and it worked but it looks ugly to me can someone make it better or fix the problems? working script Quote for /f "tokens=1 delims= " %%G in ('dir *.swf ^| findstr /R /C:"File(s) .* bytes$"') do ( problems= 1-if some ( jpg or flv ) files are exited in sub-directories they cant be find or copy 2- script is not sharp enough and is not working exactly(SOMETIMES good sometimes bad !)ok my other topic closed so i came here but to me its a different question !! ==================== here is my topic please read it and if you can help hi i have a problem with my batch script i want to DIR and check to see if these files are exist or not Quote myflash.rar source.fla newfile.swf movie.flv *.reg if they are exist (mostly in source folder) go to finish and end but if there are not at least one of those files exist move everything from source folder to extra folder important= 1-its not Necessary for existence of all of those files at the same time 2-but at least one of those should be in source folder 3-if there were not at lease one of those files move everything from source folder to extra folder my script is here but i dont know why its not working and how should i fix it Quote Quote @echo off & setLocal EnableDelayedExpansion1) You need to use the /B switch with the DIR command 2) don't use a space as a delimiter. 3) move your closing parenthesis after your IF statements. 4) You should put quotes around your variable names when dealing with file names and directory paths.dear Squashman i tried what you said or at least what i got from your answer but it didn't worked Quote 1) You need to use the /B switch with the DIR commandyou man dir/s/B i tried this one too dir/B Quote 2) don't use a space as a delimiter.where? you mean space in line 4 in my previous post? i removed it ! Quote 3) move your closing parenthesis after your IF statements.which one? the one in line 2 or 9 ? if i remove parenthesis in line 9 ) it wont be able to run it ! 4) You should put quotes around your variable names when dealing with file names and directory paths. i hope you mean names in line 2 . right? i put quotes around them "myflash.rar" "source.fla" "newfile.swf" "movie.flv" "*.reg" my final batch is below and it still is not working . i don't know which part is missing ! Quote @echo off & setLocal EnableDelayedExpansion1) In regards to using DIR /B /S. Do you understand why you need to use both of those switches. Just type DIR /S at a cmd prompt, then type DIR /B /S and you should see why. 2) NO! You are using a Space as a delimiter in your FOR LOOP! Either close up the space or get rid of the delims option all together. 3) Of course the last one. You need to end the code block in the correct spot. I didn't say REMOVE it. I said move it after your IF statements. 4) No! Those file names don't have any spaces in them. If they did you would need quotes. I specifically said VARIABLES! What do you think is going to happen to your IF EXIST test if their is a space in the directory path.Quote 1) In regards to using DIR /B /S. Do you understand why you need to use both of those switches. Just type DIR /S at a cmd prompt, then type DIR /B /S and you should see why. i just wanted my bat to SEARCH and look into sub-directories too ! Quote 3) Of course the last one. You need to end the code block in the correct spot. I didn't say REMOVE it. I said move it after your IF statements. brilliant my friend you are truly a master it worked like a charm Quote 4) No! Those file names don't have any spaces in them. If they did you would need quotes. I specifically said VARIABLES! What do you think is going to happen to your IF EXIST test if their is a space in the directory path.i think error was not because of those file names i didn't change them and it solved just that bad parenthesis ) and something else= i replaced line 3 with 4 and it solved !! my final working script is below thanks dear master Squashman Quote @echo off & setLocal EnableDelayedExpansionWell I hope your paths don't have spaces in them because it won't work if it does. |
|
| 7637. |
Solve : cmd? |
|
Answer» Hi, Hi,To do what?See a list of CMD options with the following: Select START, select Run type in CMD /? then press enter and a DOS box will open with help information. Does that help? |
|
| 7638. |
Solve : Deleting Files Based on File Name? |
|
Answer» I am trying to create a batch file to delete all files in a directory (including subdirectories) in which the 5th and 6th characters in the file name are equal to "09". The file names are based on a date code and I want to delete files based on certain dates. If someone could point me in the right direction it would be GREATLY appreciated.This can be done in a FOR LOOP. I am trying to create a batch file to delete all files in a directory (including subdirectories) in which the 5th and 6th characters in the file name are equal to "09". The file names are based on a date code and I want to delete files based on certain dates. If someone could point me in the right direction it would be greatly appreciated.Code: [Select]del ????09*.* /s Thank you BC. It was much to complex for me. He used numbers instead of pictures. I am not good with numbers.Well that was easy! Thanks both of you for your help. I wasn't aware of the ? placeholder. I was thinking more of a couple If Then statements that used DOS's version of Mid String (if such a thing exists). I was making it way harder than it needed to be. I am not permanently DELETING the files by the way. Before running this I am making a copy of all of the files, then just going into the copy and deleting specific files. Then going into the ORIGINAL copy and deleting the other ones. I'm sure this can all be done in a single batch file, but I only need to do it once. Thanks!I would suggest that a filter be applied to make the files hidden. Most program will not include hidden files in a precess of preparing a report. If that is what you want.Quote from: Geek-9pm on May 17, 2012, 01:38:09 PM I would suggest that a filter be applied to make the files hidden. Most program will not include hidden files in a precess of preparing a report. If that is what you want.I don't recall the user requesting to do anything with hidden files. |
|
| 7639. |
Solve : need cmds for startup? |
|
Answer» My system crashed after a windows update. I tried RESTORING it but it did not help. The function keys don't work only command prompt under S-DOS; and it has been many years since I remembered the command codes. Am I screwed or what? Hi Bill... Who is Bill? My name is Dean Stone.Quote from: DeanStone77 on April 17, 2012, 01:00:11 PM Who is Bill? My name is Dean Stone. Classic taken care ofQuote from: Salmon Trout on April 17, 2012, 01:17:21 PM Classic |
|
| 7640. |
Solve : Create Batch file to change name of specific file? |
|
Answer» How can I change the name of a specific FILENAME (INFORMddmmyyyy.csv). The file will have a different date each day """"SET filename= "INFORM%dd%%mm%%yyyy%.csv"""""""? The space is a real character, so that filename will resolve to a file file name with a leading space. This SEEMS to be BETTER: Code: [Select]SET filename=INFORM%dd%%mm%%yyyy%.csv If it turns out that filename has embedded spaces or other special characters, use the quotes on the output side: Code: [Select]ren "%filename%" "OUTFORM%ndate%%Allm%.csv" Hope this helps, not really sure what the question is. HI Thanks for the reply, I RECEIVED "The system cannot find the file specified" I changed the Set File name to the exact filename without the date varibles. It has worked I guess its the date varibles I need to look at now. Do I have SET yyyy=%date:~8,4% set correctly? year format needs to be yyyy What I am trying to do in this case is rename a specified filename. The fileaname will change from day to day with the date at endHi Got it sorted, may not be tidy but does the job. Code: [Select]@Echo Off for /F "tokens=1-4 delims=/ " %%A in ('date/t') do ( set DateDay=%%A set DateMonth=%%B set DateYear=%%C ) SET dd=%date:~0,2% SET mm=%date:~3,2% SET yy=%date:~8,2% SET ndate=%dd%%mm%%yy% SET fulldate=%dd%%mm%%yyyy% SET filename=INForm%dd%%mm%%DateYear%.csv @For /F "tokens=1,2,3 delims=: " %%A in ('Time /t') do @( Set Hour=%%A Set Min=%%B Set Allm=%%A%%B ) ren %filename% OUTFORM%ndate%%Allm%.csv pause |
|
| 7641. |
Solve : typing text in ms dos? |
|
Answer» how do i type text like a letter in ms DOS? i have windows 7What do you mean? Your QUESTION is not CLEAR. how would i type some kind of text in ms dos ? what would be at he cmd? yes |
|
| 7642. |
Solve : Batch file editing? |
|
Answer» Quote the word document has the prompts for the batch fileI don't get it. Why are a few batch file exercises "prompts"... Quote correction I gave simple and straight forward prompts that I ask you to interpret into batch script.I see. The program itself is a simple text editor that happens to be able to run the program via the SHELL. There are a few issues with this idea: -It's not new. Or revolutionary. I think a good portion of those who work with batch files and deals with other programming languages writes a batch file editor at some point. -It's text editing capability is limited. The only thing going for it is the ability to save and run the file via terminal, but you can setup notepad++, Editpad, Sublime text, and various other programs to do the same; they can also capture the output to a new window/text file. Those editors also have more versatile editing functions, options and syntax highlighting, too, line numbers, and (for some)code folding. -It really really seems like you are TRYING really hard to get somebody to do your batch file homework. Basically, while this is an interesting practice project, you aren't going to be proving that you can speed up the editing of Batch files since it doesn't really do so. Bugs and Issues: -if Defualt.bat doesn't exist in the current directory, an unhandled exception occurs. This is because you've accidentally doubled the slashes after the drive specification in the catch block. Additionally, the path is hard coded as C:\Program Files\BatPad. - the temporary file is never deleted. -Save acts as a Save As. Save As MENU option exists but is invisible. a Save option should only act like Save As if the text has no file, otherwise it should save to the same file. -the "Run" toolstripItem's image doesn't have a transparent background. -not visible running the program, but the code has a LOT of redundancies. I count at least 2 complete sets of the toolstrip event routines. -If you want to compete with Editpad, Notepad++, sublime text, etc- your undo/redo needs to be done with a stack. This may be beyond your capability in the shorter-term of the project (same with syntax highlighting) so I would suggest perhaps revising your goals for the project to something more attainable.I agree with pretty much everything that BC said. You should work on adding intellisense or syntax highlighting so that there is something that sets it apart from being a notepad with a button that shells a batch file. Also, since you are probably not using all of the features of .NET 4, you should probably change to .NET 2 or 3 so that XP users don't have to install anything to run it. A long time ago, when I first started programming in VB6, I made a program like yours except it was for vbscript instead of batch. Another thing that would be easy to do would be to create a set of command line programs in the same directory that could act as a sort of "highbrid" batch language that has certain commands that you implement. I know this sounds kind of junky, but you could even implement an "include" command that wouldn't actually be written to the outputted batch file, but would tell the program what exes to include with the batch to extend the language. Then when you "compile" the code, it could copy it into an executable ARCHIVE so it appears as if you made your own language lol. You probably shouldn't do that |
|
| 7643. |
Solve : DOS batch to identify and display the process currently using most processor tim? |
|
Answer» DOS BATCH to IDENTIFY and display the process currently using most processor time, once a second. |
|
| 7644. |
Solve : How to assign tasks to processors on one PC by Dos command?? |
|
Answer» For a PC with multi-processors, how to ASSIGN TASKS to specified processors by Dos commands? |
|
| 7645. |
Solve : colors? |
|
Answer» Is it possible to make a like a red SQUARE with either batch or powershell?Quote from: TheWaffle on May 14, 2012, 12:04:37 PM Is it possible to make a like a red square with either batch or powershell? You mean like the red square in downtown Moscow or the red square on my plaid shirt? Back in the old days, there was a DOS driver (ANSI.SYS) that allowed you to move the cursor around the screen and produce color characters. Don't know if anything like that still exists for NT batch. Powershell would be a better choice. Code: [Select]Add-TYPE -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing $brush = new-object Drawing.SolidBrush Red $pen = new-object Drawing.Pen black $rect = new-object Drawing.Rectangle 10, 10, 180, 180 $form = New-Object Windows.Forms.Form $formGraphics = $form.createGraphics() $form.add_paint( { $formGraphics.FillRectangle($brush, $rect) $pen.color = "red" $pen.width = 5 } ) $form.ShowDialog() I found this in the snippet closet, but suspect it came from the internet. Save script with a PS1 extension and run from a Powershell prompt. You can also run from a NT prompt by preceding the script name with the interpreter name (Powershell). Enjoy. Quote from: Sidewinder on May 14, 2012, 03:48:12 PM You mean like the red square in downtown Moscow or the red square on my plaid shirt? ... or the red square in the Martin Cruz Smith novel? I've been using Ansi Escape codes to change the background, foreground and text color, to make COLORED DOS menus for somewhere around 30 years. You have to first load the Ansi.sys driver and then know what escape codes to put into your text. This is just one example, of an Ansi color menu I did, for my ME Utilities, DOS, boot disk. Here's the "Menu.txt" file, for that screen. [1;33;44m CD Rom Drivers Are Loaded [41m Main Menu, Windows ME Utilities [44m 1. Fdisk (setup new hard drive) 2. Fdisk: Make New Boot Record 3. Format drive C: 3A. Format drive D: 4. Scandisk C: ( /autofix ) 5. Scandisk All Drives ( /all /autofix ) 6. Run "Scanreg /restore" (restores an older version of the Registry) 7. Delete WMIEXE.exe (this file, not needed by Windows) 8. Run HOOVER.bat (deletes 98, ME junk files) 9. REMOVE all files from "C:\_Restore\*.*" in Windows ME. Type your choice at the DOS prompt and press ENTER. This is just a text file, called by the Menu.bat, batch file when it's run. This is not MEANT to be a tutorial, which I'm not prepared to do, but just one example of what can be done. I'm sure you can find a good tutorial somewhere. Good Luck, You can also try the debug command on 32-Bit systems for a batch file.They have some interesting threads over on the Dostips.com forums about Color and Drawing Rudimentary graphics in pure batch.I personnally wanna see the Red Square from Moscow... |
|
| 7646. |
Solve : Display a the date & time when a file was last accessed? |
|
Answer» I need to display the date and time when a file was last accessed (not modified). I found several entries in this forum but I was not able to use any of them successfully. I was trying not to use an external program.LOOK at the help for the DIR command. You should see what you are looking for.You can parse the output of dir /b /ta [filename] using FOR /F and use the ~t delimiter to (in theory) get the last-accessed time like this... I tried what was suggested with the dir parameter, but in XP I get back a date that does not match any of the dates (creation, modified, accessed) displayed in the file properties. Isthere any other mean to get to it? Does it differ by much, or is it wildly off? However I think chasing access information is a waste of time. A quick Google told me that Dropbox will only sync the files in your Dropbox folder, which leads me to imagine that the Dropbox local client that is run on a user's machine must keep some kind of record of its own (e.g. changed hash*) to use when deciding that a file needs to be synced. It cannot reliably use filesystem last-access time, as a little thought would soon tell you. I already told you above that for FAT it only has a resolution of 24 hours (MULTIPLE access time changes on the same day are ignored) and in NTFS it can be WRONG for up to 1 hour after the access takes place and also in XP may be disabled by the user and is disabled by default on modern Windows. Finally and conclusively, a changed last access time is not a definite indication that a file has changed in any way. Maybe a change in the last write time might be, but not always. If you insist on chasing file time stamps*, to see the last write time for a file use dir /b /TW instead of dir /b /TA in the one liner I posted above. * I was right. I Googled "Dropbox file change DETECTION" (hint: had you thought of doing this?) and found that Dropbox splits each file into 4 MB blocks and creates a hash on each block. That way, if you change a contiguous 2MB of a 100MB file, it will likely only need to upload 4MB (or 8MB if you cross into a second 4MB block) to re-sync the file, thus saving bandwidth. To find out about file hashing, Google is your friend, but I would imagine that in order to duplicate the functionality of the Dropbox client in this regard you will have to learn some fancy programming tricks.Quote from: ventodibolina on May 12, 2012, 11:48:33 AM deleted comment uh huh... I understand your remarks, however I think I get what I need by using the DIR command which I found to partially work wit htis syntax: for /f "tokens=1" %%G in ('dir /TA "C:\filename.txt"') DO set attributes=%%G However by doing echo %attributes% I get only the last of 5 lines. How can I get the 3rd line which contains the access date? Quote from: ventodibolina on May 12, 2012, 11:40:36 AM Actually I need to check the same parameter that dropbox uses to decide if it must sync a file or not. I assume is the access parameter, because I have a Truecrypt file that even if opened does not show any change in the "modified" date/time field but it does for the "access" date/time.I have never used TrueCrypt but I am wondering if every time you open and close your TrueCrypt file does it reset the Archive attribute regardless of any files being changed inside the TrueCrypt file. And if this is true, does Dropbox look at the Archive attribute to sync?Quote from: ventodibolina on May 12, 2012, 06:07:00 PM I understand your remarks, however I think I get what I need by using the DIR command which I found to partially work wit htis syntax:Code: [Select]for /f "tokens=1" %%G in ('dir /TA "C:\filename.txt" ^| find "filename.txt"') DO set attributes=%%GSurely if Dropbox rehashes file blocks periodically to check if the local copy has changed from the one in the cloud, then the local file is being accessed and the access time will change, even if nothing has changed and no syncing needs to be done? This may not be possible in this instance, but...... When I worked for the county, I had to almost beat those old gals with a club to get them to do their daily and weekly data backups. So to put some teeth in it, I set it up to run the backup program from a batch file, and in the same batch file was a routine to read the date and time from the real time clock and add that info line to the end of a text file. Then all the supervisor had to do was read that text file with a HOT KEY combo, to get a detailed list of exactly when that backup program was run. That text file would continue to live till it was deleted, by the supervisor. It was a little devious, but it got the job done. Eh? |
|
| 7647. |
Solve : Trouble erasing files? |
|
Answer» Quote from: geoffl on August 04, 2012, 06:35:32 AM Using ntvdm in XP Both my solutions work in XP in a batch file running under cmd or command. I think you have typo'd something - they also work as far back as MSDOS V6.22 IIRC. When you say ntvdm, do you mean DosBox or do you simply click on a batch file and it runs in a CMD prompt? Or do you type COMMAND to open a command shell? It makes no difference as you have a solution - but the options I provided work just fine.To run my stuff I create an icon by new, shortcut, and load my com file. The .PIF it makes is different from the one you get if you load a .bat file. The .PIF has no shortcut tab - but allows you to load autoexec and config files. These differences I thought were running under XP or running under ntvdm. I have a device which will run under the second option but not the first so there must be a difference.If you have now got a solution for erasing all files without a prompt, my advice is don't worry about it. Thank you for your help. It is greatly appreciated. GeofflI love to take a tomcat to a dog show! In DOS and even in win-XP there is a LITTLE known command that MS has tried to forget that they ever wrote. It's "Deltree.exe" . It's a combination of the two words Delete and TREE, because that's exactly what it can do..."delete an entire tree structure". It will not run in Vista, Win-7 or Win-8. Add the /y switch and Deltree could delete an entire hard drive and never ask the dumb question "Are you Sure?". My secretary actually did that to me once....she was trying to erase some floppy disks and she forgot to put in the drive letter "A:". Deltree erased my hard drive, by default. For instance: deltree /y C:\*.* will delete an entire C: drive. deltree /y "C:\Windows\temp\*.*" will delete all the files and any sub-folders in the Windows\temp folder. deltree /y "C:\xyz.txt" would just delete the one file "xyz.txt" from the root directory of C: So it's either as general or specific as you make it with your syntax. I use it in my XPCleanup.bat program which cleans up all the junk in my Windows XP, C: drive, which I keep in FAT-32 format. I run that batch file from my desktop, from my Startup folder and from my GHOST boot disk. Cheers Mates! The Shadow Quote from: TheShadow on August 13, 2012, 03:23:31 PM It's "Deltree.exe" . It's a combination of the two words Delete and TREE, because that's exactly what it can do..."delete an entire tree structure". No, but RMDIR will, and RMDIR /S /Q C:\ does the same as DELTREE /y C:\*.*, doesn't it? http://www.infocellar.com/winxp/rmdir.htm Close, but no cigar! I can use Deltree to remove just one type of file, like .tmp from a large directory like Windows. I don't see any way to use the RD command to do that. There are many times when I don't WANT to remove a directory, just one file or one type of file in the directory. For just one file, I can always use the 'Delete' command. Oh well, TIME marches on and we must adjust accordingly. Thanks for all the input. The Shadow |
|
| 7648. |
Solve : batch script to copy and rename a folder that had contents in it? |
|
Answer» i need help with BATCH script to COPY and RENAME a folder thats has files in it with today date. |
|
| 7649. |
Solve : Can not format a mount point when the mount point has spaces in the name?? |
|
Answer» OK i had to create three partitions on a hardisk then mount them to a specific folder. i CREATED a bat file which will do this just fine. The problem is when i GO to format the Mount point one of them has a space in its name and format stops right there. |
|
| 7650. |
Solve : It shouldn't be this difficult...? |
|
Answer» Hello all, |
|