|
|
|||||||
What I need to do is place the directory I CD into in a variable I can call elsewhere. What's happening is @CurDir is the same as @StartDir. 1) cd to a directory like below [this works fine]. Shell "cmd.exe /c cd %userprofile%\.." 2) make a directory in the above directory path, versus it going into the directory path of the scrip?. MD "WDrive\" + TestDir 3) save this new directory path in a Variable $WDrive, where @CurDir is the directory I changed to in number 1 above? $WDrive=@CurDir + "\WDrive\" + $UserDir Does using Shell "cmd.exe / cd" store this in @CurDir? Thanks in advance. Danfiggolf CODE Below ; ----- ; My Kixtart Script ; ----- ; create a new WDrive at the Documents and Settings directory level. Shell "cmd.exe /c cd %userprofile%\.." $UserDir=@userid + "$$"; MD "WDrive\" + $UserDir $WDrive=@CurDir + "\WDrive\" + $UserDir ; set permissions full control user and administrator Shell "cmd.exe /c echo y| cacls $WDrive" + "/t /g " + @userid + ":F" Shell "cmd.exe /c echo y| cacls $WDrive" + "/e /t /g administrator:F" ; mount virtual WDrive to the new storage area Shell "cmd.exe /c subst W: /D" Shell "cmd.exe /c subst.exe w: $WDrive" |
||||||||
|
|
|||||||
What I need to do is place the directory I CD into in a variable I can call elsewhere. What happening is @CurDir is the same as @StartDir. As well, I've tried - Shell "cmd.exe /c cd %userprofile%\.." > $NewDir |
||||||||
|
|
|||||||
you use cmd.exe. the directory is only changed in that environment and resetted when the exe exits. what you actually want, is to use kixtart internal cd command. |
||||||||
|
|
|||||||
Why CD at all? Code: ; ----- ; My Kixtart Script ; ----- ; create a new WDrive at the Documents and Settings directory level. $WDrive=%USERPROFILE%+"\WDrive\"+@USERID+"$$" MD $WDrive ; set permissions full control user and administrator Shell "cmd.exe /c echo y| cacls "+$WDrive+" /t /g "+@USERID+":F" Shell "cmd.exe /c echo y| cacls "+$WDrive+" /e /t /g administrator:F" ; mount virtual WDrive to the new storage area Shell "cmd.exe /c subst W: /D" Shell "cmd.exe /c subst.exe w: "+$WDrive |