Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch file command?
Name: rm3sweet Date: November 5, 2005 at 09:33:49 Pacific OS: windows xp home edition CPU/Ram: amd 1600+
Comment:
What I'm trying to do is create a batch file command that (cd) changes the directory for which it performes a task without knowing the path.
example: "cd c:\documents and settings\%allusers%" Then automatically change to that directory. example: cd c:\documents and settings\%user1% then: cd c:\documents and settings\%user2% This is to accomplish a task in each unknown path such as "del" or "rd".
Name: Mechanix2Go Date: November 5, 2005 at 09:52:36 Pacific
Reply:
Try this:
:: chgr.bat @echo off
:main
pushd "C:\Documents and Settings for /f "tokens=* delims=" %%U in ('dir /ad /b') do call :users %%U popd goto :eof
:users
cd "%*" :: :: your command[s] go here cd .. :: DONE
If at first you don't succeed, you're about average.
M2
0
Response Number 2
Name: Dr. Nick Date: November 5, 2005 at 23:10:35 Pacific
Reply:
Huh.
Never heard of the pushd/popd commands. Learn something new every day :)
(Though I've started moving away from batch files to WSH. Highly anticipating Monad ;)
0
Response Number 3
Name: Mechanix2Go Date: November 5, 2005 at 23:23:15 Pacific
Reply:
Monad?
If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: Dr. Nick Date: November 5, 2005 at 23:28:20 Pacific
Reply:
The codename for MSH - Microsoft Scripting Host. It's like bash scripting for Windows, but on steroids. Going to be available for XP, 2003, and Vista. You can actually already download the beta version, info at the Channel9 Wiki.
Summary: Hi, I need some help with the batch file commands; I have an 'invoice' directory which will have files with below names. IMPORT_INVOICE_FILEfsbc.20080108.0500368 IMPORT_INVOICE_FILEcount.sbc.2008...
Summary: Hi M2, @echo off for /f "tokens=*" %%I in (IPlist) do call :pinger %%I goto :eof :pinger echo %TIME% >> pingLOG ping %1 >> pingLOG :: DONE I am using the above batch file command to ping list of 60ser...
Summary: I'm writing a java program that will take info from the command line and i'm required to make a batch file so that we dont need the java ... clause I'm not very familiar with Dos, what i need from the...