Jump to content

Recommended Posts

Posted

Hello, I'm having som problems with for loops when scripting.

The following:

test.cmd

@echo off
for /D %i in ("c:\Documents and Settings\*") do dir "%i\Application Data\Microsoft\Internet Explorer\Quick Launch"

Returns:

Unexpected \Documents

Oh, I'm not trying just to list the files it's just a test. What I'm trying to accomplish is to copy some shortcuts to all users quick launch, so if someone knows of a better way, please tell me.


Posted

If your system drive is C:\, then have a look here:

C:\WINDOWS\system32\config\systemprofile\Application Data\Microsoft\Internet Explorer\Quick Launch

All shortcuts I throw into "Quick Launch" at T-13 (SVCPACK.INF) are put there. Being put there, they get copied to the "Quick Launch" of every user afterwards.

Likewise, all shortcuts I delete from "Quick Launch" at T-13, will not be present in the "Quick Launch" of any user.

The same is true for SendTo, too:

C:\WINDOWS\system32\config\systemprofile\SendTo

So, I suggest you do the shortcuts thing at T-13.

Well, I think this could be done at T-12, too.

Posted

To fix your code:

@echo off
for /D %%i in ("c:\Documents and Settings\*") do dir/b "%%i\Application Data\Microsoft\Internet Explorer\Quick Launch" 2>nul

or tidied up a little

@ECHO OFF
FOR /D %%? IN ("%ALLUSERSPROFILE%\..\*") DO (DIR/B/A "%%?\APPLICATION DATA\MICROSOFT\INTERNET EXPLORER\QUICK LAUNCH" 2>NUL)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...