Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


shortcut_script & drive_script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3386
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> shortcut_script & drive_script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 shortcut_script & drive_script - 6/15/2005 2:30:27 AM   
  ahamami

 

Posts: 6
Score: 0
Joined: 6/15/2005
From:
Status: offline
greetings all,

is there a vb script to:

1- create a shortcut to a file
2- hide a drive / mapped-drive from my computer?

thanks in advance
 
 
Post #: 1
 
 Re: shortcut_script & drive_script - 6/15/2005 8:59:55 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
1. Can you use this ?
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\test.lnk")
link.Arguments = "1 2 3"
link.Description = "test shortcut"
link.HotKey = "CTRL+ALT+SHIFT+X"
link.IconLocation = "foo.exe,1"
link.TargetPath = "c:\blah\foo.exe"
link.WindowStyle = 3
link.WorkingDirectory = "c:\blah"
link.Save


2. For this you can use "diskpart" if installed.
Start cmd prompt and type diskpart <ENTER>
If you finally see DISKPART> then you can use bat files for obtaining the hide/unhide process.

Let us know.

< Message edited by didorno -- 7/20/2005 5:46:08 AM >

(in reply to ahamami)
 
 
Post #: 2
 
 Re: shortcut_script & drive_script - 6/15/2005 5:46:59 PM   
  ahamami

 

Posts: 6
Score: 0
Joined: 6/15/2005
From:
Status: offline
Man ... u're just great .. thank u so much ...

still trying to figure out how to work with diskpart though :)

since u're good at this ... do u know a script to set the homepage of Internet Explorer to a certain URL ?

thanks again for the help.


quote:
Originally posted by didorno

1. Can you use this ?

      

2. For this you can use "diskpart" if installed.
Start cmd prompt and type diskpart <ENTER>
If you finally see DISKPART> then you can use bat files for obtaining the hide/unhide process.

Let us know.


(in reply to ahamami)
 
 
Post #: 3
 
 Re: shortcut_script & drive_script - 6/16/2005 7:44:33 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
ahamami, thank you !
Tell me if Diskpart is available.
If it is, I will give you the programs for hide/unhide.

I think the homepage of IE can be changed in the registry.

(in reply to ahamami)
 
 
Post #: 4
 
 Re: shortcut_script & drive_script - 6/17/2005 5:13:13 PM   
  ahamami

 

Posts: 6
Score: 0
Joined: 6/15/2005
From:
Status: offline
yes man, it's available ..


quote:
Originally posted by didorno

ahamami, thank you !
Tell me if Diskpart is available.
If it is, I will give you the programs for hide/unhide.

I think the homepage of IE can be changed in the registry.



(in reply to ahamami)
 
 
Post #: 5
 
 Re: shortcut_script & drive_script - 6/18/2005 2:01:07 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
ahamami, I made a batch file OffBat.bat with the code

diskpart /s "X:\your path to\diskoff.txt"

I made a text file diskoff.txt with the lines :

REM DiskOff.txt

LIST VOLUME
LIST DISK
SELECT VOLUME N
REMOVE letter=N

On the other hand are a batch file OnBat.bat with the code

diskpart /s "X:\your path to\diskon.txt"

and a text file DiskOn.txt with lines

rem DISKOn.txt

LIST VOLUME
SELECT VOLUME=13
Assign letter=N


The line select volume=13 and the drive letter N have to be adapted to your configuration.
If you type diskpart in the command prompt window and type
list volume, you will find the correct volume values.

The hide command does not (always ?) remove the drive at once, but
then after reboot.

Regards.

< Message edited by didorno -- 7/20/2005 5:48:00 AM >

(in reply to ahamami)
 
 
Post #: 6
 
 Re: shortcut_script & drive_script - 6/26/2005 7:41:55 PM   
  ahamami

 

Posts: 6
Score: 0
Joined: 6/15/2005
From:
Status: offline
thanks man, very helpful ...
good day ..

quote:
Originally posted by didorno

ahamami, I made a batch file OffBat.bat with the code

      
I made a text file diskoff.txt with the lines :

      
On the other hand are a batch file OnBat.bat with the code

      
and a text file DiskOn.txt with lines

      

The line select volume=13 and the drive letter N have to be adapted to your configuration.
If you type diskpart in the command prompt window and type
list volume, you will find the correct volume values.

The hide command does not (always ?) remove the drive at once, but
then after reboot.

Regards.



(in reply to ahamami)
 
 
Post #: 7
 
 Re: shortcut_script & drive_script - 6/27/2005 8:22:35 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
ahamami, you are welcome !

(in reply to ahamami)
 
 
Post #: 8
 
 Re: shortcut_script & drive_script - 7/3/2005 1:29:05 AM   
  ahamami

 

Posts: 6
Score: 0
Joined: 6/15/2005
From:
Status: offline
didorno,

do you happen to know also a script that creates a shortcut for a drive or a mapped drive just like the one posted above?


quote:
Originally posted by didorno

ahamami, you are welcome !


(in reply to ahamami)
 
 
Post #: 9
 
 Re: shortcut_script & drive_script - 7/3/2005 2:18:01 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
ahamami, do you wish to make a shortcut by script comparable to a shortcut you can make by hand by dragging a drive from the windows explorer to for instance the desktop ?

(in reply to ahamami)
 
 
Post #: 10
 
 Re: shortcut_script & drive_script - 7/3/2005 2:47:45 AM   
  ahamami

 

Posts: 6
Score: 0
Joined: 6/15/2005
From:
Status: offline
didn't quite get ur question but i tried this and it worked fine :)
thanks for ur quick reply though .. good day ..


Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\Work.lnk")
link.Description = "Work"
link.IconLocation = "C:\WINDOWS\system32\SHELL32.dll,9"
link.TargetPath = "W:"
link.WindowStyle = 3
link.WorkingDirectory = "W:"
link.Save




quote:
Originally posted by didorno

ahamami, do you wish to make a shortcut by script comparable to a shortcut you can make by hand by dragging a drive from the windows explorer to for instance the desktop ?


(in reply to ahamami)
 
 
Post #: 11
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> shortcut_script & drive_script Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts