Change Directory command in batch file is not working
<p>I need to create a batch file to do a few things for a class I'm in. Everything needed to run works but I cannot find a simple answer as to why change directory (CD) is not working for me. I can't figure it out.</p>
<p>My code is as follows:</p>
<pre><code>@echo off

title NewUser

: creating a folder called &quot;Scripts&quot; on C:\
: add local user named: &quot;MaxLocal&quot; password: &quot;student&quot;
: create directory at the root of F:\ named &quot;Files_for_Max&quot;
: create ACE for user &quot;MaxLocal&quot; to &quot;Files_for_Max&quot; with: Read, read &amp; Execute, List folder contents
: Re-establish inheritence to sub folders and files
: copies cmd.exe from C:\Windows\System32 folder to &quot;Files_for_Max&quot;
: add &quot;MaxLocal&quot; to management group created in Assignment 3
: produces ICACLS report for &quot;Files_for_Max&quot; called &quot;icaclsReport.txt&quot; in &quot;Scripts&quot;
: moves this .bat file to &quot;Scripts&quot;

mkdir &quot;C:\Scripts&quot;

net user MaxLocal student /add

mkdir &quot;F:\Files_for_Max&quot;

icacls &quot;F:\Files_for_Max&quot; /grant MaxLocal:(OI)(CI)RX 

copy &quot;C:\Windows\System32\cmd.exe&quot; &quot;F:\Files_for_Max&quot;

net localgroup Management MaxLocal /add

icacls F:\Files_for_Max /save C:\Scripts\icaclsReport.txt /t

move  &quot;F:\NewUser.bat&quot; &quot;C:\Scripts&quot;

pause
</code></pre>
<p>So it's the last line specifically. MOVE works great but I'm not allowed to use it for whatever reason. I have tried a ton of ways of how to do it with CD to no conclusion. I need to take this NewUser.bat file on F and move it to the newly created scripts folder. Yes I have tried the /D command but perhaps I didn't have the correct spacing or used quotes when unneeded?</p>
<p>Any ideas?</p>