Page 1 of 1 1
Topic Options
#213283 - 2018-05-07 11:46 AM Creation shares with KIXTART
nathanjame Offline
Just in Town

Registered: 2018-05-07
Posts: 1
Loc: California
Hi,

I'm going crazy!
I want to create a share from a value retrieved from the
registry.
The value is a directory of the type c: documents and settingtoto my
documents
The recup of the value does it well.
on the other hand impossible to create sharing.

Where did I plant?
The problem seems to come from the fact that the path has spaces, that's
why I put the variable between "" when passing the
NET SHARE command .

Here is the part that goes wrong in my script


$ TEST = readvalue ("HKEY_CURRENT_USERsoftwaremicrosoftwindowscurrentversion
explorershell folders", "personal"

$ TEST
?
RUN "NET SHARE BACKUP =" $ TEST ""


Thanks in advance for your help

Top
#213284 - 2018-05-07 11:54 AM Re: Creation shares with KIXTART [Re: nathanjame]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
Why do you have a space between '$' and 'TEST?'
Top
#213285 - 2018-05-07 05:54 PM Re: Creation shares with KIXTART [Re: BradV]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Also missing some slashes and a closing parenthesis. Hopefully this is just a copy/paste error.
Top
#213286 - 2018-05-07 06:19 PM Re: Creation shares with KIXTART [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Perhaps give this a shot.

 Code:
$TEST = ReadValue("HKEY_CURRENT_USER\software\microsoft\windows\currentversion\explorer\shell folders","personal")

$cmd = '%comspec% /c NET SHARE BACKUP="' + $TEST + '"'

Shell $cmd


Edited by ShaneEP (2018-05-11 12:07 AM)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.045 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org