Creating shortcut via script

  • Thread starter Thread starter John
  • Start date Start date
J

John

Guest
Hi

Is there a way to use a batch file or script to do the following;

1. Create a folder X

2. Copy a file form another location to folder X.

3. Create a shortcut to copied file in folder X on the desktop?

If batch or script can not do this, is there another way?

Thanks

Regards
 
Re: Creating shortcut via script

Hi

A couple of additions to the last questions.

How can I

a. Add a specific icon (world icon) form the
%SystemRoot%\system32\SHELL32.dll to the created shortcut?

b. Any way to scan all icons on the desktop and if any shortcut already has
the world icon to change it to something else form
%SystemRoot%\system32\SHELL32.dll ?

Many thanks. Sorry for all the questiosn but I am new to this.

Regards

"John" <info@nospam.infovis.co.uk> wrote in message
news:udTdb01IJHA.5900@TK2MSFTNGP02.phx.gbl...
> Hi
>
> Is there a way to use a batch file or script to do the following;
>
> 1. Create a folder X
>
> 2. Copy a file form another location to folder X.
>
> 3. Create a shortcut to copied file in folder X on the desktop?
>
> If batch or script can not do this, is there another way?
>
> Thanks
>
> Regards
>
>
>
>
 
Re: Creating shortcut via script

"John" <info@nospam.infovis.co.uk> wrote:

>Hi
>
>Is there a way to use a batch file or script to do the following;
>
>1. Create a folder X
>
>2. Copy a file form another location to folder X.


These two are easy of course. mkdir to create a folder, copy to copy a
file into it.

>3. Create a shortcut to copied file in folder X on the desktop?


That's hard. A Google search turns up this:
http://www.xxcopy.com/xxcopy38.htm. That page describes XXMKLINK which
they claim will create a shortcut from the command line. There's a
link at the bottom of the page to download the tool, which is free.
All I know about it is what's on that page, I've never used it.

--
Tim Slattery
MS MVP(Shell/User)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
 
Re: Creating shortcut via script

Xxcopy doesn't work with SP3.

Yet.

Is it fixed now?


"Tim Slattery" <Slattery_T@bls.gov> wrote in message news:ika7e4pe8oikr523j8l4rli5m0er93ifr1@4ax.com...
> "John" <info@nospam.infovis.co.uk> wrote:
>
>>Hi
>>
>>Is there a way to use a batch file or script to do the following;
>>
>>1. Create a folder X
>>
>>2. Copy a file form another location to folder X.

>
> These two are easy of course. mkdir to create a folder, copy to copy a
> file into it.
>
>>3. Create a shortcut to copied file in folder X on the desktop?

>
> That's hard. A Google search turns up this:
> http://www.xxcopy.com/xxcopy38.htm. That page describes XXMKLINK which
> they claim will create a shortcut from the command line. There's a
> link at the bottom of the page to download the tool, which is free.
> All I know about it is what's on that page, I've never used it.
>
> --
> Tim Slattery
> MS MVP(Shell/User)
> Slattery_T@bls.gov
> http://members.cox.net/slatteryt
 
Re: Creating shortcut via script

Please don't answer with non-answers. Totally useless.


"Plato" <|@|.|> wrote in message news:48e49717$0$12781$bb4e3ad8@newscene.com...
> ju.c wrote:
>>
>> Xxcopy doesn't work with SP3.
>> Yet.
>> Is it fixed now?

>
> Ask the Author, Kan Yabubumoto.
>
>
> --
> http://www.bootdisk.com/
>
 
Re: Creating shortcut via script

Try this:

Shortcut 1.11 24 KB (Freeware)
http://www.optimumx.com/download/#Shortcut

"/
Allows you to create, modify or query Windows shell
links (shortcuts) from the command-line. You can
export the properties of an existing shortcut to a
text file in .INI format. Use 'Shortcut /?' to view
the syntax.
/"


ju.c


