?
Solved

login script to add desktop icons won't add folder

Posted on 2004-10-15
8
Medium Priority
?
230 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 2000 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

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…
What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

770 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