Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Wrong script

Posted on 2007-03-20
23
Medium Priority
?
424 Views
Last Modified: 2008-01-09
What's wrong with the following script?
copy \\server\roommaster\rsw5main.exe %userprofiles%\desktop
{where server = server name, roommaster = apps folder, rsw5main.exe = exe file}
I don't know %userprofile% should be written as is or differently.
0
Comment
Question by:lcipollone
[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
  • 8
  • 8
  • 4
  • +1
23 Comments
 
LVL 11

Expert Comment

by:AnthonyP9618
ID: 18761503
Is this something that should be on every users desktop?

copy \\server\roommaster\rsw5main.exe C:\cpuname\c$\Documents and Settings\All Users\desktop

where CPUNAME is the name of the computer you're targeting...
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761545
the variable is more like this

c:\documents and settings\%Username%\

What are you trying to do here?
0
 

Author Comment

by:lcipollone
ID: 18761565
Trying to place a shortcut on every workstation
0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761567
copy \\servername\roommaster\file.exe c$\documents and settings\%Userprofile%\Desktop

that would copy to the currently logged on user
0
 
LVL 48

Accepted Solution

by:
Jay_Jay70 earned 252 total points
ID: 18761573
oh i see, do you have roaming profiles in use?
0
 

Author Comment

by:lcipollone
ID: 18761585
yes
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761593
copy \\server\roomaster\filename \\Server\Sharename\%Username%\Desktop
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761594
grrrr ignore that had a blank   two secs...
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761610
i dont know how to make that loop but if you add it to a logon script it will work
0
 

Author Comment

by:lcipollone
ID: 18761653
i don't know why but none of these examples work. Any other ideas?
0
 
LVL 96

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 248 total points
ID: 18761706
QUOTES!

copy "\\server\roommaster\rsw5main.exe" "%userprofile%\desktop"

(It's also %userprofile% - NOT %userprofiles% as your original posting had it.
0
 

Author Comment

by:lcipollone
ID: 18761800
None of these are working. Frustrating>>>> Maybe i'm doing something wrong..
Please take note of the following:
RoomMaster folder is located:    C:\Program Files\roomMaster\rw5main.exe
User proflies folder is located:    D:\profiles (this is a all shared folder)
Does anything here make a difference?
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761825
roommaster is shared isnt it?
0
 

Author Comment

by:lcipollone
ID: 18761843
yes
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 18761850
Can you post the EXACT error when you execute the command I posted?
0
 

Author Comment

by:lcipollone
ID: 18761858
i do not get any errors. the shortcut just does not show up on the desktops
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18761885
this is relating to your other Q where roaming profiles isnt working - check the actual direcoty for the file
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 18761899
You're not copying a shortcut - you're copying a program.

How are you running the script/command?  Just double-clicking an icon?  What?  Open a command window (cmd.exe) and run it from there manually.  it will return an error message.  
0
 

Author Comment

by:lcipollone
ID: 18762020
I'm totally lost. I'm not good at scripts.
This is the script i have on my server.
RoomMaster folder is located:    C:\Program Files\roomMaster\rw5main.exe
User proflies folder is located:    D:\profiles (shared folder)

@echo off
IF %COMPUTERNAME%.==SERVER.GOTO end
NET USE R: /DELETE
NET USE S: /DELETE
NET USE T: /DELETE
NET USE R: \\SERVER\roomMaster /YES
NET USE S: \\SERVER\SharedDocs /YES
NET USE T: \\SERVER\rmBackup /YES
copy "\\server\roomMaster\rw5main.exe""%userprofile%\desktop"
NET TIME \\SERVER /SET /YES
:end

Do you see anything wrong with it?
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 18762087
There's no space between the quotes -
copy "\\server\roomMaster\rw5main.exe""%userprofile%\desktop"

Should be

copy "\\server\roomMaster\rw5main.exe" "%userprofile%\desktop"
0
 

Author Comment

by:lcipollone
ID: 18764932
Finally that worked. The only problem is that its copying the exe and not placing the shortcut onto the desktop.
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

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found listed in my profile here: http:…
Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

704 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