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.
| 2251. |
Solve : using dos to access hard drive? |
|
Answer» Hi |
|
| 2252. |
Solve : How do you input to a notepad document? |
|
Answer» i have created a batch file that will execute notepad but i don't know how to input text to the document. |
|
| 2253. |
Solve : combining text files? |
|
Answer» hi all, |
|
| 2254. |
Solve : Computername? |
|
Answer» HELLO, I WOULD like to know how to CHANGE the computer name USING MS DOS Thank You AlmnSorry , I meant in VScript AlmnCode: [Select]strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colComputers = objWMIService.ExecQuery _ ("Select * from Win32_ComputerSystem") For Each objComputer in colComputers err = objComputer.Rename("newName") Next Change newName to something appropriate. You must reboot for the change to take effect. Works only on the local machine. Curious: This script only works on the local machine, why not just do this manually thru the Properties of the My Computer icon? 8-) |
|
| 2255. |
Solve : telling my batch to return no error [Please Help]? |
|
Answer» how do i make nslookup not retun an error or anything but set it so that the COMPUTER's name is the only thing that displays (computer name needs to be a variable) bumpwhat actually is your main objective? I see what you are TRYING to do is doing reverse lookups..sometimes, you might not get the results, so catching an error of hostname not found is normal..so why do you need to "hide" the error?my batch asks for a range of ip then when it is pinging them it SAYS pinging %ip% but if the ip does not exist it will retune like a realy anoying error that is 4 lines longI thought DOSItMan explained how to split the output. There are TWO output data streams that commands can output to: |
|
| 2256. |
Solve : call batch file in shared directory? |
|
Answer» Is there a way to call a BATCH file in a shared directory on ANOTHER computer? |
|
| 2257. |
Solve : copy some folders to other location? |
|
Answer» Helo Not nearly enough information. What OS are you using? Are these folders subfolders of another folder? Do the names of these folders have characters in common. I have XP's. I like to copy different folders with subfolders and they are on the different locations. Example: I like copy folders with subfolders aaa (C:\temp\aaa) and bbb ( c:\home\....\..\bbb) and ccc (d:\service\ccc) to folder d:\backup. Thanks Personally I would just write a SEPARATE XCOPY for each of the folders. In the long run, it's easier to maintain should you have to make changes later on. Just a THOUGHT. 8-)Thanks But stil, is it some other way to do this? Best regardsThere is always another way to do things. I'm sure many of the folk here could write you a long and involved script to do just what you need. But WHY? The good folks at Microsoft (or was it IBM?) already wrote a utility to do exactly what you want. Sometimes the KISS method works best of all. 8-) NOTE: You don't get extra credit for doing things the hard way.Quote Note: You don't get extra credit for doing things the hard way. LOL. Sometimes I think this is exactly what this portion of the board is about! |
|
| 2258. |
Solve : creating a folder and naming it the current date? |
|
Answer» can a .bat file be used to create a folder and name it the CURRENT system date. I've tried several different COMMANDS, but no LUCK. I am trying to create a backup script that will create a folder on a local h.d., name it the current date, copy files to it, and send the new directory to a cd-rw. |
|
| 2259. |
Solve : batch-command to kill a running process?!? |
|
Answer» i've SEARCHED the entire internet and manuals and EVERYTHING for this, with no RESULTS.. does there exist a command that could close a running process? like "KILL appname.exe", eventually "KILL -f appname.exe" i've tried KILL, END, CLOSE, but none of them existed..did you use a search engine ? |
|
| 2260. |
Solve : Run Batch files in the tray?? |
|
Answer» With the batch files tutorial from this site I whipped up a little program that pings out then tells me if I'm offline (mainly because my [emailprotected]$& modem keeps dropping out). I've made this program run EVERY time the computer BOOTS but I've only been able to make it run as minimized, it'd be really nice to stash it in the tray, anyone know of a way I could do that?I don' think you can ACTUALLY put it in the tray bar however I know that you can totaly hide the filethen call an other program to TELL you that you are disconnected (I did that pprogram already). |
|
| 2261. |
Solve : How to add a date and time stamp within a log file? |
|
Answer» Gurus, |
|
| 2262. |
Solve : How do I find version of ms-dos prompt? |
|
Answer» [SIZE=16][size=14]How do I find my version of ms-dos, while running windows 98 in command prompt by typing command ver or ver/r, I do not get the dos version.Please if possible give me the answer at [emailprotected][/size][/size]windows 95, windows 98 and windows millenium are all shells running on top of DOS. but since MICROSOFT wants everybody to THINK of these OSes as graphical OSes independent from DOS the command.com in each of these OSes has been coded to give the windows version when you type ver. |
|
| 2263. |
Solve : %~n1 question? |
|
Answer» I'm trying to set right-click file options in Windows XP. I'm applying a conversion program to CONVERT DGN files to DXF. The command I have is... |
|
| 2264. |
Solve : How do I delete files older than a modified date? |
|
Answer» We upgraded to Microsoft SQL Server 2005 and that program does not allow me to specify the deletion of backup files with a modified date older than two days. We're running on Windows Server 2003. Can somebody give me the code example for deleting old files in a directory? (We don't want to delete all the files; just those older than two days.) |
|
| 2265. |
Solve : Help with batch file to delete mulitple folders? |
|
Answer» Hi all, |
|
| 2266. |
Solve : help with start? |
|
Answer» how do i ust the start command to start a command prompt and exicut a lot of LINES |
|
| 2267. |
Solve : MS-DOS commands not working in WinXP? |
|
Answer» I am playing with a batch file that deletes my files in my temp directories each time I log in to Windows. So far, it works ok using the DEL command (del "C:\Documents and Settings\dad\Local Settings\Temp\*.*" /F /S /Q), but this does not work for sub-directories in the temp folder, just files. In my testing, I determined I can use the RD or RMDIR commands (rd /S /Q "C:\Documents and Settings\dad\Local Settings\Temp") and it works great when in a DOS prompt (command prompt WINDOW), but it is not working when put in my batch file nor from the run line. The windows error says it cannot find 'rd'. Windows is right, there is no separate rd command. RD comes within the command.com. My question is: How do I get the RD command to work in the batch file? or What other command can i use in the batch file to get the desired results? deadw82000, No sure why it wouldn't work. I created a directory for testing called C:\Test\tmp and added folders and sub folders and files in each folder. Then I run a batch called x.cmd with the content: @echo off del "C:\Test\tmp\*.*" /F /S /Q rd "C:\Test\tmp" /S /Q pause And it correctly removed the tmp folder and everything in it. Having extensions enabled I got the following output: C:\Test>x.cmd Deleted file - C:\Test\tmp\a.txt Deleted file - C:\Test\tmp\aa.txt Deleted file - C:\Test\tmp\au.txt Deleted file - C:\Test\tmp\Document.txt Deleted file - C:\Test\tmp\u.txt Deleted file - C:\Test\tmp\1w2e3.default\Document.txt Deleted file - C:\Test\tmp\1w2e3.default\u.txt Deleted file - C:\Test\tmp\1w2e3.default\ua.txt Deleted file - C:\Test\tmp\1w2e3.default\uu.txt Deleted file - C:\Test\tmp\1w2e3.default\x.txt Deleted file - C:\Test\tmp\1w2e3.default\x1.txt Deleted file - C:\Test\tmp\1wed45.default\a.txt Deleted file - C:\Test\tmp\1wed45.default\aa.txt Deleted file - C:\Test\tmp\1wed45.default\au.txt Deleted file - C:\Test\tmp\1wed45.default\Document.txt Press any key to continue . . . If you think the command processor doesn't find the rd command then try starting a new one for the rd command, i.e.: [highlight]cmd /c[/highlight] rd "C:\Test\tmp" /S /Q Any luck?That was it. The command processor wasn't finding the RD command. Using the last line you posted, it worked like a charm. Thanks! So now this simple file that I have in my startup folder has 3 lines that automatically clean up all of my temp folders and temp internet files upon login. One more added line deletes my COOKIES. Too cool. cmd /c rd "C:\WINDOWS\Temp" /S /Q cmd /c rd "C:\Documents and Settings\dad\Local Settings\Temp" /S /Q cmd /c rd "C:\Documents and Settings\dad\Local Settings\Temporary Internet Files" /S /Q cmd /c rd "C:\Documents and Settings\dad\Cookies" /S /Q Maybe you can help me with the next step? I have multiple profiles on this system for each member of my family. Instead of having to create 5 separate batch files, modifying the 2nd and 3rd lines to identify the unique fully qualified path to the temp folders, then putting them in each respective startup folder in each profile, I know there has to be a way to make just one batch file that will apply to all. For the first line above pointing to the windows\temp dir, no modifications are needed. But for the 2nd, 3rd and 4th that include the user profile name, is there a variable I can use in place of the 'dad'? Maybe something where windows can identify the profile that is logging in and insert that name in the area in question to point the command to the correct location in each profile? I hope I am explaining that correctly. If this can be accomplished, this file can be used on any of my (or other peoples) computers with little to no modification. All they would need to do is put it in their startup folder. I could even make a self-extracting executable to extract it to a pre-specified folder (say c:\util) and then add a reg entry to the HKLM...Run folder to it invokes on any startup of windows (I may be getting ahead of myself here, but this part is relatively easy for me). First thing to solve is to make those 3 lines UNIVERSAL with a variable. Any ideas? I know this posting area is for DOS, so if I should post this in the Windows area, let me know. Thanks again! Howard |
|
| 2268. |
Solve : Copy files based on the hostname? |
|
Answer» Hi |
|
| 2269. |
Solve : Writing ANSI txt files instead of Unicode???? |
|
Answer» I have a BATCH file that EXPORTS some registry keys and values to a text file. Then I need to read the text file in via PHP, but the batch file writes the text file in Unicode, and PHP 5 doesn't SUPPORT Unicode (I can't switch to PHP6). |
|
| 2270. |
Solve : more help with computer name? |
|
Answer» ok oh do i get only the coputer name EX H-102 and set it as a varible this is what i have: |
|
| 2271. |
Solve : Batch file that enters in data to a program? |
|
Answer» hey guys, |
|
| 2272. |
Solve : newbie help? |
|
Answer» i booted off an ms-DOS boot floppy, |
|
| 2273. |
Solve : a batch file to get user input? |
|
Answer» i am not reinventing the wheel, but i believe the following is simpler than all the solutions i have seen so far, for the purpose of getting a string typed by a user into an environment variable. |
|
| 2274. |
Solve : Strip part of string? |
|
Answer» Hi, |
|
| 2275. |
Solve : Copy file to an unknown folder name? |
|
Answer» I am trying to copy a file to another directory from a batch file but the problem I am having is that part of the directory path will change. |
|
| 2276. |
Solve : Replace a file based on file version? |
|
Answer» Hello, |
|
| 2277. |
Solve : how do you go from msdos back to windows 98? |
|
Answer» I am not sure to get my computer to startup regular windows after using dos?assuming you are at the dos PROMPT that you get when you SELECT RESTART in msdos MODE, all you have to do is type exit and press entercd\windows |
|
| 2278. |
Solve : Windows 3.1 Install? |
|
Answer» WHen I load windows 3.1 onto a computer it tells me that it updates the Autoexec and config files. I can type WIN and launch into to windows but when I reboot the system will not load windows. WHen I load windows 3.1 onto a computer it tells me that it updates the Autoexec and config files. I can type WIN and launch into to windows but when I reboot the system will not load windows. Any windows 3.1 experts available.You've already got the answer. I guess you didn't like it? DOS has to be installed - all 3 disks. End of story.The following are the config.sys and autoexec.bat of a fairly typical Win311 UK based system. No CDROM drives, soundcards etc are loaded in this instance. Config.sys: Code: [Select]DEVICE=C:\WINDOWS\HIMEM.SYS /TESTMEM:OFF DEVICE=C:\DOS\EMM386.EXE NOEMS BUFFERS=15,0 FILES=30 DOS=UMB LASTDRIVE=E FCBS=4,0 DEVICEHIGH /L:1,12048 =C:\DOS\SETVER.EXE DOS=HIGH COUNTRY=044,,C:\DOS\COUNTRY.SYS DEVICEHIGH /L:1,15792 =C:\DOS\DISPLAY.SYS CON=(EGA,,1) DEVICE=C:\WINDOWS\IFSHLP.SYS STACKS=9,256 Autoexec.bat: Code: [Select]LH /L:0;1,45456 /S C:\DOS\SMARTDRV.EXE /X @ECHO OFF PROMPT $p$g PATH C:\WINDOWS;C:\DOS SET TEMP=C:\TEMP MODE CON CODEPAGE PREPARE=((437) C:\DOS\EGA.CPI) MODE CON CODEPAGE SELECT=437 LH /L:1,16656 KEYB UK,,C:\DOS\KEYBOARD.SYS MOUSE /S3 WIN A Windows 311 expert. I liked the answer. My DOS disk say 6.22 upgrade and I didn't know if that was the full version. Load the DOS 6.22 3 disk and then install windows 3.1. I will try this tomorrow, thanks for all your help.Quote I can type WIN and launch into to windowsThen you already have dos installed. Quote when I reboot the system will not load windowsThen you need to add win to your autoexec.bat as previously advised. Try typing ver at the dos prompt & hitting From a dos/311 dummy. Hey, I just installed windows 3.1, but when I rebooted into dos and tried loading windows, it said something about this version of windows is not compatible with the version of dos... is there anywhere where i can download a version of dos 3.1?Xarden, It is impolite to hijack someone else's thread rather than starting your own. You need DOS 5 or later, preferably 6.22 Try eBay for this. There are some KLUDGE and FreeDOS available but as you are asking for DOS 3.1 these solutions will obviously be beyond you. No legal downloads for Microsoft DOS exist.Sorry, but I had to have a small chuckle to myself. Why on earth would you want to install an oerating system that is no longer supported by Microsoft ?? I understand that some small/family business may still run 3.1, but I can't understand why they'd persist with it.Quote Why on earth would you want to install an oerating system that is no longer supported by Microsoft Why are you still writing batch files on a Windows machine? Because you can. Actually there are many hobbyists who keep their old machines, usually with the last upgrade in place. This is one way to leverage the hardware that you have. Ever try running XP on a 486? ANOTHER reason is cost. Not everyone can afford todays machines and software. The old software worked just fine, was less bloated, and cost a lot less. Personally I have an old IBM-286 (512KB RAM, 20MB disk) running PC-DOS 7 and Win 3.1. Even in my wildest dreams, I'm PRETTY sure it's not ready for XP or Vista. PS. I'm no accountant, but I'm pretty sure a small business can write off computers as a capital expense. Yeah .... Fair enough. Quote PS. I'm no accountant, but I'm pretty sure a small business can write off computers as a capital expense. As I understand it, in the UK, new computer equipment is 100% tax deductable.hi there i have ms-dos 6.22 and windows workgroup 3.11 install on my laptop which my laptop only works with it and i have couple questions 1. how can i get online with it i have ie 3.03 installed that comes with tcp/ip my laptop has pcmcia and the network card its a 3com 16-bit pccard 10/100base-tx the laptop is a HITACHI visionbook traviler 3000 series Don't ask why i have it and upgrade it for a better one (Quote:NO i like small pack laptops easy to carie and use) can anyone help me with the program if so you can contact me threw icq @ 337780200 Msn @ [emailprotected] Yahoo @ xcdrxdigitalchildxcdrx Aol @ x2xdigichildx2x any help will be breatfull thank youDigital404 - You might like to Google for Arachne - it might suit your purpose. Good luck |
|
| 2279. |
Solve : Converting OS from Windows to DOS? |
|
Answer» i need to convert my COMPUTER OS from Windows to DOS. |
|
| 2280. |
Solve : Batch file to copy folders + content? |
|
Answer» Hello all, been searching through posts but can't seem to find an ANSWER to my query which I'm sure some of you will look at and think 'what a wally'. I have basic batch file experience and have studied the Xcopy and Copy help files but still can't figure out a solution. :-? |
|
| 2281. |
Solve : geting remot computers name [plaese help]? |
|
Answer» How do i get the name of a remote COMPUTER??? How do i get the name of a remote computer??? some of the tools in WINDOWS that can be used are nbtstat (LAN), nslookup.. you can also find those GNU tools like dig that can query DNS and run them from windows ... i know i need to do this with a for loop but i can't quite figer out the for loops but i need it to return the name of the computer of the ip i set to a varable = name so it is like for nslookup %ip%|find /i name set = name but i need it only to select to ip when it does the find so if the name on ip = 135.1.65.7 test it would display test insted of name: test PLEASE HELP THINK YOU VERY MUCH can you try and see if this WORKS @echo off for /F "tokens=2 delims=: " %%i in ('nslookup %ip% ^| findstr /I name') do ( echo %%i set name=%%i )Or this: for /f "tokens=2" %%a in ('"ping /a /N 1 %ip%|find "Pinging""') do echo.%%a Quote can you try and see if this works ok now how do i make this not retun an error?? if the ip is not found :-? :-? :-? Perhaps place some ERRORLEVEL checking in there ? See attached list (it might help). for /f "tokens=2" %%a in ('"ping /a /n 1 %ip%|find "Pinging" [highlight]2>NUL[/highlight]"') do echo.%%a[/b] or @echo off for /F "tokens=2 delims=: " %%i in ('nslookup %ip% ^| findstr /I name [highlight]2>NUL[/highlight]') do ( echo %%i set name=%%i ) Like this? |
|
| 2282. |
Solve : Rookie-help needed!! (badly!)? |
|
Answer» HI to all of you who botherd to read this! I need som help. Lately I have been asked to help other people's computers (my classmate's computers to be exact, who happens to be even greater n00bs than I am), but since I dont have the liberty of walking around during class, I have to find other ways to help them. MSN messenger is altoo pointless since my mates doesn't understand crap of what I'm telling the to do, so I need an alternative way. It would be great if I could acsess my mates computers through the local network, almost like viewing their desktop in a new window or something. I've been told that you can do such thing through "CMD" or "COMMAND.COM", so I learned some commands, but I can't seem to find the right one.... can anyone please help me? I'm not sure about going through the command prompt, but I THINK there is a feature on the newer version of MSN messenger that allows you to share open programs between computers. But im not sure, so I'm going to look for yeh I have version 4.7 of MSN messenger, and there is a application sharing feature, but i dont know how helpful that will be to you. There is my 2 cents ....okay this didn't work at all..... if this is the only other option but trying to talk my mates into DEALING with their problems themselves, I might as well just do last mentioned..... But seriously! I've seen something in the direction of what I'm looking for, in real life! Some time ago, some guy from a different class opened a window on his desktop where he from which could control another PC. Please someone! I know this is possible, I just don't know what command or program I need to do this.... Anyone?.....*smacks head* yes there is something you can do in windows xp, remote desktop, you can turn it on by right clicking on my computer, clicking on properties, and clicking on the tab that says remote. see if this helps any... Remote Desktop overview With Remote Desktop on Windows XP Professional, you can have access to a Windows session that is running on your computer when you are at another computer. This MEANS, for example, that you can connect to your work computer from home and have access to all of your applications, files, and network resources as though you were in front of your computer at work. You can leave programs running at work and when you get home, you can see your desktop at work displayed on your home computer, with the same programs running. When you connect to your computer at work, Remote Desktop automatically locks that computer so no one else can access your applications and files while you are gone. When you come back to your computer at work, you can unlock it by typing CTRL+ALT+DEL. Remote Desktop also allows more than one user to have active sessions on a single computer. This means that multiple users can leave their applications running and preserve the state of their Windows session even while others are logged on. With Fast User Switching, you can easily switch from one user to another on the same computer. For example, suppose you are working at home and have logged on to the computer at your office to update an expense report. While you are working, a family member needs to use your home computer to check for an important email message. You can disconnect Remote Desktop, allow the other user to log on and check mail, and then reconnect to the computer at your office, where you see the expense report exactly as you left it. Fast User Switching works on standalone computers and computers that are members of workgroups. Remote Desktop enables a variety of scenarios, including: Working at home - Access work in progress on your office computer from home, including full access to all local and remote devices. Collaborating - Bring your desktop to a colleague's office to debug some code, update a Microsoft PowerPoint slide presentation, or proofread a document. Sharing a console - Allow multiple users to maintain separate program and configuration sessions on a single computer, such as at a teller station or a sales desk. To use Remote Desktop, you need the following: A computer running Windows XP Professional ("remote" computer) with a connection to a Local Area Network or the Internet. A second computer ("home" computer) with access to the Local Area Network via network connection, modem, or Virtual Private Network (VPN) connection. This computer must have Remote Desktop Connection, formerly called the Terminal Services client, installed. Appropriate user accounts and permissions. or you could goto start>run>type in mstsc and do that that will do exactaly waht you are looking for!! |
|
| 2283. |
Solve : Help with XP Startup Bat File? |
|
Answer» FIRST POST, so go easy on me Guys Sorry if this falls below the NORMAL standards.......but I am very new to this and need big help This batch file:- cd c:\PROGRAM files\Program 1 DIR start /wait Program 1 cd C:\Program Files\Program 2 DIR start Program 2 exit Is to resided in my XP startup folder. When windows boots it is suposed to run the first program......wait until it is completed.......then run the second program. What it actually does is run the first program then halts, with the DOS box left open :-? I've tried substituting Call for Start, but still can't get it to function correctly. Can someone help wizz Quote When windows boots it is suposed to run the first program......wait until it is completed.......then run the second program.Code: [Select]cd /d "c:\program files\Program 1 DIR" Program 1 cd /d "C:\Program Files\Program 2 DIR" Program 2 exit You can change both the drive and the directory with a cd command provided you use the /d switch. While start and call have their uses, you don't need them for simple program calls. Hope this helps. 8-) Welcome to the Forum I don't see where the problem is ? The black scren still open means that it is waiting. AlmnQuote QuoteWhen windows boots it is suposed to run the first program......wait until it is completed.......then run the second program.Code: [Select]cd /d "c:\program files\Program 1 DIR" Thanks for the response. Unfortunately this still does not work. Exactly the same thing happens...the first program ( a dot.net application ) executes then the script stops leaving the dos box open. Only when I close the first program does the rest of the script run and complete. Any idea what is happening :-? Quote Welcome to the Forum That is the problem. I need it to run the second program after the first has executed.....but it doesn't. It just sits there waiting with the dos box open. Wizz It's like pulling teeth. Gonna guess this .net program either has an exit button or the user must click on the X in the upper right hand corner to end the program. The batch file is doing exactly what it's supposed to do. By introducing interactive programs into the mix, the batch file will wait until the user ends program 1 before cranking up program 2. There is no error here; everything is operating as documented. 8-) Quote It's like pulling teeth. Gonna guess this .net program either has an exit button or the user must click on the X in the upper right hand corner to end the program. The batch file is doing exactly what it's supposed to do. By introducing interactive programs into the mix, the batch file will wait until the user ends program 1 before cranking up program 2. So how do I get the second program to load as well :-? Both programs need to be running. HELP !Quote When windows boots it is suposed to run the first program......wait until it is completed.......then run the second program. Quote So how do I get the second program to load as well Huh Both programs need to be running. HELP ! So which is it? You want both programs running at once? or do you want them to run sequentially? To run both programs at once use the start command without the wait switch for both programs. Both programs will crank up, run in two separate windows, and most importantly run independently of each other. No need to go over the sequential thing. You've already got that; end program 1 and program 2 cranks up. 8-)Sorry...I'm not trying to confuse you on purpose. I need to have both programs running, BUT, the first program must be fully loaded before the second one loads. I DO know the first program takes 11 seconds to load so perhaps there is a way a timer could be used ? The reason I need this is because if the second program loads too soon the complete process is un-sucessful. If I manually start the first program.......wait 11 seconds.....then manually start the second program all is well. All I am trying to do is automate this sequence via XP's startup folder. Hope that explains my aim more precisely. Have you any ideas how I can achieve this ? wizz PS: Many thanks for your efforts, they are greatly appreciated In that case I would simply write a VBScript and be done with it: Code: [Select]Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "c:\program files\Program 1 DIR\Program 1.exe" WScript.Sleep 11000 ' 11 sec delay WshShell.Run "c:\program files\Program 2 DIR\Program 2.exe" Save script with vbs extension and run as wscript scriptname.vbs Note: the time delay is in milliseconds. You can play around with the TIMING factor. You could do this in batch also; WinXP does not ship with choice so unless you saved a copy from a previous edition of Windows, you'd use ping for the time delay. Ping is not as accurate as sleep. 8-) With any luck, this will put this post to sleep. Quote Sorry...I'm not trying to confuse you on purpose. another way to do it is to separate the 2 programs into different batches. you could schedule them more than 11secs apart to run. After first program runs successfully, it will create a "done" file, just to indicate that it runs successfully. your second batch will check for this "done" file, and start running the second program if its there. Quote In that case I would simply write a VBScript and be done with it: OK, Thanks. How do I run the vbs file from XP startup. Do I just place it in there or do I need to do anything else. Appologies again, but I did tell you I am a complete novice when it comes to scripting. So please bear with me. wizz PS: when I run this script from my desktop, I get this error Script phoco.vbs Line 2 Char 1 Error The system cannot find the file specified Code 80070002 Source (NULL) Either create a shortcut in the startup folder or if you want to test it from the Windows Run box, run it as wscript drive:\path\scriptname.vbs. The drive and path need to be actual values. Open up the startup folder; RIGHT click an empty space within the folder==>New==>Shortcut. Fill in the values as requested. Note the actual program you are running in c:\widows\system32\wscript.exe The fully qualified name of the script is passed along the command line to wscript. You can use %windir% as the startup directory. Amazingly enough, you can write a vbscript to create the shortcut. 8-) |
|
| 2284. |
Solve : Copying folders...? |
|
Answer» Okay, here's the problem. I was fooling around with the adding admins and removing admins, and somehow I had removed my own user account in XP. Problem is, is that I lost all of my music, huge amounts of source code, games, and other stuff in my folder. Sure, I can get it back, but WINDOWS now says the file is RESTRICTED, so I can't touch anything inside it. I've tried installing different linuxes, and I couldn't touch the drive because it was NTFS. I FIGURED I'd do it through DOS. |
|
| 2285. |
Solve : Run command? |
|
Answer» Any clues to as why on some pc's I can issue the "run waitsecs" command and OTHERS say "run" is not RECOGNIZED. It works on my office pc, running xp PRO, but not my HOME pc. I've seen it work on 2000.In case your WONDERING, it's for a batch file.Nevermind, I figured it out. |
|
| 2286. |
Solve : .bat file ? - Run several cmds concurrently?? |
|
Answer» Greetings, |
|
| 2287. |
Solve : Copy with wildcard? |
|
Answer» I have multiple files with very similar names in a folder and would LIKE to be able to pick a specific file by using CHARACTERS in the middle of the file name and copy that file to a DIFFERENT folder using the copy command in a .bat file. I have multiple files with very similar names in a folder and would like to be able to pick a specific file by using characters in the middle of the file name and copy that file to a different folder using the copy command in a .bat file. hmm ... how about this : copy 20060430*326188* |
|
| 2288. |
Solve : Start program at a thime? |
|
Answer» I'm not sure if I'm in the right section, but I want to start a program at a specified thime. That's easy, you think, just use sceduled task and the programm will be runned at the specified time. But it does NOT. The programm that I'm tealking about is: "bitcommet". If I set that program location in sceduled task, it don't work. So perhaps someone can help me with a BATCH file, that count down to 12 o'clock (midnight, because then I want to start my download) don't think bitcomet has scheduling . Another client, utorrent, has scheduling I don't search schudeling in the program itself (because I know that doesn't exist) but I search... well.... actually read my question again....How are you scheduling the bitcommet program? Why is the scheduling failing? Counting down to midnight is not really a solution. If you gave us more info, we may be able to help you get this job scheduled. 8-)Quote How are you scheduling the bitcommet program? Why is the scheduling failing? Counting down to midnight is not really a solution. If you gave us more info, we may be able to help you get this job scheduled. I've used windows sceduled task manager. START => control panel => planned tasks (sorry for saying this in this stupid way, but I don't know the correct term...) I don't get anny error, but nothing happens... Every time I added a task, nothing happed. I'd liked to see that it STARTS.... (perhaps with countdown time, witch the choice command to enter how much time...) P.S. I'm RUNNING winxpThe easiest way to schedule a task, is as you're doing. When the Scheduled Tasks folder opens, click on Add Scheduled Task and follow the prompts. One reason jobs don't run as scheduled is the Run Only If Logged On box is not checked or if it's not, the Set PASSWORD box has not been filled in. I find it easier to check the Run Only If Logged On Box and forget about the password. It's your choice. You can also schedule a job using the AT command. The AT command has it's own set of API's and should not be confused with the Windows Task Scheduler. 8-)that worked, thanks for helping, sidewinder!So how do you do it exactly ?? does the command promt have to be open ? Almn |
|
| 2289. |
Solve : Possible to disable/enable lpt1: from DOS prompt?? |
|
Answer» Is it possible to disable and ENABLE lpt1: from a DOS prompt? I have a touchy printer driver that REFUSES to work after a computer has been shut down unless this PORT is disabled and then enabled from the device manager. Is there a command prompt equivalent to this action (so I could make a batch FILE)? Or am I stuck up a river.... |
|
| 2290. |
Solve : please help dont know what to call this??? |
|
Answer» ok i have a variable the the user will input with a line after it like so |
|
| 2291. |
Solve : remote computer? |
|
Answer» How can i find remote COMPUTER name which i KNOW its IP in DOS /CMD (like PROJECT r3XI don't think that is possible, but I MAY be wrong,try the "net " COMMAND it might help you . |
|
| 2292. |
Solve : Executing bat on server2 via server1 from PC? |
|
Answer» I need to give users the ability to execute a batch file on a remote server. Server1 is publicly accessed while SERVER2 is secured and can only be accessed by Server1. I created copy .bat files on server1 that copy files from FOLDER to folder on server2 but when executing from PC it looks for the I: drive referenced in the server1 bat file on the PC INSTEAD of server1. Is there a work around?Perhaps this LINK might be of some USE... |
|
| 2293. |
Solve : plaese help time %time:~0,-6%? |
|
Answer» why does this come out with no 0 and just a SPACE i WANT it to be it the format 00:00 now it is like this ps _=space _2:24 for example please show me how to make this come out in a 00:00 format. example 02:24Quote why does this come out with no 0 and just a space i want it to be it the format 00:00 now it is like this ps _=space _2:24 for example please show me how to make this come out in a 00:00 format. example 02:24 in my machine, when i do echo %time% , it is like this 18:45:48.76 so echo %time:~0,-6% gives me 18:45. It works alright for me. i am not sure about your time settings. hope someone can help you with that. One of the quirks with %time% is that all times before 10 AM contain a leading space. Using the KISS method might lead you to this solution. Code: [Select]for /f "tokens=1-2 delims= " %%i in ('time /t') do echo %%i Good luck. 8-) Or try: set t=%time: =0% set t=%t:~0,5% echo.%t% Check to ensure that your Regional Time Setting is set to HH:MM:ss instead of h:mm:ss tt (or similar). This negates the leading space space for HOURS of 1 thru 9. Then if you do: C:> echo %time:~0% [Enter] 23:34:07.51 {your current time} -and- C:> echo %time:~0,-3% [Enter] 23:36:36 {your current time} -and- C:> echo %time:~0,-6% [Enter] 23:33 {your current time} |
|
| 2294. |
Solve : Options? |
|
Answer» Hello I would like to set options for when I set my batch file,for EXAMPLE "stinger" can be ran with the log option wchich creats a log well I would like to do the same. |
|
| 2295. |
Solve : batch file command needed? |
|
Answer» I need a command by which i can open and close my cd-rom with the help of a batch fileIf you have Nero Burning rom on your machine, you can use its commands. |
|
| 2296. |
Solve : how do i put a space in my output of a file? |
|
Answer» how do i put a space in my output of a file |
|
| 2297. |
Solve : Backing up data? |
|
Answer» I am trying to create a batch file to back up data OLDER than a certain date. Does anyone know how to manipulate dates? if you don't mind getting other tools, you can try xxcopy http://www.xxcopy.com/index.htm Thanks. I would PREFER to do it myself but I'll take a look! Thanks again.well..if not, maybe you could look at xcopy. There is an option /D:m-d-y Copies files changed on or after the specified date. If no date is GIVEN, copies only those files whose SOURCE time is newer than the destination time. Guess you could manipulate the m-d-y portion....doing the SUBTRACTING of 7 days or something...just an idea... good luck playing with dates.Quote well..if not, maybe you could look at xcopy. There is an option Thanks, that is what I have been looking at so hopefully I am on the right track!! DATE /T >> y:\backuplog.txt set day=%date:~0,3% set month=%date:~3,3% set year=%date:~6,4% set yankDate=%month%%day%%year% >> y:\backuplog.txt xcopy "c:\Documents and Settings\markj" y:\ /D:%yankdate% /C /Y /I /E >> y:\backuplog.txt |
|
| 2298. |
Solve : Batch File System Time condition...? |
|
Answer» I have a batch file in my Startup folder. The batch file opens an excel file that copies files. Can I add a condition in the batch file that only opens the excel file if the system TIME is between 2:00am and 4:00am. If I have to reboot the PC because it locks up, ETC., I don't want the script to run. I see where you reference 'i' in the first line, but where do you reference 'j'?because of the "tokens=1,2", %%i will get the first token, %%j will get the second token. For more information, type for /? Quote Also, I assume 'EQU' is 'equal to'. Are there corresponding values for 'greater/less than'?YES, please look up help page for "if" by typing if /? on the command line. |
|
| 2299. |
Solve : batch to exe - work in unix?? |
|
Answer» Hello, |
|
| 2300. |
Solve : Encryption detection? |
|
Answer» Hello, Hello, for a start , you could download the fciv utility from microsoft and play with it. here's a link http://support.microsoft.com/?kbid=841290Thanks it helps But it still doesn't tell me how to search my computer for a specific MD5 Hash,however I wonder if it would be possible to create a list of file with the hash and then save it into a txt file,then finaly look for the string (which would be the hash ) in the txt file. Any help apreciated AlmnAll of the programs that I found for computing MD5 values do just that ... compute. You would have to write a batch or any other kind of script or even a whole program to search for a specific value. FCIV has a recursion switch, which should allow you to scan a whole logical disk. You might be able to get away with a simple batch file, filter the MD5 value from FCIV thru FIND and use a few IF statements to determine if you found the one you're looking for. Just a thought. 8-)Quote Thanks it helpsif you have read the link i provided, it shows how to use fciv. First, get a base line of the MD5 of the files you want to check into an xml database... eg fciv -xml baseline.xml baseline.xml will contain all the "good" hashes of your files. then, you can do up a batch to periodically verify the files against this database eg fciv -V -xml baseline.xml something like that.....play around with fciv, PURPOSELY do some changes to the files and use fciv -v to verify ... i am sure you can come up with something .... So far I haven't came up with anything I didn't get what you said in your previous post ,can you clarify it ? Thanks AlmnAlso the thing is I am not only looking for one MD5 Hash it more of a list. : :-/ AlmnQuote So far I haven't came up with anything MD5 is used to check the integrity of files and directories to see if there are changes to it. I suppose what you want to do is to check integrity of your files/dir? if it is, you can use fciv. fciv does the comparison for you...saving you the trouble of writing ur own comparison routine.. eg fciv C:\somedirectory -xml baseline.xml the above will save a copy of all the hash values of the files in C:\somedirectory into an xml file called baseline.xml then you can create a batch file to run the verification check eg fciv -v -xml baseline.xml If a file in the directory is modified since the last time its MD5 is saved, the command above will flag out something like this List of modified files: ----------------------- C:\somedirectory\file.txt Hash is : c5b50031e07ba7584a475b1dadc92236 It should be : 692dd3d38ab57537e41492833cd0f261 So by looking at this output, you know that file.txt has changed. Well not in my CASE, I am suing MD5 only to look for a certain file for which I have the Hash. AlmnQuote Well not in my case, I am suing MD5 only to look for a certain file for which I have the Hash.your previous post said you have a list of files that you want to check the md5 for...or am i misinterpreting your question...anyway...so since you have the hash of the file, you can verify whether its the same as the hash you have. using fciv: c:\> fciv yourfile.txt // // File Checksum Integrity Verifier version 2.05. // 4e28d665adb6c66e52a213307de50069 yourfile.txt you can use the above results to check against the hash that you said you have.. if they are the same, then the file's integrity is intact. just an example on checking a file: @echo off set yourmd5hash=df0531fe956952da64ae6972ad2330f6 for /F "tokens=1 delims= " %%i in ('fciv yourfile.txt ^| findstr yourfile.txt') do ( set md5hash=%%i if not %md5hash% == %yourmd5hash% echo "Integrity compromised!" ) ok ,now how about just LOADING the hash into a variable like "md5" then I can compare ,on the other hand I would like to check the hash of the next file after I am done checking the first. Rem getting the hash into a variable rem comparing it if %md5%=5d41402abc4b2a76b9719d911017c592 ( echo found a %the file corresponding to the hash% ,including the directory rem there load the next file and start the process over. ) else ( rem start the process over again with an other file ) Little confusing but I have faith Thanks Almnit's not confusing at all... what you are trying to do is what the fciv command can do for you..you want to check the hashes of files one by one against a set of hashes that you already have. And where do you get these set of hashes that you have in the first place? you have to generate the hashes of those files and then save it for future checking . so that's where the following command c:\> fciv -xml comes in.... It helps you to generate a set of hashes of your files and save it somewhere (database.xml) then Code: [Select]if %md5%=5d41402abc4b2a76b9719d911017c592 ( echo found a %the file corresponding to the hash% ,including the directory rem there load the next file and start the process over. ) else ( rem start the process over again with an other file ) the above part of your code can be done by fciv too.. c:\> fciv -v -xml database.xml It goes over the files in the database and check the hashes for you...you do not need to code your own comparison routine... Unless your purpose is to improve your skills in batch progamming ghostdog74 the set of hash I got from my computer with the file but the batch is going to run on an other computer and probably changed names But thanks anyway Almn |
|