Jump to content











Photo
- - - - -

Auto-Mount a Network Share


  • Please log in to reply
9 replies to this topic

#1 deamon_knight

deamon_knight

    Newbie

  • Members
  • 13 posts
  •  
    United States

Posted 11 March 2013 - 09:30 PM

I have a server on my network sharing 3 folders //server/files/ ; //server/images/ and //server/backup/

 

I can manually load these and access them, but I would like to configure the PE Network Configurator to automatically mount these shares. I have added them in the network profiles in the script "Components>PENetwork" but they don't get loaded. Is there a tutorial on this tool somewhere, I'm nots ure if I'm missing something basic or I have the syntax wrong.



#2 Rootman

Rootman

    Frequent Member

  • Advanced user
  • 243 posts
  • Location:USA

Posted 11 March 2013 - 11:22 PM

It's been a long time since I addressed this issue but I seem to recall that I could NEVER get it to work right, so I made up a script to autostart and do it manually. I have it below, it's pretty crude and I tried to clean it up a bit for posting here, hopefully I didn't bust anything in doing so.  I have my CD drive set at X:, there surely is a variable I should use to make it more portable.  I am pretty crappy at this stuff.

 

NetworkX.script - the Winbuilder script

Networkx.cmd - the command that is attached to the script

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

NetworkX.script - the Winbuilder script

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

[main]
Title=NetworkX - Misc Tweaks
Description=Starts Penetwork (added in another script), waits 10 seconds then maps a network drive.
Selected=True
Level=5
Version=1
Mandatory=False
Download_Level=0
NoWarning=False

[variables]
%ProgramTitle%=NetworkX
%ProgramEXE%=networkX.cmd
%ProgramFolder%=NetworkX

[process]
RunFromRAM,TRUE
AddAutorun,NetworkX,X:\Program Files\NetworkX\networkx.cmd,,4

[Folder]
networkx.cmd=368,491

[EncodedFolders]
Folder

[EncodedFile-Folder-networkx.cmd]
lines=0

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Networkx.cmd

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@echo off
if not "%1" == "x" start "" /min "%~dpnx0" x && exit
rem the above is a trick I learned to make a script call itself again MINIMIZED to keep it off the screen, delete it if not wanted
rem Start the network
"X:\Program Files\PENetwork\PEnetwork.exe"

REM Map S: drive, force wait of 10 seconds to allow PEnetwork.exe to finish
ping -n 20 -w 1000 127.0.0.1 > nul
net use S: \\Servername\Share /user:DOMAIN\Username password

exit
 



#3 deamon_knight

deamon_knight

    Newbie

  • Members
  • 13 posts
  •  
    United States

Posted 05 April 2013 - 10:46 PM

Thanks Rootman. The networkx.cmd works for me,  but the script does not. It is enabled but it does not appear to be adding the file to the image and autoexecuting. If I run the networkx.cmd it will load the shares as I need. It does not seem to be creating the X:\Program Files\networkx\ directory and adding the networkx.cmd. Any advice how I can get this file added and auto running?

 

Thanks Again.



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13748 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 April 2013 - 12:42 PM

[Folder]
networkx.cmd=368,491

[EncodedFolders]
Folder

[EncodedFile-Folder-networkx.cmd]
lines=0

Check the above.

Thanks Rootman. The networkx.cmd works for me,  but the script does not. It is enabled but it does not appear to be adding the file to the image and autoexecuting. If I run the networkx.cmd it will load the shares as I need. It does not seem to be creating the X:\Program Files\networkx\ directory and adding the networkx.cmd. Any advice how I can get this file added and auto running?
 
Thanks Again.

You need to actually Embed/Encode the .cmd in the .script.

See:
http://code.google.c...der/wiki/encode
or more simply ;):
http://reboot.pro/to...elease-unwbzip/
http://reboot.pro/fi...tool-aka-wbzip/

:cheers:
Wonko
 

 
 



#5 deamon_knight

deamon_knight

    Newbie

  • Members
  • 13 posts
  •  
    United States

Posted 06 April 2013 - 02:23 PM

I've used the "Add files" function in the "creat script" dialogue. But that has not worked. Is there another step required?



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13748 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 April 2013 - 03:03 PM

I've used the "Add files" function in the "creat script" dialogue. But that has not worked. Is there another step required?

