Solved

login script to add desktop icons won't add folder

Posted on 2004-10-15
8
229 Views
Last Modified: 2010-04-14

I have a login script on my w2k domain mapping network drives and it also calls a command that adds icons to the desktop.

i almost have it right but it will only add files and not a folder.
this is the command that runs

copy H:\desktopicons\folder\* "%USERPROFILE%\desktop"

it is working right except that it won't add a folder

Please help
0
Comment
Question by:kylemorgans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 22

Expert Comment

by:Christopher McKay
ID: 12321842
add a line to your script that creates the folder if it doesn't already exist:
if not exist "c:\%userprofile%\desktop\<foldername>" md "c:\%userprofile%\desktop\<foldername>"

Hope this helps!

:o)

Bartender_1
0
 
LVL 22

Accepted Solution

by:
Christopher McKay earned 500 total points
ID: 12321854
Or you could just use the xcopy command instead of the copy command:

xcopy H:\desktopicons\folder\* "%USERPROFILE%\desktop"


Not sure why I didn't think of that first. ~LOL~

:o)

Bartender_1
0
 

Author Comment

by:kylemorgans
ID: 12321954
i tried the xcopy command and that disn't seem to work

but i am working on making it create the folder but i might need a lil more help with that
 
thanksa
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 22

Expert Comment

by:Christopher McKay
ID: 12321996
Have you tried the xcopy command with the /e switch?

xcopy H:\desktopicons\folder\* "%USERPROFILE%\desktop" /e

(This forces xcopy to copy the directory even if it's empty)

:o)

Bartender_1
0
 

Author Comment

by:kylemorgans
ID: 12322190
the /e switch works

do  u know how to have the folder be deleted when the user logs off and then with they log back on to create the file again .   the /e command asks them if they want to overwrite the file when they log back in and that isn't good for the users u know?
0
 
LVL 22

Expert Comment

by:Christopher McKay
ID: 12322366
You could use the /y switch to suppress the "do you want to overwrite" message, and automatically overwrites:

xcopy H:\desktopicons\folder\* "%USERPROFILE%\desktop" /e /y

You would need to create a log off script to delete the directory, if you don't wish to use the "/y" option.

:o)

Bartender_1
0
 

Author Comment

by:kylemorgans
ID: 12322447
perfect thanks man
0
 
LVL 22

Expert Comment

by:Christopher McKay
ID: 12322483
Thanks for the points!

I'm glad I was able to be of assistance.

Cheers!

:o)

Bartender_1
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question