Solved

login script to add desktop icons won't add folder

Posted on 2004-10-15
8
224 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
  • 5
  • 3
8 Comments
 
LVL 22

Expert Comment

by:Bartender_1
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:
Bartender_1 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
 
LVL 22

Expert Comment

by:Bartender_1
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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:Bartender_1
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:Bartender_1
ID: 12322483
Thanks for the points!

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

Cheers!

:o)

Bartender_1
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
A Short Story about the Best File Recovery Software – Acronis True Image 2017
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now