Cannot say. :( "it has not worked" means "nothing" to me, is the encoded file added or not?

 

See if this helps:

 

:cheers:

Wonko



#7 deamon_knight

deamon_knight

    Newbie

  • Members
  • 13 posts
  •  
    United States

Posted 06 April 2013 - 05:50 PM

Sorry Wonko, I should have been more descriptive. I have added the networX.cmd file to the script, here is my NetworkX Script:

 

[main]
Title=NetworkX - Misc Tweaks
Description=Starts Penetwork (added in another script), waits 10 seconds then maps a network drive.
Selected=True
Level=5
Version=1
Mandatory=False
Download_Level=0
NoWarning=False

[variables]
%ProgramTitle%=NetworkX
%ProgramEXE%=networkX.cmd
%ProgramFolder%=NetworkX

[process]
RunFromRAM,TRUE
AddAutorun,NetworkX,X:\Program Files\NetworkX\networkx.cmd,,4

[Folder]
networkx.cmd=439,586

[EncodedFolders]
Folder

[EncodedFolders]
Folder

[EncodedFile-Folder-networkx.cmd]
lines=0
0=eJytUU1LwzAYvhf6Hx4CetLZTkEoKIJO6WFuuItIL7F524a2SU2yrSd/u8k2UW+CJpfwfOXJG0M93v+84iiOjE96JLfVph0nZS8+sf9Jv6Gy0dBVFUeygtIO7ChluLoCGxms48YjDGe9VJ55F4MaE4YRx8egUbp9FdcQ+KveEKQFhzOybJGjI24UCTiNnrdeAlsaOTiUvOsgnaWuAq+5j57nj/k8f5ndBXFLNHg6tNpFexeROoGgjhwF5lB1y5Ujse+w2lUNcrUfVhyx56xYGl0b3uNedmSL5ewwSX86yCY0EguTeJrNMecDVhmEkRs6QaVNSf6SXRWkCSyVWgkbOvoX6C1+pAS4kkraJo4GqWqcKkwTnG69NUmQTi8nid8prqHWXRx5K9aWoDOworhdPDTauoKsh5UW51M/dU+bjIs+pDrDnTa4XdRBl16kXwlDhq+AHV2F5/7a//bdL3te/8IbR+H/PwBLegdpeJzjyUstKc8vyq7QS85NYRgFIw08Z4LQ2YzY5U2Xej9iYAIAtxMIT1RCeQ4BAAAAAgAAACgAAABrAQAAAAAAAAEAAAAAAAAAAAAAAA

And here is my modified networkX.cmd

 

rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

rem Networkx.cmd

rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@echo off
if not "%1" == "x" start "" /min "%~dpnx0" x && exit
rem the above is a trick I learned to make a script call itself again MINIMIZED to keep it off the screen, delete it if not wanted
rem Start the network
"X:\Program Files\PENetwork\PEnetwork.exe"

REM Map S: drive, force wait of 10 seconds to allow PEnetwork.exe to finish
ping -n 20 -w 1000 127.0.0.1 > nul
net use o: "\\COGhost\eset nod32" /user:admin password
net use p: \\COGhost\ghostfiles /user:admin password
net use q: \\COGhost\images /user:admin password

exit

Thanks



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13748 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 April 2013 - 06:04 PM

It looks like OK.

 

But what happens when you build?

In the LOG is the .script processed or not?

Does it throw an error?

(I was assuming that you verified that the .script was executed but that you had not encoded the file, now it seems like you encoded the file but the .script is not excuted).

Where/at what "level" (see the video) did you add it through the "create script"?

 

Wait a minute, that .script seemingly misses an extractfile directive:

http://code.google.c...riptAttachments

http://code.google.c...iki/extractfile

 

 

:cheers:

Wonko



#9 deamon_knight

deamon_knight

    Newbie

  • Members
  • 13 posts
  •  
    United States

Posted 06 April 2013 - 07:34 PM

Using this script the project build without errors and the ISO is bootable. However, the networkX.cmd is not executed when Win7PESE loads, and the network shares are not mounted at startup. If I take a USB Drive with the networkx.cmd, and run it in the Win7PESE enviornment, the network shares are loaded the way I want them to be. So I believe the networkX.cmd is correct, but that it is not being launched when Win7PESE loads.



#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13748 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 07 April 2013 - 10:59 AM

Let's try again. :unsure:

 

Is the NetworkX.cmd created/present in X:\Program Files\NetworkX\networkx.cmd in the booted PE?

Yes or No.

 

Is this added?

 

 

AddAutorun,NetworkX,X:\Program Files\NetworkX\networkx.cmd,,4

 

to %PE_CFG%?

http://code.google.c...wiki/addautorun

Yes or No.

 

IF yes to BOTH, then can it be that it is started "too early"? :dubbio:

 

:cheers:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users