"John" <info@nospam.infovis.co.uk> wrote in message news:udTdb01IJHA.5900@TK2MSFTNGP02.phx.gbl...
> Hi
>
> Is there a way to use a batch file or script to do the following;
>
> 1. Create a folder X
>
> 2. Copy a file form another location to folder X.
>
> 3. Create a shortcut to copied file in folder X on the desktop?
>
> If batch or script can not do this, is there another way?
>
> Thanks
>
> Regards
>
>
>
>
 
Re: Creating shortcut via script

"ju.c" <bibidybubidyboop@mailnator.com> wrote:

>Xxcopy doesn't work with SP3.


Interesting, but I'm not talking about xxcopy. This is a different
program, apparently from the same place, called xxmklink. It doesn't
copy files, it makes a link. I don't see any mention of SP3 on the
page.

--
Tim Slattery
MS MVP(Shell/User)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
 
Re: Creating shortcut via script

"ju.c" <bibidybubidyboop@mailnator.com> wrote:

>Try this:
>
>Shortcut 1.11 24 KB (Freeware)
>http://www.optimumx.com/download/#Shortcut
>
>"/
>Allows you to create, modify or query Windows shell
>links (shortcuts) from the command-line. You can
>export the properties of an existing shortcut to a
>text file in .INI format. Use 'Shortcut /?' to view
>the syntax.


Sounds good!

--
Tim Slattery
MS MVP(Shell/User)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
 
Re: Creating shortcut via script

Oh, I thought xxmklink was an xxcopy command. Doh!


"Tim Slattery" <Slattery_T@bls.gov> wrote in message news:a1h9e4tb0ool4kk4cipvhde0difn35625r@4ax.com...
> "ju.c" <bibidybubidyboop@mailnator.com> wrote:
>
>>Xxcopy doesn't work with SP3.

>
> Interesting, but I'm not talking about xxcopy. This is a different
> program, apparently from the same place, called xxmklink. It doesn't
> copy files, it makes a link. I don't see any mention of SP3 on the
> page.
>
> --
> Tim Slattery
> MS MVP(Shell/User)
> Slattery_T@bls.gov
> http://members.cox.net/slatteryt
 
Re: Creating shortcut via script

How to to do the following with a batch file:

1. Create a folder.
2. Copy a file to the created folder.
3. Create a shortcut on the desktop pointing to the
file that was copied to the created folder.


1. Download required files:

To create the shortcut:
Shortcut 1.11 24 KB (Freeware)
Info: http://www.optimumx.com/download/#Shortcut
Download: http://www.optimumx.com/download/Shortcut.zip

To launch the batch file without a command window:
Hidden Start 2.1 23 KB (Freeware)
Info: http://www.ntwind.com/software/utilities/hstart.html
Download: http://www.ntwind.com/download/hstart.zip

2. Copy both files to C:\WINDOWS\

3. Copy below and paste into Notepad:

----------copy inside only----------
@ECHO OFF

:: Create a folder:
MD "C:\Path To\New folder\"

:: Copy a file to the created folder:
XCOPY "C:\Path To\file.ext" "C:\Path To\New folder\"

:: Create a shortcut on the desktop:
C:\WINDOWS\Shortcut.exe /F:"%UserProfile%\Desktop\file.lnk" /A:C /T:"C:\Path To\file.ext"

CLS
EXIT

----------copy inside only----------

4. Modify the paths accordingly, then paste into Notepad.

5. Save-as AnyName.bat (any name + .bat)

6. Right-click and select "New->Shortcut"

7. Paste the following into the "Type the location of the item" area:
C:\WINDOWS\HSTART.EXE /NOCONSOLE "C:\Path To\AnyName.bat"

8. Give the shortcut a name and run it to test.


ju.c


"John" <info@nospam.infovis.co.uk> wrote in message news:udTdb01IJHA.5900@TK2MSFTNGP02.phx.gbl...
> Hi
>
> Is there a way to use a batch file or script to do the following;
>
> 1. Create a folder X
>
> 2. Copy a file form another location to folder X.
>
> 3. Create a shortcut to copied file in folder X on the desktop?
>
> If batch or script can not do this, is there another way?
>
> Thanks
>
> Regards
>
>
>
>
 
Back
Top